Whenever I use the 'Create unit' or 'replace unit' or anything of the sort, it always makes 2 of them. I checked everything for redundancy and it is set to make 1. What gives?
PS: These are triggered by units using abilities (no the ability is not to make another thing), I believe it worked when I had it triggered by a button.
I'm making a monopoly-like tower defense game. I have most everything worked out, but here's my problem: All players move fine the first time, but the second time they move, it rolls twice and moves twice as far and so on... If there's only one player it works. Here's my triggers:
Roll 2 (the function that says to which place on the board they will move)
Actions
Variable - Set Current Turn Unit Placement = 0
If
P2 Pawn != No Unit
Then
Variable - Set Current Turn Unit = P2 Pawn
UI - Display ((Name of player (Owner of Current Turn Unit)) + "'s turn") for (All players) to Subtitle area
Variable - Set Move Distance = (Random integer between 1 and 12)
Variable - Set P2 Pawn Placement = (P2 Pawn Placement + Move Distance)
If
P2 Pawn Placement >= 40
Then
Variable - Modify P2 Pawn Placement: - 40
Variable - Set Current Turn Unit Placement = P2 Pawn Placement
UI - Display (Combine ("Player 2 has rolled a ", (Text(Move Distance)))) for (All players) to Subtitle area
Variable - Set Current Turn Player = (Owner of Current Turn Unit)
Trigger - Run Move (Ignore Conditions, Don't Wait until it finishes)
Else
Trigger - Run Roll 3 (Check Conditions, Don't Wait until it finishes)
Here's some code from the move function:
Move
Actions
If
Current Turn Unit Placement == 17
Then
Unit - Order Current Turn Unit to ( Move targeting [Point]17) (Replace Existing Orders)
(this is repeated fro all 40 spaces)
If
Current Turn Player == 2
Then
Unit - Wait until Current Turn Unit Becomes idle
General - Wait 5.0 Game Time seconds
Trigger - Run Roll 3 (Check Conditions, Don't Wait until it finishes)
(repeated for all four players)
Hi! This is the first time i need help from someone about the galaxy editor. Anyway, heres my problem:
I have a map where you can buy a building and once you own it you can do more stuff with it. I wan the options to do more stuff to pop up when the person who bought the building (the now-owner) selects it. I used the 'unit is selected' event, with my building as the unit and the 'by player' part as 'owner of [building]' , which never works. It triggers fine if i set the 'by player' to player 1, but why doesn't it work if it say the selecting player has to be the owner of builing/triggering unit? Thanks!
I know how to do a workaround of this with conditions, but that would increase lag.
0
@SouLCarveRR: Go
@Zolstice: Go
Thanks a lot guys, that makes too much sense.
0
Whenever I use the 'Create unit' or 'replace unit' or anything of the sort, it always makes 2 of them. I checked everything for redundancy and it is set to make 1. What gives?
PS: These are triggered by units using abilities (no the ability is not to make another thing), I believe it worked when I had it triggered by a button.
0
@jcraigk: Go
Oh! thanks, i was having an external function to reset the values but i put them into the move fxn and it is working nicely. Thanks dude.
0
I'm making a monopoly-like tower defense game. I have most everything worked out, but here's my problem: All players move fine the first time, but the second time they move, it rolls twice and moves twice as far and so on... If there's only one player it works. Here's my triggers:
Roll 2 (the function that says to which place on the board they will move)
Actions
Variable - Set Current Turn Unit Placement = 0
If
P2 Pawn != No Unit
Then
Variable - Set Current Turn Unit = P2 Pawn
UI - Display ((Name of player (Owner of Current Turn Unit)) + "'s turn") for (All players) to Subtitle area
Variable - Set Move Distance = (Random integer between 1 and 12)
Variable - Set P2 Pawn Placement = (P2 Pawn Placement + Move Distance)
If
P2 Pawn Placement >= 40
Then
Variable - Modify P2 Pawn Placement: - 40
Variable - Set Current Turn Unit Placement = P2 Pawn Placement
UI - Display (Combine ("Player 2 has rolled a ", (Text(Move Distance)))) for (All players) to Subtitle area
Variable - Set Current Turn Player = (Owner of Current Turn Unit)
Trigger - Run Move (Ignore Conditions, Don't Wait until it finishes)
Else
Trigger - Run Roll 3 (Check Conditions, Don't Wait until it finishes)
Here's some code from the move function:
Move
Actions
If
Current Turn Unit Placement == 17
Then
Unit - Order Current Turn Unit to ( Move targeting [Point]17) (Replace Existing Orders)
(this is repeated fro all 40 spaces)
If
Current Turn Player == 2
Then
Unit - Wait until Current Turn Unit Becomes idle
General - Wait 5.0 Game Time seconds
Trigger - Run Roll 3 (Check Conditions, Don't Wait until it finishes)
(repeated for all four players)
Any help would be greatly appreciated, thanks!
0
OK thanks guys. I guess i'll just have to deal with the lag. I've had to do that a few other places. I hope it wont make my map too slow.
0
Hi! This is the first time i need help from someone about the galaxy editor. Anyway, heres my problem:
I have a map where you can buy a building and once you own it you can do more stuff with it. I wan the options to do more stuff to pop up when the person who bought the building (the now-owner) selects it. I used the 'unit is selected' event, with my building as the unit and the 'by player' part as 'owner of [building]' , which never works. It triggers fine if i set the 'by player' to player 1, but why doesn't it work if it say the selecting player has to be the owner of builing/triggering unit? Thanks!
I know how to do a workaround of this with conditions, but that would increase lag.