HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

!HELP! Random CinematicSpeecher

04-07-2010, 01:54 PM#1
Ikx_1
Hello to you, I need your help as soon as possible.

Im creating a trigger that chooses randomly the cinematic speechers, so I got all of the sounds I need. But this trigger chooses always the same cinematic speecher for a player.
The trigger should do that it takes randomly a cinematic speecher, and then puts a Hero to speeching unit.

Trigger:
CineSpeecher
Events
Collapse Conditions
((This trigger) is on) Equal to True
Collapse Actions
Set Integer = (Random integer number between 1 and 5)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
Integer Equal to PlayersSpeecher[1]
Integer Equal to PlayersSpeecher[2]
Integer Equal to PlayersSpeecher[3]
Integer Equal to PlayersSpeecher[4]
Integer Equal to PlayersSpeecher[5]
Collapse Then - Actions
Trigger - Run (This trigger) (ignoring conditions)
Collapse Else - Actions
Set CurrentPlayerSpeecher = (CurrentPlayerSpeecher + 1)
Set PlayersSpeecher[CurrentPlayerSpeecher] = Integer
Set CineSpeecher[CurrentPlayerSpeecher] = Hero[Integer]
Set CineSpeecherRunned = (CineSpeecherRunned + 1)
If (CineSpeecherRunned Equal to 5) then do (Do nothing) else do (Trigger - Run (This trigger) (checking conditions))

If you need more info just ask.
I need this trigger to work fast. THANKS!

I have also created a second trigger that changes the cinematic speeching unit to another if player is left or not playing:

Trigger:
DisableOFFLINECineSpeechers2
Events
Collapse Conditions
((This trigger) is on) Equal to True
Collapse Actions
Trigger - Turn off (This trigger)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
((Owner of CineSpeecher[1]) slot status) Not equal to Is playing
((Owner of CineSpeecher[1]) controller) Not equal to User
Collapse Then - Actions
Game - Display to (All players) the text: P1 Off
If (CineSpeecher[2] Not equal to No unit) then do (Set CineSpeecher[1] = CineSpeecher[2]) else do (Do nothing)
If (CineSpeecher[3] Not equal to No unit) then do (Set CineSpeecher[1] = CineSpeecher[3]) else do (Do nothing)
If (CineSpeecher[4] Not equal to No unit) then do (Set CineSpeecher[1] = CineSpeecher[4]) else do (Do nothing)
If (CineSpeecher[5] Not equal to No unit) then do (Set CineSpeecher[1] = CineSpeecher[5]) else do (Do nothing)
Collapse Else - Actions
Game - Display to (All players) the text: P1 On
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
((Owner of CineSpeecher[2]) slot status) Not equal to Is playing
((Owner of CineSpeecher[2]) controller) Not equal to User
Collapse Then - Actions
Game - Display to (All players) the text: P2 Off
If (CineSpeecher[1] Not equal to No unit) then do (Set CineSpeecher[2] = CineSpeecher[1]) else do (Do nothing)
If (CineSpeecher[3] Not equal to No unit) then do (Set CineSpeecher[2] = CineSpeecher[3]) else do (Do nothing)
If (CineSpeecher[4] Not equal to No unit) then do (Set CineSpeecher[2] = CineSpeecher[4]) else do (Do nothing)
If (CineSpeecher[5] Not equal to No unit) then do (Set CineSpeecher[2] = CineSpeecher[5]) else do (Do nothing)
Collapse Else - Actions
Game - Display to (All players) the text: P2 On
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
((Owner of CineSpeecher[3]) slot status) Not equal to Is playing
((Owner of CineSpeecher[3]) controller) Not equal to User
Collapse Then - Actions
Game - Display to (All players) the text: P3 Off
If (CineSpeecher[1] Not equal to No unit) then do (Set CineSpeecher[3] = CineSpeecher[1]) else do (Do nothing)
If (CineSpeecher[2] Not equal to No unit) then do (Set CineSpeecher[3] = CineSpeecher[2]) else do (Do nothing)
If (CineSpeecher[4] Not equal to No unit) then do (Set CineSpeecher[3] = CineSpeecher[4]) else do (Do nothing)
If (CineSpeecher[5] Not equal to No unit) then do (Set CineSpeecher[3] = CineSpeecher[5]) else do (Do nothing)
Collapse Else - Actions
Game - Display to (All players) the text: P3 On
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
((Owner of CineSpeecher[4]) slot status) Not equal to Is playing
((Owner of CineSpeecher[4]) controller) Not equal to User
Collapse Then - Actions
Game - Display to (All players) the text: P4 Off
If (CineSpeecher[1] Not equal to No unit) then do (Set CineSpeecher[4] = CineSpeecher[1]) else do (Do nothing)
If (CineSpeecher[2] Not equal to No unit) then do (Set CineSpeecher[4] = CineSpeecher[2]) else do (Do nothing)
If (CineSpeecher[3] Not equal to No unit) then do (Set CineSpeecher[4] = CineSpeecher[3]) else do (Do nothing)
If (CineSpeecher[5] Not equal to No unit) then do (Set CineSpeecher[4] = CineSpeecher[5]) else do (Do nothing)
Collapse Else - Actions
Game - Display to (All players) the text: P4 On
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
((Owner of CineSpeecher[5]) slot status) Not equal to Is playing
((Owner of CineSpeecher[5]) controller) Not equal to User
Collapse Then - Actions
Game - Display to (All players) the text: P5 Off
If (CineSpeecher[1] Not equal to No unit) then do (Set CineSpeecher[5] = CineSpeecher[1]) else do (Do nothing)
If (CineSpeecher[2] Not equal to No unit) then do (Set CineSpeecher[5] = CineSpeecher[2]) else do (Do nothing)
If (CineSpeecher[3] Not equal to No unit) then do (Set CineSpeecher[5] = CineSpeecher[3]) else do (Do nothing)
If (CineSpeecher[4] Not equal to No unit) then do (Set CineSpeecher[5] = CineSpeecher[4]) else do (Do nothing)
Collapse Else - Actions
Game - Display to (All players) the text: P5 On

The cinematic transmissions are like this:
Trigger:
If (PlayersSpeecher[1] Equal to 1) then do (Cinematic - Send transmission to (All players) from CineSpeecher[1] named (Name of CineSpeecher[1]): Play nBastard <gen> and display That's what you thi.... Modify duration: Add 0.00 seconds and Wait) else do (Do nothing)
If (PlayersSpeecher[1] Equal to 2) then do (Cinematic - Send transmission to (All players) from CineSpeecher[1] named (Name of CineSpeecher[1]): Play mBastard <gen> and display That's what you thi.... Modify duration: Add 0.00 seconds and Wait) else do (Do nothing)
If (PlayersSpeecher[1] Equal to 3) then do (Cinematic - Send transmission to (All players) from CineSpeecher[1] named (Name of CineSpeecher[1]): Play aBastard <gen> and display That's what you thi.... Modify duration: Add 0.00 seconds and Wait) else do (Do nothing)
If (PlayersSpeecher[1] Equal to 4) then do (Cinematic - Send transmission to (All players) from CineSpeecher[1] named (Name of CineSpeecher[1]): Play kBastard <gen> and display That's what you thi.... Modify duration: Add 0.00 seconds and Wait) else do (Do nothing)
If (PlayersSpeecher[1] Equal to 5) then do (Cinematic - Send transmission to (All players) from CineSpeecher[1] named (Name of CineSpeecher[1]): Play iBastard <gen> and display That's what you thi.... Modify duration: Add 0.00 seconds and Wait) else do (Do nothing)
04-09-2010, 05:02 AM#2
[VDM]Amn
first make sure your editor its not making fixed random values

then put a game-message there after the
Set Integer = (Random integer number between 1 and 5)
saying the integer's value
just to make sure it's randomizing well
04-09-2010, 09:50 PM#3
Neco
Go to
File -> Preferences... -> Test Map -> Use Fixed Random Seed

Make sure its unchecked.