Spike trap, need help

N

needshelpplz

Guest
Xd

Do you have trouble with reading comprehension? :O

Just got object editor -> combat -> attack 1or2 -> weapon type and set it to artillery. If you also made sure that the attack has an area of effect and that the aoe targets self then it should work.
 

Kazuga

Let the game begin...
Reaction score
110
Did as you said, didn't work.. even though I made the dummy from the regular mortar team :S
All the units withing range are affected of some reason.. the reap move on them all but kills just one :S
 

Somatic

You can change this now in User CP.
Reaction score
84
May I ask 1 thing? The Spike Trap attacks only once? Or it remains there on the spot for a long duration of time?
 

Kazuga

Let the game begin...
Reaction score
110
May I ask you something? :rolleyes: Since when does a trap activate more than once? And your the second person asking this
 

Somatic

You can change this now in User CP.
Reaction score
84
Im sorry about this, But its to clarify my doubts for your problem.

If its only activated once, and destories after this its easy.

If you want it activating on an area around the mine after it triggers, do this.

Make a variation of the Goblin Land Mine's effect Ability, the one which sets its detection radius and also its delay. Then trigger it such that when a unit dies, check unit type which died is the mine's type, then select all units in the AOE around the point of the dead unit and then run ur effects on the target. Hope this helps.
 

Kazuga

Let the game begin...
Reaction score
110
Please read what a spell is supposed to do before you post... The trap isn't supposed to have any aoe at all, it entraps the victim, spikes him and den dies. I have allready tried with the goblin mine and it didn't work

>Edit: Guess I can update the code...

Code:
Spike trap setup
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Spike trap 
    Actions
        Set SpikeTrapCaster = (Casting unit)
        Unit - Create 1 EarthSpike mine dummy for (Owner of SpikeTrapCaster) at (Position of SpikeTrapCaster) facing (Position of (Triggering unit))
        Unit - Turn collision for (Last created unit) Off
        Unit - Order (Last created unit) to Undead Crypt Fiend - Burrow
        Unit - Create 1 Mortar Team for (Owner of SpikeTrapCaster) at (Position of SpikeTrapCaster) facing (Position of (Triggering unit))
        Set SpikeTrap = (Last created unit)
        Set SpikeTrapPoint = (Position of SpikeTrap)
        Unit - Turn collision for SpikeTrap Off
        Animation - Change SpikeTrap's size to (1.00%, 1.00%, 1.00%) of its original size

Code:
Spike trap activate
    Events
        Unit - A unit Is attacked
    Conditions
        ((Attacking unit) is in (Units of type Mortar Team)) Equal to True
    Actions
        Set SpikeTrapvictim = (Attacked unit)
        Unit - Pause SpikeTrapvictim
        Unit - Move SpikeTrap instantly to (Position of SpikeTrapvictim)
        Animation - Change SpikeTrap's size to (100.00%, 100.00%, 100.00%) of its original size
        Animation - Change SpikeTrapvictim's size to (1.00%, 1.00%, 1.00%) of its original size
        Wait 1.00 game-time seconds
        Unit - Add Earth spikes dummy  to SpikeTrap
        Wait 1.00 game-time seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Spike trap  for SpikeTrapCaster) Equal to 1
            Then - Actions
                Unit - Cause SpikeTrapCaster to damage SpikeTrapvictim, dealing 300.00 damage of attack type Pierce and damage type Normal
                Unit - Kill SpikeTrap
                Animation - Change SpikeTrapvictim's size to (100.00%, 100.00%, 100.00%) of its original size
            Else - Actions
 

Somatic

You can change this now in User CP.
Reaction score
84
If so, that means it only hits 1 unit right? Then in that case What im refering to is out of the 2 skills of the Goblin Land Mine, 1 of them is used to detect units coming too close. Using that skill to kill your "Mine" and then let it Run its effect. As you can set the effects to run after its killed. And naturally picking the unit most close to the point where the Mine Died you can get your target.
 

R@i_no_Wyrm

New Member
Reaction score
43
Trigger 1:
Let's just make an unit (call it trap dummy).
Don't set it into a variable.
No need to set a point.
Make the unit's classification as a walkable unit.
Don't turn the collision off.
Don't order it to burrow.
Make the unit model as a burrowed unit.
Give the unit 1-2 chaos damage.
Give the unit no backswing/damagepoint
Give 10 attack cooldown.

Trigger 2 :
When an unit is attacked,
if attacking unit type equal to (trap dummy),
add generic expiration timer to 0.25 seconds.
Move the attacked unit to position of (attacking unit) <-- leaks!
 
N

needshelpplz

Guest
:)

Wait, wait, you aren't ordering the mortar/mine to burrow are you? Because if you do it wont be able to attack. It would be better to simply give it the burrow model file instead.

"All the units withing range are affected of some reason.. the reap move on them all but kills just one "

If that occurs then your aoe must be affecting multiple units. Make sure the aoe only targets self and the regular attack hits the target.

You should try temporarily turning off all the triggers and using my method, because when I tested it, it worked.
 
N

needshelpplz

Guest
here

Ok, i'll give you a step by step way to do it.

Open Object Editor.
Click create new custom unit.

Choose the spirit wolf (farseer ability) and give it the name spike trap.
Change the model file to whatever you want (burrow, goblin mine or whatever), alone with the unit's icon.

Set the movement to 0, the speed base to 0, the turn rate to 0, the movement type to none and the collision size to 0.

For attack 1, edit the full area of effect to 150 or something, change the area of effect targets to self, increase the cooldown time to 10.

Set the number of dice to 0 and the damage to whatever you want it to be.
Set weapon type to artillery (leaving attack type alone), change armor type to wood and change weapon sound to whatever you want it to be.

Change the stats to whatever you want, the tool tip to whatever you want and change another other desired changes.

Do the same with Dire wolf and shadow wolf (if you want the ability to be stronger as you level).

Then click on the abilities tap and click new custom ability. Base it off of feral spirit and rename it spike traps or whatever.

Scroll down, change number of summons to 1 (for all 3 levels).
Change data - summoned unit to your desired unit.

If you want the traps to be permanent (but still disappear if someone uses another) then change level 1 - stats - buffs to none.

Then your hero should be able to summon a unit which cant move and does 1 attack which kills itself.
 

Kazuga

Let the game begin...
Reaction score
110
Seriesly, I'm geting pissed off at myself for not making a small event to work... I have attached a test map with the spell in it so you can see if you could fix it... I have added comments in the triggers that tells you what is what and what does what...

Oh and don't mind the other spell earth spikes, it's almost done but working perfectly.
 

Flare

Stops copies me!
Reaction score
662
fixed. i changed a few things, added reasons with comments. its working now, i made it do 100x Ability Level in damage, but its easy to change, and ive added a comment to show you how. removed a few unnecessary stuff as well, a test command (which spawns a target unit right on top of the trap) and a restore trigger which fully heals ur hero

and you didnt remove classifications from the dummy units, that was one of the problems. Worker class units WONT auto-attack (and ur dummies were Worker class)

edit: one more thing. in the code you posted earlier

Code:
        Set SpikeTrapvictim = (Attacked unit)

in the code in the demo map, spiketrapvictim was set to Picked Unit. why on earth did you change it? (unless i changed it by accident, but i dont recall doing that)
 

Attachments

  • earth spikes GUI (fix).w3x
    37.9 KB · Views: 103

Sooda

Diversity enchants
Reaction score
318
Looking campaign item called Goblin Land Mine helps much. It' s hole purpose is to be trap and activate when unit(s) come in range.
I used custom 'Mine - exploding' ability (use Crtl + f to find it in Ability tab) to generate 'Unit Death' event. That event helps me to detect which Spike Trap was 'activated'.
Adding conditions to check did dieing unit was Spike Trap and if it' s true do actions to spiked units.

'CUSTOM_point' is point variable.
'CUSTOM_triggerUnit' is unit variable.

I used custom scripts to remove leaks and create nice spike effect, what is pretty hard to do in GUI. It kept ability multi unit instance ability (Means more than one Spike Trap can be activated at same time without messing up triggers.).
Code:
Spike Trap Easy
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Spike Trap (Custom Goblin Land Mine)
    Actions
        Custom script:   local effect whichEffect = null
        Set CUSTOM_point = (Position of (Triggering unit))
        Custom script:   set whichEffect = AddSpecialEffectLoc("Abilities\\Spells\\Orc\\SpikeBarrier\\SpikeBarrier.mdl", udg_CUSTOM_point)
        Set CUSTOM_triggerUnit = (Triggering unit)
        Custom script:   set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units within 300.00 of CUSTOM_point) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A structure) Equal to False
                        ((Picked unit) is dead) Equal to False
                        ((Picked unit) belongs to an enemy of (Owner of CUSTOM_triggerUnit)) Equal to True
                    Then - Actions
                        Unit - Cause CUSTOM_triggerUnit to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
                    Else - Actions
        Custom script:   call RemoveLocation(udg_CUSTOM_point)
        Wait 1.00 game-time seconds
        Custom script:   call DestroyEffect(whichEffect)
        Custom script:   set whichEffect = null
My trap currently is in item form (custom Goblin Land Mine item), but you could detect ability cast and create same unit to ability being cast point too.
Removing leaks and other handles (For example each special effect what you create needs to be at some point destroyed if not used all the time or it will cause soon very strong lag in game.).
You could download my modified map below my post. In your triggers I commented bit and your first mistake was using 'Picked Unit' instead 'Triggering Unit' what is right event response.

I may remove that attachment if I need more space or feel like it any time.
 

Attachments

  • earth spikes GUI MODIFED by Sooda.w3x
    38.2 KB · Views: 97
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top