• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Problems controlling units.

Level 4
Joined
Oct 9, 2024
Messages
63
I'm working on an RPG map inspired by tabletop RPGs, where I take on the role of Game Master and oversee four players as adventurers. However, I've encountered a technical limitation in the system. As Game Master, I need to control NPCs to interact with, guide, and assist the players. At the same time, I'm responsible for controlling the monsters on the map. The game, unfortunately, only allows me to be either allied with or an enemy to the players, who are all allied with each other.

Is there a way to work around this? I was considering switching between being an ally and enemy with the players mid-game, but this could reveal hidden enemies on the map. Another idea was to toggle between 'neutral' and 'enemy' status, but I’m not sure if that would work effectively. Any advice or tips on how to better manage this would be greatly appreciated!
 

Remixer

Map Reviewer
Level 33
Joined
Feb 19, 2011
Messages
2,112
I'm working on an RPG map inspired by tabletop RPGs, where I take on the role of Game Master and oversee four players as adventurers. However, I've encountered a technical limitation in the system. As Game Master, I need to control NPCs to interact with, guide, and assist the players. At the same time, I'm responsible for controlling the monsters on the map. The game, unfortunately, only allows me to be either allied with or an enemy to the players, who are all allied with each other.

Is there a way to work around this? I was considering switching between being an ally and enemy with the players mid-game, but this could reveal hidden enemies on the map. Another idea was to toggle between 'neutral' and 'enemy' status, but I’m not sure if that would work effectively. Any advice or tips on how to better manage this would be greatly appreciated!
What is your current iteration of the control? How do you currently control the neutrals, allies and enemies?

As far as I know you can individually change control, vision and alliance modes independently of the corresponding unit (and player slot) being enemy or not - essentially the game does allow players to control enemy units too, if you just dictate the shared control to exist.
 
Level 4
Joined
Oct 9, 2024
Messages
63
Is it possible to control 2 groups of units? Could I be in control of the red and green units at the same time? with the greens being allies of the players and the reds being their enemies?
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
If what Remixer suggested isn't a thing: it should be relatively simple to make the GM allied to adventurers and make another hostile player slot that together encompass all the possible units. Then build a toggle UI element for the GM player that will swap all of the units between the two players and also swap both their hostility to the adventurers. Essentially just an in-place swap of the controllers without altering the player properties.
  • Events
    • -------- swap event --------
  • Conditions
  • Actions
    • Player - Add Player 1 (Red) to Adventurers
    • Player - Add Player 2 (Blue) to Adventurers
    • Player - Add Player 3 (Teal) to Adventurers
    • Player - Add Player 4 (Purple) to Adventurers
    • Set GM_H = (Player that starts hostile)
    • Set GM_A = (Player that starts allied)
    • -------- do the above only once on init --------
    • Set TP = GM_H //temp player to swap the value of the variables
    • Set GM_H = GM_A
    • Set GM_A = TP
    • Set Units_H = (Units owned by GM_H)
    • Set Units_A = (Units owned by GM_A)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in Units_H and do (Actions)
      • Loop - Actions
        • Unit - Change owner of (Picked Unit) to GM_H and retain color
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in Units_A and do (Actions)
      • Loop - Actions
        • Unit - Change owner of (Picked Unit) to GM_A and retain color
    • Player Group - Pick every player in Adventurers and do (Actions)
      • Loop - Actions
        • Player - Make (Picked Player) treat GM_H as an Enemy
        • Player - Make (Picked Player) treat GM_A as an Ally
        • Player - Make GM_H treat (Picked Player) as an Enemy
        • Player - Make GM_A treat (Picked Player) as an Ally
It's possible this messes with current and/or queued orders. I didn't check.
 
Last edited:
Level 29
Joined
Sep 26, 2009
Messages
2,596
this works:
  • Map Ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Ally with shared vision and full shared units
      • Player - Make Player 3 (Teal) treat Player 1 (Red) as an Ally with shared vision and full shared units
      • Player - Make Neutral Hostile treat Player 1 (Red) as an Ally with shared vision and full shared units
Imagine that Player 1 Red is the GM who has control over all other players.

One thing I've notice - sleeping neutral hostiles are kind of stunned and cannot be manually moved until they stop sleeping :D
You can even select into a single select group (12 units) units from players that are hostile towards each other and move them together. Seemed kind of funny how they moved in formation, then reached objective and turned against one another :D
 
Top