• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Hero Spawning rules .... need help .....

Status
Not open for further replies.
Level 3
Joined
Apr 20, 2013
Messages
36
hi guys

im making a map like shadowraze wars or something like that and i have stuck in something .....

well it has got 7 player slots for my friends to join and i wanted this :

what trigger shall i use to make it ONLY spawn hero's for the joined players, not all slots ......

sry for bad english and yes i am a Newbie :ogre_hurrhurr:

TnX in advance ...
 
Level 2
Joined
Mar 29, 2013
Messages
11
  • Hero Spawn
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set TempPlayerGroup = (All players controlled by a User player)
      • Player Group - Pick every player in TempPlayerGroup and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Center of (Playable map area))
          • Unit - Create 1 Footman for (Picked player) at TempPoint facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyForce(udg_TempPlayerGroup)
There is a leakless version if you know how to add custom scripts/variables.
Replace Footman with the unit you are making, and replace (Center of (Playable map area)) with where they spawn.

If you don't care about an efficient trigger use this

  • Hero Spawn
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees
 
Level 3
Joined
Apr 20, 2013
Messages
36
Tnx a LOT ......

i'll try it ..... not solved yet ;)

Edit: oh sry ...... how the variable "TempPlayerGroup" must be ???

i mean its options like array, etc ...
 
Last edited by a moderator:
Level 2
Joined
Mar 29, 2013
Messages
11
Sorry, I forgot a part of it.
You need to add the "Is playing" part

  • Set TempPlayerGroup = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
 
Level 3
Joined
Apr 20, 2013
Messages
36
hooffffff that was very long :D

ok done and another problem .....

i done that and added a bot to test it because i needed an opponent to start ;) ....

and i set the map visible to see does any hero spawns .....

and i saw this : all slots spawned hero EXCEPT the bot one i set for test :|

now what dude ??? :(
 
Level 2
Joined
Mar 29, 2013
Messages
11
hooffffff that was very long :D

ok done and another problem .....

i done that and added a bot to test it because i needed an opponent to start ;) ....

and i set the map visible to see does any hero spawns .....

and i saw this : all slots spawned hero EXCEPT the bot one i set for test :|

now what dude ??? :(

  • Hero Spawn
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set TempPlayerGroup = (All players controlled by a Computer player)
      • Player Group - Pick every player in TempPlayerGroup and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Center of (Playable map area))
          • Unit - Create 1 Footman for (Picked player) at TempPoint facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyForce(udg_TempPlayerGroup)
Do that if you want multiple computers (they probably won't do anything but stand there in your map)

If it's just one computer:

Set TempPoint = (their spawnpoint)
Unit - Create 1 ______ for (Computer Player's color here) at TempPoint facing default building facing degrees
Custom script: call RemoveLocation(udg_TempPoint)
 
Level 3
Joined
Apr 20, 2013
Messages
36
  • Hero Spawn
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set TempPlayerGroup = (All players controlled by a Computer player)
      • Player Group - Pick every player in TempPlayerGroup and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Center of (Playable map area))
          • Unit - Create 1 Footman for (Picked player) at TempPoint facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyForce(udg_TempPlayerGroup)
Do that if you want multiple computers (they probably won't do anything but stand there in your map)

If it's just one computer:

Set TempPoint = (your spawnpoint)
Unit - Create 1 ______ for (Computer Player's color here) at TempPoint facing default building facing degrees
Custom script: call RemoveLocation(udg_TempPoint)

well want to spawn ONLY for USER controlled players ..... no spawn for bot or open slots ......

i tested that in single player to see does it spawn for open slots or not .....

and yes it spawns for open slots and i dont want that ....

anyway to solve it ?

By the way Tnx for the help
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
  • Actions
    • Set TempLoc = (Center of (Playable map area))
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Set Player = (Player((Integer A)))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Player controller) Equal to User
            • (Player slot status) Equal to Is playing
          • Then - Actions
            • Unit - Create 1 Blood Mage for Player at TempLoc facing Default building facing degrees
          • Else - Actions
    • Custom script: call RemoveLocation(udg_TempLoc)
Here's a test map.
 

Attachments

  • Spawn Only For Player Playing.w3x
    16.3 KB · Views: 25
Level 3
Joined
Apr 20, 2013
Messages
36
  • Actions
    • Set TempLoc = (Center of (Playable map area))
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Set Player = (Player((Integer A)))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Player controller) Equal to User
            • (Player slot status) Equal to Is playing
          • Then - Actions
            • Unit - Create 1 Blood Mage for Player at TempLoc facing Default building facing degrees
          • Else - Actions
    • Custom script: call RemoveLocation(udg_TempLoc)
Here's a test map.

TNX A LOT IT WORKS !!!! +rep

at last .... but not at least .... my map is still in work :D
 
Level 7
Joined
Jan 22, 2013
Messages
293
  • Actions
    • Set TempLoc = (Center of (Playable map area))
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Set Player = (Player((Integer A)))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Player controller) Equal to User
            • (Player slot status) Equal to Is playing
          • Then - Actions
            • Unit - Create 1 Blood Mage for Player at TempLoc facing Default building facing degrees
          • Else - Actions
    • Custom script: call RemoveLocation(udg_TempLoc)
Here's a test map.

Im sorry defskull I know I work for you in the spell workshop but your making mistakes.

You should never use IntegerA. Create a Integer Variable with the value of 0 then use it as
  • Actions
    • For each (Integer Variable) from 1 to 12, do (Actions)
      • Loop - Actions
Also you should Always null leaks.

  • Custom script: set udg_TempLoc = null
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Do I need to be advance for each trigger ?
Some things like IntegerA and nulling global variable proves to be quite less things to have affect the overall performance of a game.

Since this is just a simple system, those 2 matter doesn't even matter to me and doesn't even degrade the game engine, not one bit.

You can do these things if you're dealing with massive amount of data structure, but for a simple thing like this ?

Come on, guys.
 
Level 7
Joined
Jan 22, 2013
Messages
293
Do I need to be advance for each trigger ?
Some things like IntegerA and nulling global variable proves to be quite less things to have affect the overall performance of a game.

Since this is just a simple system, those 2 matter doesn't even matter to me and doesn't even degrade the game engine, not one bit.

You can do these things if you're dealing with massive amount of data structure, but for a simple thing like this ?

Come on, guys.


I'm sorry Defskull, but no matter what, I believe that all people who post aid for others should make sure they do it the best possible. If its a small system then why complain about it.

I personally feel ashamed when I give people things that I can't call "Top notch" I do the best I can do for them, no matter how big or how small. No slacking. Full Customer satisfaction xD
 
Status
Not open for further replies.
Top