Unit Multiplier, Whats wrong in my thinking?

Fragglez

New Member
Reaction score
4
I've been trying for quite a few hours now and I just don't see whats wrong in my thinking when it comes to fixing this trigger and getting it to work properly

Its somewhat like footies "BabyBoom" where if you keep it alive, it will increase the unit output by 1 (double it)

So... even after looking up a footies map that actually has the triggers put in, even trying to mimic everything, it still won't work!

Code:
Increase Unit per Cycle
    Events
        Unit - A unit owned by Player 1 (Red) Finishes training a unit
        Unit - A unit owned by Player 2 (Blue) Finishes training a unit
        Unit - A unit owned by Player 3 (Teal) Finishes training a unit
        Unit - A unit owned by Player 4 (Purple) Finishes training a unit
        Unit - A unit owned by Player 5 (Yellow) Finishes training a unit
        Unit - A unit owned by Player 6 (Orange) Finishes training a unit
        Unit - A unit owned by Player 7 (Green) Finishes training a unit
        Unit - A unit owned by Player 8 (Pink) Finishes training a unit
        Unit - A unit owned by Player 9 (Gray) Finishes training a unit
        Unit - A unit owned by Player 10 (Light Blue) Finishes training a unit
        Unit - A unit owned by Player 11 (Dark Green) Finishes training a unit
        Unit - A unit owned by Player 12 (Brown) Finishes training a unit
    Conditions
    Actions
        If ((Unit-type of (Trained unit)) Equal to Penguin) then do (Set unitround[(Player number of (Triggering player))] = unitround[((Player number of (Triggering player)) + 1)]) else do (Do nothing)
        If ((Unit-type of (Trained unit)) Equal to Penguin) then do (Player - Make Penguin Unavailable for training/construction by (Triggering player)) else do (Do nothing)
        If ((Unit-type of (Trained unit)) Equal to Penguin) then do (Unit - Move (Trained unit) instantly to (Center of Unit Multiplier <gen>)) else do (Do nothing)

Whereas "unitround" is a variable.

Details :

Code:
Variable Name : unitround
Variable Type: Interger
Array (Checked) 
Size: 1
Initial Value: 0 (Default)


What i am trying to fix here is to get the unit (while in play) to make the Size +1 so it creates 2 units everytime "unitround" goes off to create a new unit.

Ideas?

Rep will be rewarded of course!
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
1. This:

Code:
Player number of (Triggering player)

Never changes for each player. So it will always be the same number.

2. Where do you actually create the units?
 

Fragglez

New Member
Reaction score
4
1. This:

Code:
Player number of (Triggering player)

Never changes for each player. So it will always be the same number.

Erm.. so im confused, what do i change it to in order to get this functioning properly?

2. Where do you actually create the units?

They're created at my town hall, if its destroyed, i lose.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> what do i change it to in order to get this functioning properly?

Well, I don't really know... I don't know how it's supposed to work....

> They're created at my town hall, if its destroyed, i lose.

Trigger that does it, please.
 

Fragglez

New Member
Reaction score
4
> They're created at my town hall, if its destroyed, i lose.

Trigger that does it, please.

Code:
 ArmySpawn

    Events
        Time - Every 4.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (If (unittype[(Integer A)] Equal to Child) then do (Do nothing) else do (Unit - Create 1 unittype[(Integer A)] for (Player((Integer A))) at ((Player((Integer A))) start location) facing (Center of (Playable map area))))

Whereas unittype is a variable
Child is set to default unittype variable at the start

Code:
Variable Name: unittype
Variable Type: Unit-Type
Array (Checked)
Size: 1
Initial Value: None
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Code:
Create 1 unittype[(Integer A)]

So, it always creates one. You want it to create more than one?
 

Fragglez

New Member
Reaction score
4
Code:
Create 1 unittype[(Integer A)]

So, it always creates one. You want it to create more than one?

Exactly, hence when i make the Penguin,

Code:
 f ((Unit-type of (Trained unit)) Equal to Penguin) then do (Set unitround[(Player number of (Triggering player))] = unitround[((Player number of (Triggering player)) + 1)]) else do (Do nothing)

comes into play.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Ok.

So, you want to change the 1 in the spawn trigger to unitround[Player(Integer A)].

Then here:

Code:
unitround[((Player number of (Triggering player)) + 1)]

That needs a tiny tweak:

Code:
(unitround[((Player number of (Triggering player))] + 1)

Notice the bracket placement.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top