• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Help with auto selection of hero unit on map init

Status
Not open for further replies.
Level 5
Joined
Dec 29, 2008
Messages
61
I have this script that loops through each player and then locks the camera target of the triggering player to the triggering hero unit.

But this only triggers when the hero unit is manually selected.

How can I automatically select the hero unit? Each player starts with one hero and can't create any more.
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
When/how are the heroes created/chosen? You'll probably want to lock the camera when the hero first begins existing on the map. Unless you are saying that players can control other units in addition to the hero (but not additional heroes) and you want the camera to be locked to the hero only when that hero is part of their current selection.
 
Level 5
Joined
Dec 29, 2008
Messages
61
When/how are the heroes created/chosen? You'll probably want to lock the camera when the hero first begins existing on the map. Unless you are saying that players can control other units in addition to the hero (but not additional heroes) and you want the camera to be locked to the hero only when that hero is part of their current selection.

So far the heroes were just plopped on the map for each character. The players can only control a single hero and no other units. So the idea was to just auto-select the hero and then the camera lock would be applied automatically. I'm just not sure how to do that. It works when I select the Paladin 0001 unit but I want the code to be more generic. "Last created unit" doesn't work either.

I attached the trigger. Unfortunately I don't know how to share trigger code at the moment. Need to look that up.
 

Attachments

  • trigger.PNG
    trigger.PNG
    43.5 KB · Views: 6
  • trigger2.PNG
    trigger2.PNG
    38.5 KB · Views: 4
Level 39
Joined
Feb 27, 2007
Messages
5,023

Do they all exist in the same general vicinity at map init such that you could place a region under them in the editor? If no: are all the heroes the same unit type? Are there other heroes on the map besides the ones that players should control? Are all these heroes already owned by the appropriate player? This is the easiest solution I can think of:
  • Events
    • Time - Elapsed game-time is 0.50 seconds //don't use the map init even if you can avoid it, better not to risk crashing the init thread with too much stuff running off it
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true //'pre-emptively' cleans a unit group leak that's about to occur in the next line (see thread linked above if you don't understand)
    • Unit Group - Pick every unit in (Units in START_REGION <gen> matching (((Matching Unit) is a Hero) equal to True)) and do (Actions)
      • Loop - Actions
        • Camera - Lock camera target for (Owner of (Picked unit)) to (Picked unit), offset by (0.00, 0.00) using Default rotation
You could also use "Units of type Paladin" if a region won't work, or something like "Units in playable map area matching ((unit is a hero) and (owner of matching unit is an ally of Player 1)" if the region method isn't viable.
"Last created unit" doesn't work either.
Things like "last X" are (internally) global variables that are set by the appropriate GUI functions when they're used. For example using "Unit - Create" sets Last Created Unit. "Last Dropped Item" only works when a unit is forced to drop an item with a trigger, not when it manually drops one on the ground. Technically all the units on the map are created at map init in the init thread, but they are made directly with JASS function calls and therefore do not set "last created unit" properly.
 
Level 5
Joined
Dec 29, 2008
Messages
61

Do they all exist in the same general vicinity at map init such that you could place a region under them in the editor? If no: are all the heroes the same unit type? Are there other heroes on the map besides the ones that players should control? Are all these heroes already owned by the appropriate player? This is the easiest solution I can think of:
  • Events
    • Time - Elapsed game-time is 0.50 seconds //don't use the map init even if you can avoid it, better not to risk crashing the init thread with too much stuff running off it
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true //'pre-emptively' cleans a unit group leak that's about to occur in the next line (see thread linked above if you don't understand)
    • Unit Group - Pick every unit in (Units in START_REGION <gen> matching (((Matching Unit) is a Hero) equal to True)) and do (Actions)
      • Loop - Actions
        • Camera - Lock camera target for (Owner of (Picked unit)) to (Picked unit), offset by (0.00, 0.00) using Default rotation
You could also use "Units of type Paladin" if a region won't work, or something like "Units in playable map area matching ((unit is a hero) and (owner of matching unit is an ally of Player 1)" if the region method isn't viable.

Things like "last X" are (internally) global variables that are set by the appropriate GUI functions when they're used. For example using "Unit - Create" sets Last Created Unit. "Last Dropped Item" only works when a unit is forced to drop an item with a trigger, not when it manually drops one on the ground. Technically all the units on the map are created at map init in the init thread, but they are made directly with JASS function calls and therefore do not set "last created unit" properly.

This worked. I set them to all spawn in that region you suggested creating. All heroes are owned by the appropriate player. There will, however, be other heroes on the map that are not controlled by the players. They might be computer controlled, i.e. bosses.
 
Level 5
Joined
Dec 29, 2008
Messages
61
This is what I've got so far. I'm not sure how you got the "Matching Unit is a Hero" condition in the Unit Group action.

  • Events
    • Time - Elapsed game time is 0.50 seconds
  • Actions
    • Environment - Set fog to style Linear, z-start 4000.00, z-end 5000.00, density 1.00 and color (100.00%, 100.00%, 100.00%)
    • Visibility - Disable fog of war
    • Visibility - Disable black mask
    • Environment - Set sky to Lordaeron Summer Sky
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in START <gen>) and do (Actions)
      • Loop - Actions
        • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility across (Playable map area)
        • Camera - Lock camera target for (Owner of (Picked unit)) to (Picked unit), offset by (0.00, 0.00) using Default rotation
        • Camera - Set (Owner of (Picked unit))'s camera Rotation to (Facing of (Picked unit)) over 0.00 seconds
        • Camera - Set (Owner of (Picked unit))'s camera Distance to target to 250.00 over 0.00 seconds
        • Camera - Set (Owner of (Picked unit))'s camera Angle of attack to 340.00 over 0.00 seconds
        • Camera - Set (Owner of (Picked unit))'s camera Height Offset to 60.00 over 0.00 seconds
        • Camera - Set (Owner of (Picked unit))'s camera Far Z to 5000.00 over 0.00 seconds
        • Camera - Set (Owner of (Picked unit))'s camera Field of view to 1000.00 over 0.00 seconds
The only thing I'm missing is for the camera to rotate when the unit moves and its direction changes. Would you have any idea how to make it so the camera rotates to point forward to where the unit is facing?

I could do something like this but I'm not sure how to tie it into the rest of the script:
  • Events
    • Time - Every 0.01 seconds of game time
  • Actions
    • Camera - Set (Owner of (Picked unit))'s camera Rotation to (Facing of (Picked unit)) over 0.00 seconds
This works when I do Set Player 1 (Red)'s camera Rotation to (Facing of (Paladin 0001) over 0.00 seconds, but I'm not sure how to generalize the script.

UPDATE:

Figured it out I believe. If you can point out potential flaws I'd greatly appreciate it.

Variables
mHero
Unit
Array
Size: 12
Initial Value: No unit

mPlayer
Player
Array
Size: 12
Initial Value: Player 1 (Red)

Initialization
Camera Initialization
  • Events
    • Time - Elapsed game time is 0.50 seconds
  • Actions
    • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
    • Environment - Set sky to Lordaeron Summer Sky
    • Visibility - Disable fog of war
    • Visibility - Disable black mask
    • Custom script: set bj_wantDestroyGroup = true
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Unit Group - Pick every unit in (Units in START <gen>) and do (Actions)
          • Loop - Actions
            • Set VariableSet mPlayer[(Integer A)] = (Owner of (Picked unit))
            • Set VariableSet mHero[(Integer A)] = (Picked unit)
            • Camera - Lock camera target for (Owner of (Picked unit)) to (Picked unit), offset by (0.00, 0.00) using Default rotation
            • Camera - Set (Owner of (Picked unit))'s camera Rotation to (Facing of (Picked unit)) over 0.00 seconds
            • Camera - Set (Owner of (Picked unit))'s camera Distance to target to 250.00 over 0.00 seconds
            • Camera - Set (Owner of (Picked unit))'s camera Angle of attack to 340.00 over 0.00 seconds
            • Camera - Set (Owner of (Picked unit))'s camera Height Offset to 60.00 over 0.00 seconds
            • Camera - Set (Owner of (Picked unit))'s camera Far Z to 5000.00 over 0.00 seconds
            • Camera - Set (Owner of (Picked unit))'s camera Field of view to 1000.00 over 0.00 seconds
Update Camera
  • Events
    • Time - Every 0.00 seconds of game time
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Camera - Set mPlayer[(Integer A)]'s camera Rotation to (Facing of mHero[(Integer A)]) over 0.00 seconds
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,023
I'm not sure how you got the "Matching Unit is a Hero" condition in the Unit Group action.
When trying to re-create a condition someone has told you to use always look for the "equal to" line. Why? Whatever it's being compared to be equal to tells you what kind of condition it is. In this case "equal to True" tells you that it's a boolean comparison because True is a boolean. Then in the boolean comparisons it's called Unit Classification Check. Alternatively you could check if the unit's hero level is > 0 (non heroes have a hero level of 0), which would be an integer comparison. In this case you don't even need this check if there are no other units in the START region, but I presumed there might be NPCs or shops or other stuff so I added that check.

Re: how to third-person camera... I think it's important to understand the scope of the camera you wish to achieve before you either start making something yourself or try to use someone else's working 3rd person camera.
  • Do you intend for players to move with the mouse (right clicking) or with some sort of arrow key/WASD system?
  • Do you want the player to be able to scroll to zoom in/out or change the angle of attack?
  • What about rotating +/-90 degrees temporarily (like Home/End normally do in wc3) to see from another angle if you can't view the thing you're trying to interact with because your hero model blocks the way?
  • Are there 'interior' areas where the camera might need to be manually zoomed in to avoid it clipping through a wall or some doodads/destructables?
  • Will you ever want to go to first person for any reason?
  • Does your map have a lot of variation in terrain height? This will mess with perceived camera height/distance because it won't move 'up' when the terrain does.
That being said there are a bunch of threads about 3rd person cameras here, a few resources, and a couple people who have offered their maps as examples of functional 3rd person camera setups. Yes they are mostly quite old (11+ years) but not much should have changed since that time (except the introduction of GetLocationZ in GUI). I did a google search and these all seem to have some information that might help you decide what to do/how to do it (not in any order of importance, just what showed up):
As for comments about the triggers you've shown above:
  • You put the region-group-pick inside the integer group. That means it picks every unit 12 separate times and keeps overwriting the first 12 indices of your variables. You only need to use one or the other, but not both.
  • Setting bj_wantDestroyGroup only 'automatically' destroys the next-created group, so 11 of those groups leak since that line is outside the Integer A loop.
  • I believe a player scrolling their camera will reset all the extra camera fields you've set in the init loop. You can get 'around' this by also setting these camera fields in the periodic trigger, but there might be another method to 'lock in' camera field settings. I'm unsure.
  • Never ever run a repeating timer/periodic trigger with a timeout of 0. It will try to execute as fast as it can (literally thousands of times per ssecond) constantly which absolutely will cause performance issues. A good safe value for 'fast periodic' stuff is 0.3 or 0.325. In some cases you may want a higher frequency which is totally fine... just a straight 0 is problematic.
    • This matters a lot more if you have to set all the camera fields for each player every time this runs (to keep them from being altered by scrolling).
  • Looping over 12 players is probably fine, but if you want to nitpick you really should only loop over the human players that are actively in the game instance rather than doing it to all 12 players all the time.
For the loop you have a couple ways you can go. The simplest would just be to add playing players to an array when the heroes in the START region are first iterated over (and remove them from the array if they quit the game but that's not strictly necessary either), setting an upper integer bound that your periodic trigger iterates up to instead of always going up to 12. Another solution would be to make a boolean array that indicates whether or not that player's camera should be updated. Set the correct boolean indices to true based on which players are playing, then simply set a player's boolean to false if you ever want to disable their camera shenanigans or if they quit the map.

If the human players are in sequential order (1-12) then both methods work fine. If they aren't all sequential (say player 4 is an NPC ally so you use players 1-3, 5-13 as your humans) then you'll want to go with the first method. Both are below:
  • ...
  • Visibility - Disable black mask
  • Set PlayerCount = 0
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in START <gen> matching (((Matching Unit) is a Hero) equal to True)) and do (Actions)
    • Loop - Actions
      • Set PlayerCount = (PlayerCount + 1)
      • Set mHero[PlayerCount] = (Picked Unit)
      • Set mPlayer[PlayerCount] = (Owner of mHero[PlayerCount])
      • Camera - Lock camera target for mPlayer[PlayerCount] to mHero[PlayerCount], offset by (0.00, 0.00) using Default rotation
      • Camera - Set mPlayer[PlayerCount]'s camera Rotation to (Facing of mHero[PlayerCount]) over 0.00 seconds
      • Camera - Set mPlayer[PlayerCount]'s camera Distance to target to 250.00 over 0.00 seconds
      • Camera - Set mPlayer[PlayerCount]'s camera Angle of attack to 340.00 over 0.00 seconds
      • Camera - Set mPlayer[PlayerCount]'s camera Height Offset to 60.00 over 0.00 seconds
      • Camera - Set mPlayer[PlayerCount]'s camera Far Z to 5000.00 over 0.00 seconds
      • Camera - Set mPlayer[PlayerCount]'s camera Field of view to 1000.00 over 0.00 seconds
      • Trigger - Add to LEAVE TRIGGER <gen> the event (Player - mPlayer[PlayerCount] leaves the game)
  • Trigger - Turn on PERIODIC TRIGGER <gen>
  • Events
  • -------- this trigger should be 'initially off' because it doesn't need to run for the first 0.5s of the game --------
    • Time - Every 0.0325 seconds of game-time
  • Conditions
  • Actions
    • For each (Integer A) from 1 to PlayerCount do (Actions)
      • Loop - Actions
        • Camera - Set mPlayer[(Integer A)]'s camera Rotation to (Facing of mHero[(Integer A)]) over 0.00 seconds
  • Events
    • -------- added dynamically by init trigger --------
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 12 do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Then actions) else do (Else actions)
          • If - Conditions
            • (Triggering Player) equal to mPlayer[(Integer A)]
          • Then - Actions
            • Set mPlayer[(Integer A)] = mPlayer[PlayerCount]
            • Set mHero[(Integer A)] = mHero[PlayerCount]
            • Set PlayerCount = (PlayerCount - 1)
            • Custom script: exitwhen true //leave loop early since we did what we needed
          • Else - Actions

  • ...
  • Visibility - Disable black mask
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in START <gen> matching (((Matching Unit) is a Hero) equal to True)) and do (Actions)
    • Loop - Actions
      • Set PlayerCount = (Player number of (Owner of (Picked Unit))
      • Set mHero[PlayerCount] = (Picked Unit)
      • Set mPlayer[PlayerCount] = (Owner of mHero[PlayerCount])
      • Set mPlaying[PlayerCount] = True
      • Camera - Lock camera target for mPlayer[PlayerCount] to mHero[PlayerCount], offset by (0.00, 0.00) using Default rotation
      • Camera - Set mPlayer[PlayerCount]'s camera Rotation to (Facing of mHero[PlayerCount]) over 0.00 seconds
      • Camera - Set mPlayer[PlayerCount]'s camera Distance to target to 250.00 over 0.00 seconds
      • Camera - Set mPlayer[PlayerCount]'s camera Angle of attack to 340.00 over 0.00 seconds
      • Camera - Set mPlayer[PlayerCount]'s camera Height Offset to 60.00 over 0.00 seconds
      • Camera - Set mPlayer[PlayerCount]'s camera Far Z to 5000.00 over 0.00 seconds
      • Camera - Set mPlayer[PlayerCount]'s camera Field of view to 1000.00 over 0.00 seconds
      • Trigger - Add to LEAVE TRIGGER <gen> the event (Player - mPlayer[PlayerCount] leaves the game)
  • Trigger - Turn on PERIODIC TRIGGER <gen>
  • Events
    • -------- this trigger should be 'initially off' because it doesn't need to run for the first 0.5s of the game --------
    • Time - Every 0.0325 seconds of game-time
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 12 do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Then actions) else do (Else actions)
          • If - Conditions
            • mPlaying[(Integer A)] equal to True
          • Then - Actions
            • Camera - Set mPlayer[(Integer A)]'s camera Rotation to (Facing of mHero[(Integer A)]) over 0.00 seconds
          • Else - Actions
  • Events
    • -------- added dynamically by init trigger --------
  • Conditions
  • Actions
    • Set mPlaying[(Player number of (Triggering Player))] = False
 
Last edited:
Level 5
Joined
Dec 29, 2008
Messages
61
Thanks for the very detailed reply. I am trying to implement it but I'm having trouble with actually finding some of the features in the menus.

How do you add the matching criteria below? I just can't find how to add it.

  • Unit Group - Pick every unit in (Units in START <gen> matching (((Matching Unit) is a Hero) equal to True)) and do (Actions)
Edit: I figured out how to do the above.

For the third trigger, what does -------- added dynamically by init trigger -------- mean?

Edit:

I believe I implemented everything as above but the camera no longer turns with the unit. Hmm...

I'm assuming mPlaying is a boolean array, PlayerCount is an integer, mHero is a Unit array and mPlayer is a Player array. Is that correct?

Edit:

It works now but I don't know why. The only thing that changed was adding:

  • Trigger - Add to LEAVE TRIGGER <gen> the event (Player - mPlayer[PlayerCount] leaves the game)
I wonder why not including that breaks the script.
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,023
For the third trigger, what does -------- added dynamically by init trigger -------- mean?
The trigger has no events in the editor because another trigger (the first one that does the visibility and all that) will add them to the trigger when it runs. The reason for that is:
  • You only care about knowing when players 1-12 leave the game (to stop doing their camera shenanigans)
  • There is no generic "player leaves game" trigger, so you'd have had to do this, which I'm generally not a fan of:
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • -------- etc --------
I'm assuming mPlaying is a boolean array, PlayerCount is an integer, mHero is a Unit array and mPlayer is a Player array. Is that correct?
Yes.
I wonder why not including that breaks the script.
I have no answer as to why; that makes 0 sense to me. There was, however, an error in the way I had written it above: I erroneously put that line outside the Unit Group loop when it should have been inside (because it needs to run for every player). I've corrected that above. I have one more correction, which is that you should actually check the player slot status to see if they're playing in the first place before doing any camera stuff:
  • ...
  • Visibility - Disable black mask
  • Set PlayerCount = 0
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in START <gen> matching (((Matching Unit) is a Hero) equal to True)) and do (Actions)
    • Loop - Actions
      • If (All conditions are true) then do (Then actions) else do (Else actions)
        • If - Conditions
          • ((Owner of (Picked unit)) slot status) Equal to Is playing //this is called "player slot status comparison"
        • Then - Actions
          • Set PlayerCount = (PlayerCount + 1)
          • Set mHero[PlayerCount] = (Picked Unit)
          • Set mPlayer[PlayerCount] = (Owner of mHero[PlayerCount])
          • Camera - Lock camera target for mPlayer[PlayerCount] to mHero[PlayerCount], offset by (0.00, 0.00) using Default rotation
          • Camera - Set mPlayer[PlayerCount]'s camera Rotation to (Facing of mHero[PlayerCount]) over 0.00 seconds
          • Camera - Set mPlayer[PlayerCount]'s camera Distance to target to 250.00 over 0.00 seconds
          • Camera - Set mPlayer[PlayerCount]'s camera Angle of attack to 340.00 over 0.00 seconds
          • Camera - Set mPlayer[PlayerCount]'s camera Height Offset to 60.00 over 0.00 seconds
          • Camera - Set mPlayer[PlayerCount]'s camera Far Z to 5000.00 over 0.00 seconds
          • Camera - Set mPlayer[PlayerCount]'s camera Field of view to 1000.00 over 0.00 seconds
          • Trigger - Add to LEAVE TRIGGER <gen> the event (Player - mPlayer[PlayerCount] leaves the game)
        • Else - Actions
  • Trigger - Turn on PERIODIC TRIGGER <gen>
That's assuming you used the first set of 3 triggers, not the second set of 3. If you used the second set, just add that If block in around everything inside the Unit Group loop as well.
 
Level 5
Joined
Dec 29, 2008
Messages
61
I opted for the second set of triggers. This is what I've set and it works fine now.

  • Events
    • Time - Elapsed game time is 0.50 seconds
  • Actions
    • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
    • Environment - Set sky to Lordaeron Summer Sky
    • Visibility - Disable fog of war
    • Visibility - Disable black mask
    • Environment - Set fog to style Linear, z-start 1000.00, z-end 2000.00, density 1.00 and color (68.00%, 60.00%, 100.00%)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in START <gen> matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Owner of (Picked unit)) slot status) Equal to Is playing
          • Then - Actions
            • Set VariableSet PlayerCount = (Player number of (Owner of (Picked unit)))
            • Set VariableSet mHero[PlayerCount] = (Picked unit)
            • Set VariableSet mPlayer[PlayerCount] = (Owner of mHero[PlayerCount])
            • Set VariableSet mPlaying[PlayerCount] = True
            • Camera - Lock camera target for mPlayer[PlayerCount] to mHero[PlayerCount], offset by (0.00, 0.00) using Default rotation
            • Camera - Set mPlayer[PlayerCount]'s camera Rotation to (Facing of mHero[PlayerCount]) over 0.00 seconds
            • Camera - Set mPlayer[PlayerCount]'s camera Distance to target to 250.00 over 0.00 seconds
            • Camera - Set mPlayer[PlayerCount]'s camera Angle of attack to 330.00 over 0.00 seconds
            • Camera - Set mPlayer[PlayerCount]'s camera Height Offset to 80.00 over 0.00 seconds
            • Camera - Set mPlayer[PlayerCount]'s camera Far Z to 5000.00 over 0.00 seconds
            • Camera - Set mPlayer[PlayerCount]'s camera Field of view to 1000.00 over 0.00 seconds
            • Trigger - Add to Leave Trigger <gen> the event (Player - mPlayer[PlayerCount] leaves the game)
          • Else - Actions
    • Trigger - Turn on Update Camera <gen>
    • Trigger - Run QuestsUndiscovered <gen> (checking conditions)
I attached the map in case you want to check it out for whatever reason.
 

Attachments

  • RPG.w3m
    497.2 KB · Views: 0
Level 5
Joined
Dec 29, 2008
Messages
61
Learned a lot about navigating the menus and playing with arrays and variables with your help so I appreciate it. This is the first time I've used in the editor in over a decade lol! My goal is to make a simple rpg with quests that work in a multiplayer context.
 
Level 5
Joined
Dec 29, 2008
Messages
61
In case you've checked out the map already I made a significant update just now to make the first quest totally functional. I've been using that PlayerCount array from the camera initialization to store multiplayer quest progress in quest-specific variables. This exercise definitely sparked a bunch of questions. I'm going to have to figure out how to manage a bunch of quest states for different players. Really makes me think haha!
 
I have a map where I force-select the hero etc.
I also do the following to make it a better experience:
  • Game - Disable drag-selection functionality (Disable drag-selection box)
  • Game - Disable selection and deselection functionality (Disable selection circles)
This might or might not be something you want, as it is impossible to interact with shops, check hp of target etc.
 
Level 5
Joined
Dec 29, 2008
Messages
61
There was, however, an error in the way I had written it above: I erroneously put that line outside the Unit Group loop when it should have been inside (because it needs to run for every player). I've corrected that above. I have one more correction, which is that you should actually check the player slot status to see if they're playing in the first place before doing any camera stuff:

Just going over this again. Here you say you erroneously put the line outside the Unit Group but your code still shows it outside.
 
Last edited:
Status
Not open for further replies.
Top