|
|
Hi,
I've just started messing around with scripting maps and I have some questions. I've been trying to make a script for a map that instantly kills a creep/hero on the map if it gets below X hp. I have the netbeans add on and I've been looking at some hero abilities(lego, martyr) to find out how to compare something's hp and kill it.
I'm pretty sure this is way off but this is what I've come up with so far:
<onframe >
<compare a="target_health" b=100(Hp limit to kill) op="lt">
<kill target="target_entity" /
</compare>
</onframe>
So yeah, if the script is correct, how do I get it to trigger off every creep/hero on the map, and where would I put it?
Any help would be appreciated, thanks.
Last edited by WhySoDeep; 01-07-2012 at 12:58 PM.
Hi
Your script is almost proper, you only miss > in 3rd line :P
To loop through all units on map you can use <areaofeffect/> action with targetselection="all", targetscheme="all_units" and global="true"
Now where to place this script? You can create indestructible gadget which could have it in <onframe>. I wouldn't use <onframe> event though, because it requires a lot of resources, but I'd prefer checking their HP in bigger intervals. To do it you have to use infinite state with impactinterval defined. In order to apply infinite state you can use <aura/> in gadget.
P.S. I recommend to unpack whole resources0.s2z zip file from HoN\game folder and use Notepad++'s Search in Files command to get hundreds of examples.
Maybe use an aura with <ondamageevent /> tag where you would use your code. That way
you wouldn't need to check in an interval =)
[Custom Map] Valkyrie Wars [Dream]
[Guide] How to create a neutral creep spot | [Map] Borderland [Dream]
[MineCraft Server] CraftCraft 20Slot 24/7 [84.200.47.30]
Hey, thanks for the help guys! I've looked at more abilities in the resources folder, and I've tried to make a gadget with an aura that applies a state with an ondamage trigger. Heres what I got:
A textfile named gadget.entity with:
<?xml version="1.0" encoding="UTF-8"?>
<gadget
name="Gadget_AuraKill"
model="/shared/models/invis.mdf"
icon="icon.tga"
boundsheight="0"
boundsradius="0"
isselectable="false"
canrotate="false"
ismobile="false"
effectscale="1"
attacktype="none"
lifetime="0"
deathtime="0"
corpsetime="0"
invulnerable="true"
flying="true"
sightrangeday="0"
sightrangenight="0"
drawonmap="true"
mapicon="minimap_icon.tga"
mapiconsize="0.075"
mapiconcolor="1 0 0 1"
passiveeffect="effects/state.effect"
alwaysvisible="true"
hidden="true"
stealthtype="unrevealable"
fadetime="0"
>
<aura
gadget="Gadget_AuraKill"
radius="10000"
targetscheme="all"
state="State_AuraKill"
/>
</gadget>
and a textfile state.entity with:
<?xml version="1.0" encoding="UTF-8"?>
<state
name="State_AuraKill"
icon="icon.tga"
effecttype="StatusDebuff"
passiveeffect="effects/state.effect"
>
<ondamageevent />
<compare a="target_health" b=100 op="lt">
<kill target="target_entity" />
</compare>
</state>
So would this script work? If it does where do I put the text files to get the gadget on my map?
Unfortunately it wouldn't, but only minor mistakes here
<gadget
name="Gadget_AuraKill"
model="/shared/models/invis.mdf"
icon="icon.tga"
boundsheight="0"
boundsradius="0"
isselectable="false"
canrotate="false"
ismobile="false"
effectscale="1"
attacktype="none"
lifetime="0"
deathtime="0"
corpsetime="0"
invulnerable="true"
flying="true"
sightrangeday="0"
sightrangenight="0"
drawonmap="true"
mapicon="minimap_icon.tga"
mapiconsize="0.075"
mapiconcolor="1 0 0 1"
passiveeffect="effects/state.effect"
alwaysvisible="true"
hidden="true"
stealthtype="unrevealable"
fadetime="0"
>
<aura
gadget="Gadget_AuraKill"- it would crash HoN, by creating new gadget for every unit which aura targets
radius="10000"
targetscheme="all"
state="State_AuraKill"
/>
</gadget>
and a textfile state.entity with:
<state
name="State_AuraKill"
icon="icon.tga"- it's hidden state, it won't use icon
effecttype="StatusDebuff"- it is irremovable, so it shouldn't have effecttype
passiveeffect="effects/state.effect"- not needed, it's hidden aura
ishidden="true" - makes state invisible for players
>
<ondamaged > - from guide: "This entity has taken some amount of damage (after damage is dealt)"
<compare a="target_health" b=100 op="lt">
<kill target="target_entity" />
</compare>
</ondamaged>
</state>
So this is proper code:
To get it working you have to:
Open you map.s2z file and create Resources folder here. Paste you files there and you'll have access to them in HoN
Map editor won't see them though
Easiest way to place your gadget on map is editing entitylist file in map.s2z Replace one of entities with your own gadget by changing it's type="..." to type="Gadget_AuraKill"
Thanks a lot for the help tojooko! I changed all the text files to what you said, however, I'm having trouble adding the files into my map. I can't seem to create a resources folder within the map.s2z or add files to it in net beans or winrar, it seems I don't have permission to edit these files or something.![]()
I found this : http://forums.heroesofnewerth.com/sh...d.php?t=302463
and i noticed your name under the "team members"...Are you still working on that map? It looked really cool!!!
Premium Tips and Tricks Guide: http://forums.heroesofnewerth.com/sh...php?p=14769758
I am an angry nerd who makes angry music in my bedroom. I also like doing flips.