• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Selecting multiple players for cams

Status
Not open for further replies.
Level 8
Joined
Nov 9, 2008
Messages
502
Is there an easy way to make a cam effect multiple players without repeating the line and changing the player number for every player?

  • startingcameffects
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 0.30 seconds
      • Game - Disable selection and deselection functionality (Disable selection circles)
      • Player Group - Pick every player in playergroupforcams and do (Actions)
        • Loop - Actions
          • Camera - Apply closeup <gen> for (Picked player) over 0.00 seconds
          • Camera - Lock camera target for (Picked player) to Peasant 0000 <gen>, offset by (0.00, 0.00) using Default rotation
          • Camera - Shake the camera for (Picked player) with magnitude 5.00
          • Game - Display to (All players) the text: AAAHHH!!! WHATS HAP...
          • Wait 3.00 seconds
          • Camera - Shake the camera for (Picked player) with magnitude 50.00
          • Game - Display to (All players) the text: WTF?!?!?
          • Wait 5.00 seconds
          • Camera - Shake the camera for (Picked player) with magnitude 5.00
          • Wait 2.00 seconds
          • Camera - Stop swaying/shaking the camera for (Picked player)
          • Game - Display to (All players) the text: Ahhh thats better!
          • Wait 1.00 seconds
          • Game - Enable selection and deselection functionality (Enable selection circles)
          • Camera - Apply revivepoint <gen> for (Picked player) over 4.00 seconds
          • Game - Display to (All players) the text: Welcome. Explore my...
      • Game - Enable selection and deselection functionality (Enable selection circles)
What seems to happen when I test is it gets to the first message, repeats it (for some reason) but doesnt carry on with the rest of the actions. I'm dubious of the 'Loop - actions' but how else can i select a number of players for a cam?

EDIT: I've already added all players to the player group before this trigger runs.
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
1. Dont use waits in GUI loops. It will cause buggs and problems, because Picked Player does not work anymore after the wait.

2. This is the best way to do it, unless you want to use jass, then you could use the function
JASS:
GetLocalPlayer()
.

Greets
 
Level 8
Joined
Nov 9, 2008
Messages
502
The waits are pretty significant to the total effect; taking them out would look awful. Why does the game loop the actions and not just play them in order >.<

So like this in JASS? Doesn't seem to work...

JASS:
function Trig_temptrig_Actions takes nothing returns nothing
    call TriggerSleepAction( 0.30 )
    call EnableSelect( false, false )
    call ForForce( udg_playergroupforcams, function Trig_temptrig_Func003A )
        call CameraSetupApplyForPlayer( true, gg_cam_closeup, GetEnumPlayer(), 0 )
    call SetCameraTargetControllerNoZForPlayer( GetLocalPlayer(), gg_unit_H000_0000, 0, 0, false )
    call CameraSetEQNoiseForPlayer( GetLocalPlayer(), 5.00 )
    call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_055" )
    call TriggerSleepAction( 3.00 )
    call CameraSetEQNoiseForPlayer( GetLocalPlayer(), 50.00 )
    call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_056" )
    call TriggerSleepAction( 5.00 )
    call CameraSetEQNoiseForPlayer( GetLocalPlayer(), 5.00 )
    call TriggerSleepAction( 2.00 )
    call CameraClearNoiseForPlayer( GetLocalPlayer() )
    call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_057" )
    call TriggerSleepAction( 1.00 )
    call EnableSelect( true, true )
    call CameraSetupApplyForPlayer( true, gg_cam_revivepoint, GetLocalPlayer(), 4.00 )
    call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_058" )
    call EnableSelect( true, true )
endfunction

//===========================================================================
function InitTrig_temptrig takes nothing returns nothing
    set gg_trg_temptrig = CreateTrigger(  )
    call TriggerAddAction( gg_trg_temptrig, function Trig_temptrig_Actions )
endfunction

I also tried replacing 'GetLocalPlayer()' with 'GetLocalPlayer( 0 , 1 , 2 )'
Still doesn't work :(
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
oh thats strange...
GetLocalPlayer() doesnt take any arguments, so i dont know, why this doesnt work...

In Gui u could try this, with waits, but the waits are not in the loops
  • Player Group - Pick every player in (All players) and do (Actions)
    • // Your Actions here
  • Wait 2.00 seconds
  • Player Group - Pick every player in (All players) and do (Actions)
    • // Your Actions here
  • Wait 2.00 seconds
And by the way: You have to handle the Player Group in the function "function Trig_temptrig_Func003A ". So if u want to use GetEnumPlayer, use it inside this function.
 
Level 8
Joined
Nov 9, 2008
Messages
502
Hmm that worked more or less except for the display text action, I had to move that from the loops also otherwise they would repeat themselves :S

Here is the trigger that works...

  • startingcameffects
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 0.30 seconds
      • Game - Disable selection and deselection functionality (Disable selection circles)
      • Player Group - Pick every player in playergroupforcams and do (Actions)
        • Loop - Actions
          • Camera - Apply closeup <gen> for (Picked player) over 0.00 seconds
          • Camera - Lock camera target for (Picked player) to Peasant 0000 <gen>, offset by (0.00, 0.00) using Default rotation
          • Camera - Shake the camera for (Picked player) with magnitude 5.00
      • Game - Display to (All players) the text: AAAHHH!!! WHATS HAP...
      • Wait 3.00 seconds
      • Player Group - Pick every player in playergroupforcams and do (Actions)
        • Loop - Actions
          • Camera - Shake the camera for (Picked player) with magnitude 50.00
      • Game - Display to (All players) the text: WTF?!?!?
      • Wait 5.00 seconds
      • Player Group - Pick every player in playergroupforcams and do (Actions)
        • Loop - Actions
          • Camera - Shake the camera for (Picked player) with magnitude 5.00
      • Wait 2.00 seconds
      • Player Group - Pick every player in playergroupforcams and do (Actions)
        • Loop - Actions
          • Camera - Stop swaying/shaking the camera for (Picked player)
      • Game - Display to (All players) the text: Ahhh thats better!
      • Wait 1.00 seconds
      • Player Group - Pick every player in playergroupforcams and do (Actions)
        • Loop - Actions
          • Camera - Apply revivepoint <gen> for (Picked player) over 4.00 seconds
      • Game - Enable selection and deselection functionality (Enable selection circles)
      • Game - Display to (All players) the text: Welcome. Explore my...
      • Game - Enable selection and deselection functionality (Enable selection circles)
Still seems to be an illogical way of doing it, nevertheless, thanks for the help! +rep
 
Status
Not open for further replies.
Top