wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 07-21-2010, 05:17 PM   #1
rakshassa
User
 
Join Date: Jul 2010
Posts: 1

rakshassa has little to show at this moment (0)

Default Units hanging around after removal?

I have one trigger which replaces units of one type with different units (trigger 1)
Then, later, I have a trigger which checks of a user owns more than 5 units of a given type.

For some reason, (trigger 1) is not actually removnig the units I replace "in memory" because (trigger 2) is finding all the removed units and all the newly created ones.

TRIGGER 1:
Trigger:
Actions
-------- Randomize them --------
Collapse For each (Integer tmpInt) from 0 to 4, do (Actions)
Collapse Loop - Actions
Set tempUnitGroup2 = (Units of type mobsAvatar[tmpInt])
Collapse Unit Group - Pick every unit in tempUnitGroup2 and do (Actions)
Collapse Loop - Actions
Set tmpUnit = (Picked unit)
-------- Store starting information --------
Set tmpPoint = (Position of tmpUnit)
Set tmpPlayer = (Owner of tmpUnit)
Set tempi = (Custom value of tmpUnit)
Unit - Remove tmpUnit from the game
-------- Replace the Unit --------
Set tmpInt2 = (Random integer number between 0 and 3)
Unit - Create 1 mobsAvatar[tmpInt2] for tmpPlayer at tmpPoint facing tmpPoint
Set tmpUnit = (Last created unit)
Selection - Add tmpUnit to selection
-------- Set new unit with the pre-existing values --------
Unit - Set the custom value of tmpUnit to tempi
Trigger - Run Cripple specific Avatar <gen> (checking conditions)
Custom script: call DestroyGroup (udg_tempUnitGroup2)


Trigger 2:
Trigger:
Actions
Set tempBool = False
Collapse For each (Integer tmpInt) from 0 to 3, do (Actions)
Collapse Loop - Actions
Set tempUnitGroup2 = (Units owned by CurrentPlayer matching (((Unit-type of (Matching unit)) Equal to mobsAvatar[tmpInt]) and (((Matching unit) is alive) Equal to True)))
Game - Display to players_playing the text: ((String(mobsAvatar[tmpInt])) + (String((Number of units in tempUnitGroup2))))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in tempUnitGroup2) Greater than or equal to 6
Collapse Then - Actions
Player - Set CurrentPlayer Current lumber to ((CurrentPlayer Current lumber) + 1)
Game - Display to players_playing the text: ((Name of CurrentPlayer) + gains 1 Achievement Point for the 'Bingo' Achievement.)
Set tempBool = True
Collapse Else - Actions
Do nothing
Custom script: call DestroyGroup (udg_tempUnitGroup2)
-------- Play sound if we got an achievement --------
If (tempBool Equal to True) then do (Sound - Play SorceressPissed6 <gen>) else do (Do nothing)
rakshassa is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 07-21-2010, 08:30 PM   #2
Tot
6
 
Tot's Avatar
 
Join Date: Oct 2008
Posts: 841

Tot will become famous soon enough (53)Tot will become famous soon enough (53)

Default

Trigger:
Set tmpPoint = (Position of tmpUnit)
leaks a location

Trigger:
Unit - Remove tmpUnit from the game
add a debug line after it, which shows the unit's name; if it was removed properly the name should be either a default string or equal to an empty string

you could also try to replace this
Trigger:
Set tempUnitGroup2 = (Units owned by CurrentPlayer matching (((Unit-type of (Matching unit)) Equal to mobsAvatar[tmpInt]) and (((Matching unit) is alive) Equal to True)))
group enumeration with another one, enumerating all units on the map, checking if their owner is equal to CurrentPlayer and the upper conditions
cause i vaguely remember something special about unit-enumeration with
Trigger:
Units owned by <player>
__________________
Current Projects:
  • Masters Of WarCraft: Some mixture of AoS and RPG
    Terrain: 100%, Coding: 75%, Heroes: 0%, Items: 0%, Creeps: 0%, Upgrades: 0%
  • hunting emos
____________________________________
scheiss kack dreck sausacksau bundeswehr

Last edited by Tot : 07-21-2010 at 08:31 PM.
Tot is offline   Reply With Quote
Old 07-21-2010, 09:49 PM   #3
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,061

Submissions (19)

Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)Anitarf has a brilliant future (883)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by Tot
group enumeration with another one, enumerating all units on the map, checking if their owner is equal to CurrentPlayer and the upper conditions
cause i vaguely remember something special about unit-enumeration with
Trigger:
Units owned by <player>
Aside from it enumerating locusted units, I can not remember anything special about it. Definitely not something that would warrant your roundabout solution.
__________________
Anitarf is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 02:19 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services