Will "from 1 to X" work if players slots are closed.

Solu9

You can change this now in User CP.
Reaction score
216
Kinda odd title, but I didn't know what else to write.

I have these triggers:

Trigger:
  • Second Setup
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set Integer_Units = (Random integer number between 1 and 3)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Wizard for (Player((Integer A))) at Point_CreateUnit facing Point_MidMap
          • Selection - Select (Last created unit) for (Player((Integer A)))
          • Camera - Lock camera target for (Owner of (Last created unit)) to (Last created unit), offset by (0.00, 0.00) using The unit's rotation
          • Set Hero[(Integer A)] = (Last created unit)
          • Custom script: call RemoveLocation (udg_Point_CreateUnit)
      • Countdown Timer - Start ThirdViewCam as a Repeating timer that will expire in 0.50 seconds
      • Custom script: call RemoveLocation (udg_Point_MidMap)
      • Game - Set the time of day to 12.00
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility across (Playable map area)
          • Visibility - Enable (Last created visibility modifier)
          • Set VisMod_Default[(Integer A)] = (Last created visibility modifier)
      • Countdown Timer - Start Timer_GameTime as a One-shot timer that will expire in 300.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Remaining Time:
      • Trigger - Turn on Gameover <gen>
      • Trigger - Turn on Play 3rd view cam Copy <gen>


Trigger:
  • Play 3rd view cam Copy
    • Events
      • Time - ThirdViewCam expires
    • Conditions
    • Actions
      • For each (Integer B) from 1 to 12, do (Actions)
        • Loop - Actions
          • Camera - Set (Player((Integer B)))'s camera Distance to target to 2200.00 over 1.00 seconds
          • Camera - Set (Player((Integer B)))'s camera Angle of attack to 320.00 over 1.00 seconds
          • Camera - Set (Player((Integer B)))'s camera Field of view to 5000.00 over 1.00 seconds
          • Camera - Set (Player((Integer B)))'s camera Rotation to (Facing of Hero[(Integer B)]) over 1.00 seconds
          • Camera - Set (Player((Integer B)))'s camera Height Offset to 500.00 over 0.50 seconds
          • Camera - Set (Player((Integer B)))'s camera Far Z to 6000.00 over 0.50 seconds


I have changed "For each (Integer B) from 1 to 12, do (Actions)" to 12 instead of "count players in PlayerGroup_Players". I did this because I tried disabling player 1 and 2 in the editor to test if the trigger would still work. And when I did so, playing as teal (player 3) the camera trigger here did not work.

Note that in the first trigger is also says "For each (Integer A) from 1 to 12, do (Actions)" but WAS also "count players in PlayerGroup_Players".
PlayerGroup_Players get set another trigger concerning the multiboard. This happens before these triggers are run so that is not the problem.

The real questions here is. Did the camera trigger not work only because I disabled player 1 and 2 or was it because of the way I count the player in PlayerGroup_Players?
I personally thought the latter, and thats why I changed it to "For each (Integer A) from 1 to 12, do (Actions)" . But I'm in doubt and I don't want to change it further if it is not necessary.

Sorry for the long post.
 

Imp Midna

Active Member
Reaction score
52
I assume you tested it alone, being the only player?
If so, "count players in PlayerGroup_Players" will return 1, your for loop will iterate from 1 to 1 (leaving the only execution of that loop to be a 1) and therefor only do the camera stuff for player 1 (who is not there, so...)
Looping from 1 to 12 will always cover the first 12 players, whether they are there or not, which might get you into trouble as it will always create 12 wizards, no matter what.
If PlayerGroup_Players contains all the players from your leaderboard, you might as well use "pick every player in force". It would skip players that are not there.
 

Solu9

You can change this now in User CP.
Reaction score
216
If so, "count players in PlayerGroup_Players" will return 1, your for loop will iterate from 1 to 1 (leaving the only execution of that loop to be a 1) and therefor only do the camera stuff for player 1 (who is not there, so...)

I figured this and therefore chose to do it 1 to 12 instead of count numbers. Another reason I'dd rather do it is this manner is that if players leave a gab between them in the game lobby. Ex. occupying slot 1, 4 and 7 I will have the same problem again.

I worked around the spawn Wizard problem by throwing in an if/then/else action. Checking if that specific slot is being used.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
Alternately, something like this:

Pick every player in (Players matching ((Matching Player) is Playing Equal to True)) and do Actions
- Etc.

It has been like a year since I've even loaded the editor, so my syntax is likely complete crap.
 

Solu9

You can change this now in User CP.
Reaction score
216
Aye. But won't I run into the same problem as before?

If slot 1,2, 4 and 5 is open, then only 4 players are playing. So the camera for player occupying slot nr. 5 will have a none function camera.
 

vypur85

Hibernate
Reaction score
803
Err. Not exactly. What Ghan is suggesting is that use 'Player loop' and NOT 'Integer loop'.

Player loop should work as it should, regardless of any gaps of non playing player.
If you're using player loop, all your Integer A/B are to be replaced with 'Player number' instead. So it should function well.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top