• 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.

Script request for special co-op mode/maps

Status
Not open for further replies.
Level 1
Joined
Jul 4, 2014
Messages
1
Sorry if I'm posting in the wrong sub-forum.

I'd like to play regular skirmish maps co-op, with a hitch: One player controls a hero and only that one hero, and the other player controls all the other buildings and units. I'm looking to just do 2vAI, the other AI players can function completely normally. I'm not sure how experience would be distributed, if gold can be shared, or have any idea how a hero might be able to get respawned. I'm hoping I can get a few ideas and some scripts that might be easy to add to any existing Skirmish map to make it co-op compatible. Perhaps someone with some greater knowledge could help me out. Thanks in advance.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Firstly, hero selection:
Waiting to build an altar would be quite boring, so for the second player I suggest you just spawn an altar next to the first player's start location. Also give this player the 5 food required to train a hero.

To prevent the second player also getting a whole base, you'll have to change the initialization trigger.
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Use melee time of day (for all players)
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
      • Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
      • Melee Game - Set starting resources (for all players)
      • Melee Game - Remove creeps and critters from used start locations (for all players)
      • Melee Game - Create starting units (for all players)
      • Melee Game - Run melee AI scripts (for computer players)
      • Melee Game - Enforce victory/defeat conditions (for all players)
Delete the line that creates starting units for all players. Now, create a new player group variable and add all players to it. Then remove player 2 (the hero player) from it, and run this action for all players still in the player group:
  • Melee Game - Create Human starting units for (Picked player) at ((Picked player) start location) (Exclude Heroes)
Exp distribution won't be a problem, I think.
Resources - each would have their own resources, but can give to each other as needed. Hero will be able to respawn at his altar (as long as it hasn't been destroyed)
 
Status
Not open for further replies.
Top