[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Modding > Triggers & Scripts


Triggers & Scripts In this forum you may ask for help on fixing a trigger or script. But if you need help getting started with a trigger, this is not the right place — use the World Editor Help Zone.

Closed Thread
 
Thread Tools
Old 01-28-2009, 07:43 PM   #1 (permalink)
Registered User Lightstalker
WC3 editor > SC2 editor
 
Lightstalker's Avatar
 
Join Date: Jul 2008
Posts: 151
Lightstalker has little to show at this moment (8)
How to remove a player's pre-placed units if player is not playing?

This is my current trigger that occurs at map ini. I've also tried many different versions of it, but nothing has worked so far.

Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) slot status) Not equal to Is playing
Then - Actions
Set NotPlaying_Group = (Units owned by (Picked player))
Unit Group - Pick every unit in NotPlaying_Group and do (Actions)
Loop - Actions
Unit - Remove (Picked unit) from the game
Custom script: call DestroyGroup(udg_NotPlaying_Group)
Else - Actions
Player - Limit training of Heroes to 1 for (Picked player)
Player - Set (Picked player) Current gold to 1500
Player - Turn Gives bounty On for (Picked player)
Hero - Make (Picked player) Heroes gain 85.00% experience from future kills
__________________


Finished projects: Golden Chaos v1.5

Current project: unnamed awesome map!
PM me for details & if you want to help! I also have other great projects to show you what I'm capable of!

Last edited by Lightstalker; 01-29-2009 at 03:03 PM.
Lightstalker is offline  
Old 01-28-2009, 08:57 PM   #2 (permalink)
Registered User Eleandor
Penguins, Bacon, Trees
 
Join Date: Aug 2005
Posts: 3,660
Eleandor is a glorious beacon of light (529)Eleandor is a glorious beacon of light (529)Eleandor is a glorious beacon of light (529)Eleandor is a glorious beacon of light (529)Eleandor is a glorious beacon of light (529)
Try: elapsed game time = 0.5 seconds?
__________________
Poop.
Eleandor is offline  
Old 01-28-2009, 09:51 PM   #3 (permalink)
Registered User xXMephistoXx
Bluuuuuuuueeee. OOoooo
 
xXMephistoXx's Avatar
 
Join Date: Sep 2006
Posts: 982
xXMephistoXx is a jewel in the rough (176)
Well, if you have 4 players it would be like this:
Player Init
Events
Map initialization
Conditions
Actions
For each (Integer A) from 1 to 4, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Not equal to Is playing
Then - Actions
Unit Group - Pick every unit in (Units owned by (Player((Integer A)))) and do (Actions)
Loop - Actions
Unit - Remove (Picked unit) from the game
Else - Actions
Player - Limit training of Heroes to 1 for (Player((Integer A)))
Player - Set (Player((Integer A))) Current gold to 1500
Player - Turn Gives bounty Off for (Player((Integer A)))
Hero - Make (Player((Integer A))) Heroes gain 85.00% experience from future kills

I think it should work. Just replace "4" with however many players you would like to have and add or edit the information to suit your map.
Although it might just be easier to add the units via a trigger, based on whether the player is playing or not and remove the "Create starting units for player" trigger..
__________________
Tenker eg!
"Am I allowed to write Norwegian here?"
SS TD
xXMephistoXx is offline  
Old 01-29-2009, 04:37 PM   #4 (permalink)
Registered User Lord_BoNes
Gamer
 
Lord_BoNes's Avatar
 
Join Date: Sep 2007
Posts: 264
Lord_BoNes has little to show at this moment (31)Lord_BoNes has little to show at this moment (31)Lord_BoNes has little to show at this moment (31)Lord_BoNes has little to show at this moment (31)
Wait until you've finished looping though all the players before destroying the units, put all the units in NotPlaying_Group into another group, then destroy NotPlaying_Group.

After you've looped through the players, all the "non-playing" units should be in one group... DESTROY THEM, then DESTROY THE GROUP!!

Sorry, got a little carried away there
__________________
- BoNes

"To kill one is a tragedy, to kill 10,000,000 is a statistic"
-Joseph Stalin
Lord_BoNes is offline  
Old 01-29-2009, 06:35 PM   #5 (permalink)
Registered User idodik
Dancin like a boss, I am
 
idodik's Avatar
 
Join Date: Aug 2008
Posts: 838
idodik has a spectacular aura about (123)idodik has a spectacular aura about (123)idodik has a spectacular aura about (123)idodik has a spectacular aura about (123)
Thumbs up Trigger Correction

Player Group - Pick every player in (Players matching (Matching Player is playing) equal to True) and do (Actions)
Loop - Actions
Set NotPlaying_Group = (Units owned by (Picked player))
Unit Group - Pick every unit in NotPlaying_Group and do (Actions)
Loop - Actions
Unit - Remove (Picked unit) from the
Custom script: call DestroyGroup(udg_NotPlaying_Group)

Corrected your trigger.
Make one for your filled player slots, you should.
May the Force be with you!
EDIT: Mephisto's solution is better. The Force is strong with you!
__________________

Fuck with Yoda, Die you will!
Typing like Yoda in threads, PMs, chat, rep while calling him an idiot makes you a bigger one.
SC2 Project - The Last Dragoons --- My StarCraft II Melee Maps

Create a SC2 Tutorial! --- S][C II Tutorials: How to Insert Terrain Objects, Creating GUI Functions in the Trigger Editor
idodik is offline  
Closed Thread

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Playing sounds JASS (for a single player) Marshmalo World Editor Help Zone 4 11-29-2008 03:07 AM
Leaderboard - Player 8 not playing, but says he is? Orakk World Editor Help Zone 1 10-28-2008 09:16 PM
Removing player units (when player is defeated) Galaga World Editor Help Zone 5 10-14-2008 12:46 AM
[Trigger] How to remove units owned by a player that never started in the game Systim Triggers & Scripts 14 08-21-2008 05:53 PM
[Trigger] A player leave then remove his units tamas.1 Triggers & Scripts 4 05-13-2008 09:33 PM

All times are GMT. The time now is 09:42 AM.





Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle