PDA

View Full Version : [Support] I have three questions (so far)



i927
06-04-2011, 02:38 PM
Firt of all, I've already searched the forum for similar questions. Have found none so if there is already a similar question im sorry I didn't found it.

Question #1
How do I make a creepspawner so it will spawn a single creep every X seconds (e.g. 5) which creeps will walk in a definned node path and then disappearing when reach a spot or position or pathnode?

What I want to make is a Devourer Practice Map so what I want is to have a stream of creeps (for example walking through a SightBlocked terrain) which can be hooked. Then either the creep is hooked succesfully (I would say giving the creep 1 hp would solve this) or reached the final path node it want it to disappear. Maybe making some permanent AoE in the last pathnode so the creeps will die?


Question #2
What do I have to do to have devourer selected automatically in the beggining such as in the Vakirie Wars? I don't know how to make the custom devourer yet but i will learn it in the guides. I've already set the trigger spawn like in the other maps (Caldavar, etc) but what i dont know is how to make Devourer instaspawned there instead of selecting it in the Hero Select lobby.

Question #3
I've made a room in the map where the player can select a "level" of practice (blind hooks, straight running creeps, hookign targets shielded by static creeps...) where the player is supposed to get teleported into chosen level room. How do i make teleport spots? (When the player stays over the spot he gets teleported to the desired room)

That's it so far, if I have more questions I will edit this post.

Thank you very much, I appreaciate the effort.:devo:

tojooko
06-04-2011, 05:51 PM
Question #1
How do I make a creepspawner so it will spawn a single creep every X seconds (e.g. 5) which creeps will walk in a definned node path and then disappearing when reach a spot or position or pathnode?

You can do it by using gadget with state with defined i mpactinterval value. You will have to spawn creeps in <onimpact event and order them to move to target position. So, about pathing: You have to use <order
Info from FAQ:

<order // The source issues an order of the given command to the target unit.
source="source_entity"
target="target_entity"
command="Command" // Can be such things as attack, wander, stop, assist, follow, hold, etc. Can also be "event" which calls an order.entity of the given OrderName
parameter="Parameter" // Unused
queue="back" // Can be set to front or back
force="false" // Forces the entity to do this order and nothing else for the duration
forceduration="0" // Only used if force is true, and says how long it lasts
restrict="false" // Sets to true if the event order is used
ordername="Name" // Name of the order.entity to use
value0="Value0" // Unused
duration="0" // Duration of the order
block="Block" // Used in tutorial, unused
/>

command must be set to "move"
I've never used this action, but you can check how to use it in Puppet's second skill (I suppose force="true" and queue="true" but just check it, I'm not on my PC so sorry for it)
Well, once you will have SpawnerGadget, you will need a target. You can do it in two ways. First, which were I you, I'd use it is making TargetUnit and giving both entities same team (eg. 235) (max. team value is 255) In <onspawn event of SpawnerGadget find allied unit and set it as proxy_entity of spawning state

GadgetSpawner file:


<onspawn>
<areaofeffect
radius="9999"
maxtotalimpacts="1"
targetscheme="ally_units"
effecttype="Magic"
>
<applystate target="this_entity" name="SpawningState" continuous="true" proxy="target_entity"/>
</areaofeffect>
</onspawn>

SpawningState:


<onimpact>
<spawnunit name="Creep" target="this_owner_entity" pushentity="true"/>
<order command="move" target="stack_entity"... - no idea where to put proxy_entity :( As said above- check it
</onimpact>

To kill creep just add deadly aura to TargetUnit


Question #2
What do I have to do to have devourer selected automatically in the beggining such as in the Vakirie Wars? I don't know how to make the custom devourer yet but i will learn it in the guides. I've already set the trigger spawn like in the other maps (Caldavar, etc) but what i dont know is how to make Devourer instaspawned there instead of selecting it in the Hero Select lobby.

No Hero Pick - Auto Assigned Hero (http://forums.heroesofnewerth.com/showthread.php?t=254167) Final code is in 10th post, but it requres fix. ignoreinvulnerable parametr in <aura> must be added (not sure which one, true or false :P)



Question #3
I've made a room in the map where the player can select a "level" of practice (blind hooks, straight running creeps, hookign targets shielded by static creeps...) where the player is supposed to get teleported into chosen level room. How do i make teleport spots? (When the player stays over the spot he gets teleported to the desired room)

That's it so far, if I have more questions I will edit this post.

Thank you very much, I appreaciate the effort.:devo:
Well, I'd do it in simmilar way as pathing. Make gadget with eq. aura which triggers when hero gets into it. Again create only two gadgets in one team, let them find each other and it's nearly done. You must add a state Teleportated which prevent hero from teleportation becouse without it you will get into infinite loop. On the other hand you can use powerups insted of gadgets as teleports, becouse its <ontouch event won't set hero in loop, but it's your choice. Of course you must use <teleport action whos description you can find in FAQ.

Schm0ftie
06-05-2011, 09:28 AM
No Hero Pick - Auto Assigned Hero Final code is in 10th post, but it requres fix. ignoreinvulnerable parametr in <aura> must be added (not sure which one, true or false :P)

I did fix the posted code, so now it is only necessary to change the values which
depends on your map.

i927
06-05-2011, 07:04 PM
Ok I've solved my 2nd and 3rd Question. The hero select thing was solved by Oloko.

The teleport stuff was solved by me searching in Grimmcrossing map teleporters.

I still don't know how to make a creep stream :S and tojooko (http://forums.heroesofnewerth.com/member.php?u=618696) I'm sorry but I don't have that knowledge level so I don't know how to do that. I've searched the forums and I can't find any guide of how to use gadgets.

If somebody could please explain me how to make that I would appreciate it.

Aclarations: What I want is to place, for example, an invis object (i dont mind the model) which will spawn 1 creep each 10 seconds and then either by placing LaneNodes or whatever you think is better make those creeps walk in a LaneNode-defined path till that creep reaches an area where it will dissapear.

Oloko told me it's not that easy and I fear I don't have the enough knowledge. On the other hand, I can't find any guide to learn the basics of gadgets, triggers, etc. so if anybody could either explain me the basics or link me any guide I would appreciate it.

Thank you all.

Bad_McPants
06-05-2011, 09:58 PM
Oloko told me it's not that easy and I fear I don't have the enough knowledge. On the other hand, I can't find any guide to learn the basics of gadgets, triggers, etc. so if anybody could either explain me the basics or link me any guide I would appreciate it.

Pseudo-script for one possible solution:

1. Create a map with lane entities that you want to creeps to travel down.
2. Create a gadget with a 10 second timer that does the following:
2a. On timer:
2b. Spawn a new creep, push creep on to the stack
2c. Give stack entity orders to proceed to first lane entity.
3. On touch of lane entity:
3a. Give target entity orders to proceed to next lane entity.
4. Continue until end
5. Make a killbox entity that kills all creeps that get near it at the end of the lane.

Hope this helps.

Oloko
06-06-2011, 11:29 AM
Since you are new at this kind of thing, try making things one step at a time.
The first thing you need to do is to spawn creeps. That alone isn't complex, but you still need to learn a bit of things to be able to do it.

Gadgets are really useful in map making because they are entities that usually don't move, don't attack, spells don't affect them (there shouldn't be a target scheme that works on "gadgets"). Of course, any of those can be changed for any gadget (e.g: Pollywog's wards are gadgets and can attack).
You will often use them to create proximity triggered script (zone triggers) or as place holder to start scripts (e.g: spawners). Usually gadgets are invisible so players don't even know they exist. If you take a look at some existing scripts, you will see that they are used for a lot of different things.

That being said, you can look at this post (http://forums.heroesofnewerth.com/showpost.php?p=12768156&postcount=7) for a basic unit spawner. In your case, you don't actually want a building spawning units, so all you have to do is to make the same things, but for a gadget.
You don't actually need to create a gadget from the start if you don't want to, you can simply take an existing regular gadget and edit it.
That script will make a unit spawn every 3 sec and order that new unit to attack_follow (move to a point and attack enemy units you see) to a specified destination. Since you don't want the unit to attack, I think that you can simply change the "attack_follow" order to "move".

As for moving along a path, its exactly like others have said, you will need to put gadgets that will have a "proximity trigger" that will order units that get close to them. I don't have the time right now to explain in more detail how to do it, but you can start working on the spawn thing before doing this part.

i927
06-06-2011, 02:11 PM
Well I've just read you post Oloko but I've advanced a little.

I've already got the creep spawner and I know how to make them move where I want.

What I've done (searching in Valk Wars' map and caldavar's) is to make a gadget

gadget_creep_spawn.entity


<gadget
name="Gadget_Creep_Spawner"
icon="icon.tga"
portrait="icon.tga"
model="/shared/models/invis.mdf"
skin=""

passiveeffect="/world/props/druidStatue_effects/effects/evil.effect"
spawneffect=""
respawneffect=""
selectsound=""
orderconfirmedsound=""

preglobalscale="1"
modelscale="1"
effectscale="1"
boundsheight="128"
boundsradius="16"
selectionradius="64"
targetoffset="0 0 64"

maxhealth="0"
nothreat="true"
invulnerable="true"
hoveronmap="false"

prefertouch="true"

immunity="GadgetImmunity"

attacktype="none"
combattype="Ranged"



alwaystargetable="true"
alwaystransmitdata="true"
alwaysvisible="true"

>

<onaddplayer>
<starttimer duration="2000" />
</onaddplayer>

<ontimer>
<setent0 name="Creep_Spawner_1" />
<spawnunit name="Creep_HellbourneMelee_1" source="target_entity" target="ent0" pushentity="true" team="2" />
<starttimer duration="2000" />

</ontimer>

<ontouched>

<setent0 name="Creep_Spawner_1" /> // Where I want the creep get spawned
<spawnunit name="Creep_HellbourneMelee_1" source="target_entity" target="ent0" pushentity="true" team="2" lifetime="2000" />


</ontouched>




</gadget>

Well the only thing I can't get solved is the ontimer thing. That ontimer won't work and that's why i added the ontouch thing (which works)

Next thing is that lifetime="5000" stuff (so I don't need the killbox or whatever) but it won't work, it gets the just spawned unit get killed just after it's spawned as if the value were "0". (When I remove this the unit goes to the desired position)

The creep goes to the desired positio just using this in the creep.entity file:

creep.entity


<onspawn>
<setpos0 name="Pos_1"/>
<order command="wander" source="this_entity" target="pos0"/>
</onspawn>
The Pos_1 thing is an entity wich has his type set on:



gadget_loc_1.entity


<gadget
canattack="false"
canrotate="false"
drawonmap="false"
hoveronmap="false"
icon=""
immunity="GadgetImmunity"
invisible="true"
invulnerable="true"
isselectable="false"
model="/shared/models/invis.mdf"

name="Gadget_Loc_1">



<aura radius="500" state="State_Loc_1" targetscheme="all_units"/>



</gadget>

Then the state can be both of this:

state_loc_1.entity


<state icon="/heroes/behemoth/icon.tga" name="State_Loc_1" targetscheme="ally_heroes">
<oninflict>

<setpos0 name="Pos_2"/>
<order command="wander" source="target_entity" target="pos0"/>

</oninflict>
</state>

Which will send the creep to another Location. I don't use this because im just testing and I just want the creep to go fro mspawnpoint to just one Location (Pos_1)

So what I've tried to do is to change the state so it will kill the reaching creeps:



<state icon="/heroes/behemoth/icon.tga" name="State_Loc_1" >
<oninflict>
<damage
source="source_entity"
target="target_entity"
targetscheme="all_units"
min=""
max=""
amount="999"
effecttype="Magic"
nonlethal="false"
b=""
op=""
inflictor="this_entity"
supertype=""
/>
</oninflict>
</state>

But this won't work :S

___________________________________________

To sum up: I've learnt alot and now I have some clue of how this works. So now if anybody can teach me how to make those creeps spawn each X seconds instead of clicking on the statue which i've put the gadget beneath and how to make those creeps die when they reach that Pos_1 (or either by setting a lifetime)

Oloko
06-06-2011, 03:36 PM
Ok, this is really hard to read with all the "&quot;". I know this was not intended, but still, if you could fix it, it would really help to read your scripts.

I can't test your script since I'm at work, but what you could do is to do some "debugging". Try putting <printdebuginfo /> in some of your event that might be causing you issues.
For example: you said the timer didn't work, so what you could do is add a <printdebuginfo /> action in the <onaddaplayer> event of the gadget to see if its triggered correctly. To see the result of the action, simply open your console with Ctrl+F8 and search for some green debug text (might be white in some case). If its in the console, you know the code is triggered correctly.

If you have two state of the same name in your map file, one of them will not work, so make sure you don't have your two "State_Loc_1" states in your map.
the <damage /> action used in your second "State_Loc_1" has too many param you don't need. If you want to remove the unit from the game, simply do: <delete target="target_entity" />.
You can try putting a <printdebuginfo /> action inside your oninflict event to know if its triggered correctly.

There might be more things to fix, its kind of hard to tell.

tojooko
06-06-2011, 04:53 PM
Well, I've already working code for making multiple lanes, just coding is easier than explaining idea:P. All in all I don't have to post it yet, depends on that do you want it. As you said "you've advanced a little" so I suppose you want to continue. I'll try to debug your code as well, but need a while.



To sum up: I've learnt alot and now I have some clue of how this works. So now if anybody can teach me how to make those creeps spawn each X seconds instead of clicking on the statue which i've put the gadget beneath and how to make those creeps die when they reach that Pos_1 (or either by setting a lifetime)


Well, I've tried making timer, but it seems <gadget> neither <creep> nor <pet> and so on can use it... It's dedicated for skills and states (Can be wrong, but it's my observation). To make spawning I made state with impactinterval and <onimpact> event:



state.entity:
<?xml version="1.0" encoding="UTF-8"?>
<state
name="State_Spawning"
impactinterval="5000"
ishidden="true"
>
<onimpact>
<setent0 name="Creep_Spawner_1" />
<spawnunit name="Creep_HellbourneMelee_1" source="target_entity" target="ent0" pushentity="true" team="2" lifetime="2000" />
</onimpact>
</state>


Apply state with <applystate target="this_entity" name="State_Spawning" continuous="true"/> in <onspawn> event

i927
06-06-2011, 05:07 PM
Scripts edited. I didn't even noticed. Dunno what happened. Sorry.

The <delete target="target_entity" /> works perfect. So wit.

About the timer I can't make it through :S. I've done the debug stuff and still nothing. I've tried using onentergame and nothing. I've put the debug stuff in the ontouched and it works so it's not because I placed it in the wrong place.

Once I get this timer working I can start making the map so please if you could help me...

Thank you very much.

EDIT

I've just seen and tested your script tojooko and it works perfect (well it spawns 3 creeps the first time but I don't mind that ^^)

Thank you both so much.

Now I start working in the main map.

tojooko
06-06-2011, 05:26 PM
Hmm downloaded your map and I've suggestion:
Try to not overwrite HoN files (excluding game_settings.cfg base.gamemechanics game_info.entity). E.g make new folder for bad_meele creep and call it devo_creep or like that. What is more don't copy models and clips but change paths in creep.entity file.
Hmm, seems did wrong example... Well, devourer could be better once you have made any changes... All in all, you have uploaded unnecessary models and clips files and if you are changing devourer hero you should make new folder for it and change paths like this:


model="model.mdf" -> model="/heroes/devourer/model.mdf"

I hope I've helped

i927
06-06-2011, 06:12 PM
I understand your point but I thought of making those rips once I've finished the map. About the bad_melee thing I will do so, I wasn't sure if the folders had to have the same name as in resources0; now I do. Thank you. Will upload the map once I have some instances made.