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
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top