Spike trap, need help

Flare

Stops copies me!
Reaction score
662
I don't really know what arrays does, only know that the regular is array 1 of some reason still I have seen people using 2700... I also ain't really familiar with "for each Integer A then do..." same with B ofcourse... Would be nice if you could explain a little more detailed

arrays just allow a person to store more information in a single variable (name that is) so you could have set real[1]= 1 all the way to real[8192]=8192 (example figures), rather than creating totally new variables for each value.

i get the feeling that the 2700 array value has something to do with me. i think i used that before as an array limit xD
 

Kazuga

Let the game begin...
Reaction score
110
Ok nice:p, only thing I don't understand now is the "for each integer a/b then do..."
 

Almighty11

New Member
Reaction score
5
Okidoki :)

I've updated the code in my previous code, just abit shorter.
Updated triggers, now with more comments:
http://www.epicwar.com/maps/download/42082/trap-halp-b.w3x

There is the Thing:
For each Integer A just runs that thing X times, and it count each time as an 'A Integer' at that time. So, instead of making 10x same action, you just loop it 10x.

Trigger Explanations:

Cast:

I used one variable just to help me off counting how many traps each player has set. Every time he set one, I increase this variable by 1.

Code:
Set aux[(Player number of (Owner of (Triggering unit)))] = (aux[(Player number of (Owner of (Triggering unit)))] + 1)

The other actions just create the Trap, and set variables for TrapCaster and Trap.

Detect:

Note the loop: It loops 1 time for each player controlled by a user;
then it loops for each trap that player has (thats when I use the 'aux' variable!). And finally, theres the action :)
Code:
For each (Integer B) from 1 to (Player number of (Player((Number of players in (All players controlled by a User player))))), do (Actions)
    Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                aux[(Integer B)] Greater than 0
            Then - Actions
                -------- If he has, check if there is anything (enemy) in its area. --------
                For each (Integer A) from 1 to aux[(Integer B)], do (Actions)
                    Loop - Actions
                        Unit Group - Pick every unit in (Units within 512.00 of (Position of SpikeTrap[(((Integer B) x MaxNumb_of_spikes) + (Integer A))])) and do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        ((Player((Integer B))) is an enemy of (Owner of (Picked unit))) Equal to True
                                    Then - Actions
                                        -------- Whatever you want trap to do here, for 'Picked unit' (Victim!) --------
                                        Unit - Remove SpikeTrap[(Integer A)] from the game
                                        Set aux[(Integer B)] = (aux[(Integer B)] - 1)
                                    Else - Actions
            Else - Actions

If you still didnt get something too well, it really doesnt botter me any explaning :p
 

Kazuga

Let the game begin...
Reaction score
110
Hm ok so how do you set this letter? All I can see is "for each integer a then do" but I can't see any A at all or how to set them

>Edit: Wops sorry, there they are^^ didn't look close enough :p
 

Kazuga

Let the game begin...
Reaction score
110
The spell almost works now, the main problem now is that of some reason the trap attacks more than one target even though the cooldown is over one minute , because of that it moves to 3 diffrent unit's... Anyway here's the trigger

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 Spike trap A 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 Spike trap A)) 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
        Wait 1.00 game-time seconds
        Unit - Add Earth spikes dummy  to SpikeTrap
        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
            Else - Actions
 
N

needshelpplz

Guest
asd

question, why cant you just do what they do with goblin mines? I.e. make it invisible and explode when someone goes over it?
 

Almighty11

New Member
Reaction score
5
Can you lay more than 1 trap at a time? Because, as previously said, this wont work for more than 1 trap at a time...
 

Kazuga

Let the game begin...
Reaction score
110
question, why cant you just do what they do with goblin mines? I.e. make it invisible and explode when someone goes over it?

Why I can't do what they do with the goblin mines? What do they do with the goblin mines? And I don't want it to have any sort of aoe, It's a trap that entraps one target, not more.
 

Kazuga

Let the game begin...
Reaction score
110
Can you lay more than 1 trap at a time? Because, as previously said, this wont work for more than 1 trap at a time...

No your not supposed to be able to lay more than one, I know how it went in anime fight with those mines you could lay like 10 or something and they are overpowered. If you are able to lay more than one then you can bunker up in duel or whatsoever, I will make so that if you lay a new mine when the last one still exist the last will die, only so that you still can use the ability even if noone steps on the last one
Edit: Only one of every type of hero can be played to.

unit is attacked event occurs during animation backswing, not when the atk lands. that is more than likely your problem.

hm.. and how to fix this?
 
N

needshelpplz

Guest
so simple

"Why I can't do what they do with the goblin mines? What do they do with the goblin mines? And I don't want it to have any sort of aoe, It's a trap that entraps one target, not more."

Ok, here is what you do, you make a goblin mine, take away it's exploding ability and instead give it an attack. This attack has a very slow cooldown and a very short range. This attack also has an AOE but the AOE only targets self. So when the mine attacks it will attack the units and at the same time make an aoe which kills itself. It's very simple and you wont need to get into triggers to do this. :shades:
 

Kazuga

Let the game begin...
Reaction score
110
"Why I can't do what they do with the goblin mines? What do they do with the goblin mines? And I don't want it to have any sort of aoe, It's a trap that entraps one target, not more."

Ok, here is what you do, you make a goblin mine, take away it's exploding ability and instead give it an attack. This attack has a very slow cooldown and a very short range. This attack also has an AOE but the AOE only targets self. So when the mine attacks it will attack the units and at the same time make an aoe which kills itself. It's very simple and you wont need to get into triggers to do this. :shades:

And your sure it won't cause the same problem as a normal attack? And "this attack" is it a special attack or just normal attacking?
 
N

needshelpplz

Guest
asdasda

"And your sure it won't cause the same problem as a normal attack? And "this attack" is it a special attack or just normal attacking?"

Give it say a melee attack as usual (you will probably want to use ensnare or something as the projectile model). Then edit it to give it an AOE attack. Then in object editor -> Combat Attack 1 - Area of effect targets, make it so that the AOE only targets self.

Another alternative would be to give the mine a negative vampiric aura.
 

Kazuga

Let the game begin...
Reaction score
110
"And your sure it won't cause the same problem as a normal attack? And "this attack" is it a special attack or just normal attacking?"

Give it say a melee attack as usual (you will probably want to use ensnare or something as the projectile model). Then edit it to give it an AOE attack. Then in object editor -> Combat Attack 1 - Area of effect targets, make it so that the AOE only targets self.

Another alternative would be to give the mine a negative vampiric aura.

A normal attack? That is what the trap has and it causes a bug problem that I took up earlier. Also I don't want any projectile art at all since a trap isn't supposed to shoot itself on someone... atleast not mine, I have also tried with an aura but it didn't work correctly
 
General chit-chat
Help Users
  • Ghan Ghan:
    Howdy
  • 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
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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