HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spike Traps

09-18-2007, 09:16 AM#1
Arcane
Quote:
Set an invisible Spike Trap at the target location. Once activated, it becomes visible for 1 second before viciously impaling the victim over 3 seconds. Only 3 traps may be out at once, and each trap needs to be 200 units away from each other. Spike traps cover an area of 150 units. This ability has a cooldown of 45 seconds.

Level 1: Spikes deal 60 damage per second.
Level 2: Spikes deal 90 damage per second.
Level 3: Spikes deal 120 damage per second.

That's what I want, but unfortunately, I have absolutely no idea how to do it. Spike Traps may be activated individually via a button on each trap, or activated in unison from the hero. Spikes dart up and down when activated, repeatedly impaling the enemy, and though it says "per second", I'd really prefer to have it be per 0.2 seconds or whatnot for realism. I've been stuck with this for almost an hour, help would be appreciated. If possible, could somebody make the whole spell for me? It'd save me the trouble of trying to understand other people's explanations in text, which I do horribly since my trigger knowledge isn't all that great. Credit will be given of course if somebody does make the spell.
09-18-2007, 09:55 AM#2
botanic
you could try something like this

event
unit comes within x of spike trap
actions
order spike trap to cast activate

the activate spell casting time would be the time it is visable before it attacks

PS: dont ask ppl to "just make the whole spell for me"
09-18-2007, 10:55 AM#3
Arcane
Uh... I don't think you get what I mean. I don't want a trap that activates when units get near, I want a trap that you have to activate manually.

As for the "make the spell" part... well, you could just give me an example of the trigger, but I can't be sure that I'll get it, and that means more trouble. I don't know, maybe somebody could think of this as a challenge? Not that this is a challenging spell for good triggerers. I would look at the code to try to understand it, I just have no idea how to start right now.
09-18-2007, 11:10 AM#4
Toink
If you can't even try to think of what to do for one of the simplest of spells, how will you finish a map?
09-18-2007, 11:30 AM#5
Arcane
Sorry. The description of the spell seems to be out of date... Updating it in a second.
09-18-2007, 11:32 AM#6
botanic
then just change the casting time to 1 second problem solved
09-18-2007, 11:41 AM#7
Arcane
I don't think anybody understands what I'm trying to do here. The spell I'm trying to make is like this:

You can set traps, not just one, but three, each covering an area of 150. The traps cannot overlap however, they have to be set 200 units away from each other, or any other enemy unit/structure. The hero has an ability that when pressed, activates all of the current traps in game, causing them (after the 1 second revealing time) to deal damage per second to all units in their 150 radius for 3 seconds, and then to disappear. The traps can also be activated individually, by using the ability each trap has on it.
09-18-2007, 11:45 AM#8
Toink
Have you ever even used your brain since you posted this topic? If you don't know how to trigger, then learn how to, just as simple as that.

Learn to walk before you run.
09-18-2007, 11:57 AM#9
Arcane
Oh, so is this the way you treat everybody who asks a question?

"Find out for yourself idiot."

Sure, I'm stupid, I don't know, so teach me.

I did, and am still working on figuring this out myself - but is asking a question a crime? I was as polite as possible in my post, I don't know how I offended you.
09-18-2007, 12:31 PM#10
Toink
I didn't get offended, nor did I even tried to offend you.

Quote:
I did, and am still working on figuring this out myself - but is asking a question a crime?

No. You also should know, think before you do ask. Your trying to bite off more than you can chew.

I am going to tell you how to do it, but I won't tell you anything else.


Make two dummy "detonate" abilities, one for each trap and one for the hero which sets off all the traps. Give them the abilities using object editor then make a trigger with an event like "Unit starts casting an ability"

Use the "Spell being cast equal to <YourDummySpell>" condition, then do your desired actions.
09-18-2007, 06:44 PM#11
botanic
or make the detonate ability have a 1 second cast time as I said awile ago :/ sry I wasnt clear I guess

@Toink why do it a simple way when you can give him a pathing detect engine as well as a timer function system, handlevars and cscache for good measure :P

EDIT: and keep at it after a little bit it all falls into place ^.^
09-19-2007, 05:22 AM#12
Pyrogasm
If you really can't figure it out, you can request it in the thread linked in my signature. I'll merge your original post into the end of the thread since it is, as of now, closed.
09-19-2007, 08:59 AM#13
Arcane
I'll make another attempt first I guess, though not today. Strictly speaking, I'm not allowed to use the computer on weekdays.
09-21-2007, 02:04 AM#14
Pyrogasm
In case they weren't clear, here's what you're going to do:
  • Make the spike trap a unit with, I would assume, the Impale model.
  • Give the unit permanent invisibility with a 0 second fade time so as to not be seen by enemies and negative flyheight so that it doesn't stick out of the ground.
  • When a unit begins casting (This is one of those special occasions in which you will want to use this event) the spell to lay a spike trap, check to see how many units are in the group (Units in (Playable Map Area) matching ((Unit-type of (Matching Unit) equal to Spike Trap) and (Owner of (Matching Unit) equal to (Owner of (Triggering Unit))))). If there are 3 or more units in said group, order the unit to stop and display an error message; if not, do nothing.
  • Have a 2nd trigger that fires upon a unit starting the effect of the abilty; have the trigger wait roughly 0.25 seconds and then set the trap's animation speed to 0%.
  • Have a trigger that activates when a spike trap is activated by whatever ability it has (you might base this ability off of war stomp, thunderclap, channel, etc.); this ability should have 3 levels.
  • Make it so that this trigger waits 1.00 seconds and then adds the activating spike trap to a global group (let's call it Spike_Group) and gives the spike trap a 3.00 second expiration timer.
  • Have a 4th trigger that runs every 0.20 seconds (or whatever you want the damage interval to be) and picks every unit in Spike_Group and causes the picked unit to deal damage to all units near it for ((Level of <The Activation Ability>)*30+30)*TimerInterval damage. If the unit is dead (its expiration timer has run out), then don't deal damage and simply remove it from the group.
  • Last, have one final trigger that detects when a unit uses its "Activate all spike traps" ability. When a unit does so, pick every unit in the group (Units in (Playable Map Area) matching ((Unit-type of (Matching Unit) equal to Spike Trap) and (Owner of (Matching Unit) equal to (Owner of (Triggering Unit))))) and add the picked unit to Spike_Group and give it a 3.00 second expiration timer.
Getting the traps to play animations properly is up to you.