Lumber Trigger Error

Benicio

New Member
Reaction score
1
Ok the trigger in the picture below isn't working I trying to give Blue(2)-Orange(6) and Pink(8)-Brown(12) 25 lumber every 150sec. So could someone tell me what is wrong? Thx in advance.

Also on another entire question...Do aura's no work when you try to make them upgrade? (What I get is when the tower is being built the aura is like already avalible without upgrading. Yes I did make sure the Techtree-Requirements had the aura that needed upgrade before use.)
 

Attachments

  • Lumber Trigger.JPG
    Lumber Trigger.JPG
    24.1 KB · Views: 78
K

Kevin

Guest
Well, I don't know how to mess with arrays, but you're definitely using an array. So I would assume it's because of how you initialized your array.

I'd use a regular trigger script if then else statement:

Code:
Events -
 Time - Every 150.00 seconds of game time
Conditions
Actions
 |If then else statement
   -If Controller of Player1_Red is = to User
    the add 25 to Player 1 Red's current lumber
   else do nothing
 |If then else statement
   -If Controller of Player2_Blue is = to User
    the add 25 to Player 2 Blue's current lumber
   else if do nothing
making an if then else statement for each user.



-----------------------------------------------------
signature:

The Tiki God needs your help!

http://www.thehelper.net/forums/showthread.php?t=48254

tyvm o!^_^!o
 
K

Kerberos

Guest
There is no Integer A that your conditions use. You need this:

Variables: AllPlayers (player group)

Code:
Events
    Every 150.00 seconds of game time
Conditions
Actions
    Set AllPlayers equal to (All players)
    Pick every player in AllPlayers and do (Actions)
        Loop - Actions
            If (All conditions are true) then do (Then actions) else do (Else actions)
                If - Conditions
                    ((Picked player) slot status) Equal to is playing
                    ((Picked player) controller) Equal to User
                    (Player number of (Picked player)) is Not equal to 1
                    (Player number of (Picked player)) is Not equal to 7
                Then - Actions
                    Add 25 to (Picked player) current lumber
                Else - Actions
                    Do nothing
    Custom script:    call DestroyForce( udg_AllPlayers )
If you're excluding 1 and 7 because they're computer players, you don't need the inequality conditions. The "user" requirement is already specified.
 

Benicio

New Member
Reaction score
1
Code:
Events
    Every 150.00 seconds of game time
Conditions
Actions
    Set AllPlayers equal to (All players)
    Pick every player in AllPlayers and do (Actions)
        Loop - Actions
            If (All conditions are true) then do (Then actions) else do (Else actions)
                If - Conditions
                    ((Picked player) slot status) Equal to is playing
                    ((Picked player) controller) Equal to User
                    (Player number of (Picked player)) is Not equal to 1
                    (Player number of (Picked player)) is Not equal to 7
                Then - Actions
                    Add 25 to (Picked player) current lumber
                Else - Actions
                    Do nothing
    Custom script:    call DestroyForce( udg_AllPlayers )

Ok I'm not understanding two things. I don't understand how to Set AllPlayers equal to (All players)
Pick every player in AllPlayers and do (Actions)
nor do i know how to create Custom script: call DestroyForce( udg_AllPlayers )
 

LordOglog

New Member
Reaction score
16
Use the set variable action (near the top of the list) make sure you've made the variable allplayers as a unit group.

Then do the action unit group pick every player in unit group and do actions.

Also custom script is near the top of the list too.
 
K

Kevin

Guest
Ok I'm not understanding two things. I don't understand how to Set AllPlayers equal to (All players)
Pick every player in AllPlayers and do (Actions)
nor do i know how to create Custom script: call DestroyForce( udg_AllPlayers )

I really suggest you use something akin to what I posted, and just have 1 if then else statement to check for each player.

It's a lot easier than messing with jass and arrays.
 

Benicio

New Member
Reaction score
1
Yes, But I am trying to learn array stuff and what you have showed will work it just take alot longer to make.


And LordOglog can you clearify what you are saying I not understanding a thing...I'm still learning...
 

Benicio

New Member
Reaction score
1
So how am i suppose to Set AllPlayers equal to (All players)? It won't let me.
 

Benicio

New Member
Reaction score
1
uh...no. I know how to name one but what kind of varible to make it or how varibles work I have no clue.
 
G

g1real

Guest
Whats with the highly complicated trigger part?
Lord... C'mon.. don't make it more difficult then it already "was"


Just do:
Code:
Events:
       Every 150.00 seconds of gametime.
Conditions:
Actions:
From each integer A (2 to 6)
       Do: Actions
               If/Then/Else
               Conditions:
                        Player(Integer A) is equal to user
               Then do:
                        Add 25 lumber to player(Integer A)
Same goes for integer B (8 to 12)

Q: Why didn't your trigger work?
Integer A is only used for a minor second as far as I can remember, also, you can't do actions with integer A before you do "From each integer *"
 

Benicio

New Member
Reaction score
1
what array do i make it?...what inital value do I give it?...(and I forgot where the Set trigger is Set AllPlayers equal to (All players) where do you find it)
 

Benicio

New Member
Reaction score
1
I confused Kakolukia That is what I did (as shown in picture) it won't work I dunno why.
 

LordOglog

New Member
Reaction score
16
it isnt an array the for each interger a is an array.

@Kakolukia i didnt tell him the trigger im just tellin him how to do it
 
S

Sunny_D

Guest
forget arrays, forget loops.

in your triggers above, you would give all players from 2 to 6 lumber. that means player 2,3,4,5, and 6.

make it simple. the trigger isnt that long even without loops

Code:
give gold
    Events
        Time - Every 150.00 seconds of game time
    Conditions
    Actions
[COLOR="DarkRed"]        -------- ------------------------------------------------------------------------ --------[/COLOR]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Player 2 (Blue) controller) Equal to User
                (Player 2 (Blue) slot status) Equal to Is playing
            Then - Actions
                Player - Add 25 to Player 2 (Blue) Current lumber
            Else - Actions
[COLOR="DarkRed"]        -------- ------------------------------------------------------------------------ --------[/COLOR]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Player 6 (Orange) controller) Equal to User
                (Player 6 (Orange) slot status) Equal to Is playing
            Then - Actions
                Player - Add 25 to Player 6 (Orange) Current lumber
            Else - Actions
[COLOR="DarkRed"]        ------and so on... 1 if-then-else for every player you want to give lumber------[/COLOR]

;)
 

Benicio

New Member
Reaction score
1
It fine I took the long way I'll save learning varible crud for another day but not I need focus on Spell crud & upgrade for towers....so could someone explain to me why my aura spells are allowed to use after tower is build BEFORE they upgrade them at upgrade building (yes i made sure Techtree-Requirement has it listed).
???
 
G

g1real

Guest
Benicio looking from your screenshot that wasn't what you did. You putted conditions for the integer BEFORE you said there would be an integer, notice how it goes.

Events:
BLABLABLA
Conditions:
Actions:


Oh and the aura part, I didn't quite get that =3.
 
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