- Joined
- Jul 30, 2018
- Messages
- 445
So, I've suddenly ran into a few problems, and I just don't understand what's wrong. Especially since they seem to have appeared out of nowhere and I'm sure they have worked before.
1st problem: (solved) Player loop not detecting any other players other than player 1.
Here's the trigger:
So, there problem is with the last loop: it seems to only detect player 1 (red). If I start the game as any other color than red the player count is zero. The upgrade "A new day" won't be increased, I get no money, there's no food cap and so on. Also, strangely enough, neither the "else" function works as the ownership of the buildings are not changed (except for red player, of course).
Also, I know the variables work, as they initialized in another trigger and the other variables work.
2nd problem might or might not be related, but it feels like the (triggering player) is not working for other players, other than again red player 1.
Here's the trigger:
The dialog does not open up if I start the game as any other than red player, but works fine with with red player. I thought that the trigger would be conflicting with the other item pickup-triggers, but the conditions don't seem to make any difference.
3rd problem is regarding the damage detection system I'm using, Damage Engine 3.8.0.0.
Here's the trigger:
This is strange, as, again, I am sure the trigger has worked before, but at some point recently, it suddenly doesn't work. Seems as though the trigger didn't run at all. The mana is not draining, the floating text is not showing (which is done in the "DamageEvent" trigger), also the structure is eventually always destroyed, instead of preventing the damage and changing owner.
-----
Sorry for the long post, and sorry if the triggers seem a bit messy. I am still trying to figure this all out myself, but I've become a bit frustrated so I thought if someone could lend me hand. I'll also post the whole map if you want to take a closer look and test it your yourself.
Thanks already in advance!
1st problem: (solved) Player loop not detecting any other players other than player 1.
Here's the trigger:
-
Initialization
-
Events
-
Time - Elapsed game time is 0.10 seconds
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Misc_DebugMode Equal to True
-
-
Then - Actions
-
Game - Display to (All players) the text: (Running trigger: + (Name of the current trigger))
-
-
Else - Actions
-
-
Visibility - Disable fog of war
-
Visibility - Enable black mask
-
Selection - Select Control Panel (Main) 0003 <gen> for Player 1 (Red)
-
Selection - Select Control Panel (Main) 0026 <gen> for Player 2 (Blue)
-
Selection - Select Control Panel (Main) 0029 <gen> for Player 3 (Teal)
-
Selection - Select Control Panel (Main) 0032 <gen> for Player 4 (Purple)
-
Game - Set the time of day to 6.00
-
Countdown Timer - Start Turns_Timer as a One-shot timer that will expire in 60.00 seconds
-
For each (Integer A) from 1 to 4, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Player((Integer A))) slot status) Equal to Is playing
-
-
Then - Actions
-
Set Player_Count = (Player_Count + 1)
-
Player - Set the current research level of A new day (Control Panel) to 1 for (Player((Integer A)))
-
Player - Set (Player((Integer A))) Current gold to 10000
-
Player - Set (Player((Integer A))) Food cap to 7
-
-
Else - Actions
-
Unit - Change ownership of Player_StartingCityBuild[(Integer A)] to Player 21 (Coal) and Change color
-
Unit - Change ownership of Player_StartingCityHeroes[(Integer A)] to Player 21 (Coal) and Change color
-
Unit - Change ownership of Player_StartingCitySpells[(Integer A)] to Player 21 (Coal) and Change color
-
Unit - Change ownership of Player_StartingCityUnits[(Integer A)] to Player 21 (Coal) and Change color
-
Unit - Change ownership of Player_StartingCityDefenses[(Integer A)] to Player 21 (Coal) and Change color
-
Unit - Change ownership of Player_StartingHero[(Integer A)] to Player 21 (Coal) and Change color
-
Hero - Create Skeletal Orcs|n|cffFA5858Tier 1|r and give it to City_IndexDefense[(Integer A)]
-
Hero - Create Skeletal Orc Grunts|n|cffFA5858Tier 2|r and give it to City_IndexDefense[(Integer A)]
-
Hero - Create Necrolytes|n|cffFA5858Tier 3|r and give it to City_IndexDefense[(Integer A)]
-
-
-
-
-
-
So, there problem is with the last loop: it seems to only detect player 1 (red). If I start the game as any other color than red the player count is zero. The upgrade "A new day" won't be increased, I get no money, there's no food cap and so on. Also, strangely enough, neither the "else" function works as the ownership of the buildings are not changed (except for red player, of course).
Also, I know the variables work, as they initialized in another trigger and the other variables work.
2nd problem might or might not be related, but it feels like the (triggering player) is not working for other players, other than again red player 1.
Here's the trigger:
-
Treasure Chest PickUp
-
Events
-
Unit - A unit Acquires an item
-
-
Conditions
-
(Item-type of (Item being manipulated)) Equal to Treasure Chest
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Misc_DebugMode Equal to True
-
-
Then - Actions
-
Game - Display to (All players) the text: (Running trigger: + (Name of the current trigger))
-
-
Else - Actions
-
-
Set Item_TreasureLevel[(Player number of (Triggering player))] = (Random integer number between 1 and 3)
-
Set Item_TreasureHero[(Player number of (Triggering player))] = (Hero manipulating item)
-
Dialog - Clear Item_TreasureDialog[(Player number of (Triggering player))]
-
Dialog - Change the title of Item_TreasureDialog[(Player number of (Triggering player))] to Do you wis...
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Item_TreasureLevel[(Player number of (Triggering player))] Equal to 1
-
-
Then - Actions
-
Dialog - Create a dialog button for Item_TreasureDialog[(Player number of (Triggering player))] labelled 1000 Gold
-
Set Item_TreasureDialogButtonG[(Player number of (Triggering player))] = (Last created dialog Button)
-
Dialog - Create a dialog button for Item_TreasureDialog[(Player number of (Triggering player))] labelled |cffffffff500 Exper...
-
Set Item_TreasureDialogButtonE[(Player number of (Triggering player))] = (Last created dialog Button)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Item_TreasureLevel[(Player number of (Triggering player))] Equal to 2
-
-
Then - Actions
-
Dialog - Create a dialog button for Item_TreasureDialog[(Player number of (Triggering player))] labelled 1500 Gold
-
Set Item_TreasureDialogButtonG[(Player number of (Triggering player))] = (Last created dialog Button)
-
Dialog - Create a dialog button for Item_TreasureDialog[(Player number of (Triggering player))] labelled |cffffffff1000 Expe...
-
Set Item_TreasureDialogButtonE[(Player number of (Triggering player))] = (Last created dialog Button)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Item_TreasureLevel[(Player number of (Triggering player))] Equal to 3
-
-
Then - Actions
-
Dialog - Create a dialog button for Item_TreasureDialog[(Player number of (Triggering player))] labelled 2000 Gold
-
Set Item_TreasureDialogButtonG[(Player number of (Triggering player))] = (Last created dialog Button)
-
Dialog - Create a dialog button for Item_TreasureDialog[(Player number of (Triggering player))] labelled |cffffffff1500 Expe...
-
Set Item_TreasureDialogButtonE[(Player number of (Triggering player))] = (Last created dialog Button)
-
-
Else - Actions
-
-
Dialog - Show Item_TreasureDialog[(Player number of (Triggering player))] for (Triggering player)
-
-
The dialog does not open up if I start the game as any other than red player, but works fine with with red player. I thought that the trigger would be conflicting with the other item pickup-triggers, but the conditions don't seem to make any difference.
3rd problem is regarding the damage detection system I'm using, Damage Engine 3.8.0.0.
Here's the trigger:
-
Conquer
-
Events
-
Game - DamageModifierEvent becomes Equal to 1.00
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Misc_DebugMode Equal to True
-
-
Then - Actions
-
Game - Display to (All players) the text: (Running trigger: + (Name of the current trigger))
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DamageEventAmount Greater than (Life of DamageEventTarget)
-
(Owner of DamageEventTarget) Not equal to (Owner of DamageEventSource)
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of DamageEventTarget) Equal to Ship (Haven)
-
(Unit-type of DamageEventTarget) Equal to Ship (Iron Cove)
-
(Unit-type of DamageEventTarget) Equal to Ship (The Lost Port)
-
(Unit-type of DamageEventTarget) Equal to Ship (Moonshadow)
-
(Unit-type of DamageEventTarget) Equal to Zeppelin (Dragon Rock)
-
-
-
-
Then - Actions
-
Set DamageEventAmount = 0.00
-
Set Temp_UnitGroup[0] = (Units owned by (Owner of DamageEventTarget) matching (((Matching unit) is loaded into DamageEventTarget) Equal to True))
-
Unit Group - Pick every unit in Temp_UnitGroup[0] and do (Actions)
-
Loop - Actions
-
Set Temp_Integer[0] = (1000 x (Number of units in Temp_UnitGroup[0]))
-
Hero - Add Temp_Integer[0] experience to DamageEventSource, Show level-up graphics
-
Unit - Kill (Picked unit)
-
-
-
Custom script: call DestroyGroup(udg_Temp_UnitGroup[0])
-
Set Temp_Point[1] = ((Position of DamageEventTarget) offset by ((Random real number between -50.00 and 40.00), (Random real number between -10.00 and 10.00)))
-
Floating Text - Create floating text that reads Transport captured! at Temp_Point[1] with Z offset 0.00, using font size 11.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
-
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
-
Floating Text - Set the velocity of (Last created floating text) to 32.00 towards 90.00 degrees
-
Custom script: call RemoveLocation(udg_Temp_Point[1])
-
Set Temp_Point[2] = ((Position of DamageEventSource) offset by ((Random real number between -25.00 and 25.00), (Random real number between -20.00 and 20.00)))
-
Floating Text - Create floating text that reads (+ + (String(Temp_Integer[0]))) at Temp_Point[2] with Z offset 0.00, using font size 10.00, color (83.00%, 35.00%, 97.00%), and 0.00% transparency
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
-
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
-
Floating Text - Set the velocity of (Last created floating text) to 32.00 towards 90.00 degrees
-
Custom script: call RemoveLocation(udg_Temp_Point[2])
-
Unit - Change ownership of DamageEventTarget to (Owner of DamageEventSource) and Change color
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DamageEventAmount Greater than (Life of DamageEventTarget)
-
(DamageEventTarget is A structure) Equal to True
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of DamageEventTarget) Not equal to (Owner of DamageEventSource)
-
-
Then - Actions
-
For each (Integer A) from 0 to (City_Count - 1), do (Actions)
-
Loop - Actions
-
Set DamageEventAmount = 0.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DamageEventTarget Equal to City_IndexDefense[(Integer A)]
-
-
Then - Actions
-
Set City_ConquerIndex = (Integer A)
-
Unit - Change ownership of City_IndexBuild[(Integer A)] to (Owner of DamageEventSource) and Change color
-
Unit - Change ownership of City_IndexHeroes[(Integer A)] to (Owner of DamageEventSource) and Change color
-
Unit - Change ownership of City_IndexSpells[(Integer A)] to (Owner of DamageEventSource) and Change color
-
Unit - Change ownership of City_IndexUnits[(Integer A)] to (Owner of DamageEventSource) and Change color
-
For each (Integer B) from 1 to 16, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of City_IndexBuild[(Integer B)]) Equal to (Player((Integer A)))
-
-
Then - Actions
-
Multiboard - Set the text for Multiboard_Main item in column 2, row 3 to (Player_Colors[(Integer B)] + (Name of (Player((Integer B)))))
-
-
Else - Actions
-
-
-
-
Player - Set the current research level of City_TechGreatHall[City_ConquerIndex] to (Current research level of City_TechGreatHall[City_ConquerIndex] for (Owner of DamageEventTarget)) for (Owner of DamageEventSource)
-
Player - Set the current research level of City_TechDefenses[City_ConquerIndex] to (Current research level of City_TechDefenses[City_ConquerIndex] for (Owner of DamageEventTarget)) for (Owner of DamageEventSource)
-
Player - Set the current research level of City_TechTavern[City_ConquerIndex] to (Current research level of City_TechTavern[City_ConquerIndex] for (Owner of DamageEventTarget)) for (Owner of DamageEventSource)
-
Player - Set the current research level of City_TechShipyard[City_ConquerIndex] to (Current research level of City_TechShipyard[City_ConquerIndex] for (Owner of DamageEventTarget)) for (Owner of DamageEventSource)
-
Player - Set the current research level of City_TechBarracks[City_ConquerIndex] to (Current research level of City_TechBarracks[City_ConquerIndex] for (Owner of DamageEventTarget)) for (Owner of DamageEventSource)
-
Player - Set the current research level of City_TechMageGuild[City_ConquerIndex] to (Current research level of City_TechMageGuild[City_ConquerIndex] for (Owner of DamageEventTarget)) for (Owner of DamageEventSource)
-
Player - Set the current research level of City_TechTier3Units[City_ConquerIndex] to (Current research level of City_TechTier3Units[City_ConquerIndex] for (Owner of DamageEventTarget)) for (Owner of DamageEventSource)
-
Player - Set the current research level of City_TechTier4Units[City_ConquerIndex] to (Current research level of City_TechTier4Units[City_ConquerIndex] for (Owner of DamageEventTarget)) for (Owner of DamageEventSource)
-
Unit - Change ownership of City_IndexDefense[(Integer A)] to (Owner of DamageEventSource) and Change color
-
Hero - Add 3500 experience to DamageEventSource, Show level-up graphics
-
Set Temp_Point[1] = ((Position of DamageEventTarget) offset by ((Random real number between -50.00 and 40.00), (Random real number between -10.00 and 10.00)))
-
Floating Text - Create floating text that reads City captured! at Temp_Point[1] with Z offset 0.00, using font size 11.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
-
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
-
Floating Text - Set the velocity of (Last created floating text) to 32.00 towards 90.00 degrees
-
Custom script: call RemoveLocation(udg_Temp_Point[1])
-
Set Temp_Point[2] = (Position of DamageEventTarget)
-
Special Effect - Create a special effect at Temp_Point[2] using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
-
Special Effect - Destroy (Last created special effect)
-
Custom script: call RemoveLocation(udg_Temp_Point[2])
-
-
Else - Actions
-
-
-
-
-
Else - Actions
-
Set DamageEventAmount = 0.00
-
-
-
-
Else - Actions
-
-
-
This is strange, as, again, I am sure the trigger has worked before, but at some point recently, it suddenly doesn't work. Seems as though the trigger didn't run at all. The mana is not draining, the floating text is not showing (which is done in the "DamageEvent" trigger), also the structure is eventually always destroyed, instead of preventing the damage and changing owner.
-----
Sorry for the long post, and sorry if the triggers seem a bit messy. I am still trying to figure this all out myself, but I've become a bit frustrated so I thought if someone could lend me hand. I'll also post the whole map if you want to take a closer look and test it your yourself.
Thanks already in advance!
Attachments
Last edited: