HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

a lil help here.

06-22-2009, 11:11 AM#1
hweiqiang
hi people.
its me again,you guys really helped me alot and i'm 75% through my way making this map.
but i have a problem and i hope you can help me.
how do i count a specific tower using a variable.
for example,i have TowerX, and everytime a player builds another towerX,there is a variable supporting it to help it count.
anyone got a idea how can i do that? :D
06-22-2009, 12:33 PM#2
tamisrah
Hi again

Version 1:
Trigger:
Collapse Events
Unit - A unit Finishes Construction
Collapse Conditions
(Unit-type of (Constructed structure)) Equal to TowerX
Collapse Actions
Set SomeCount = (SomeCount + 1)
Trigger:
Collapse Events
Unit - A unit leaves (Playable map area)
Collapse Conditions
(Unit-type of (Constructed structure)) Equal to TowerX
Collapse Actions
Set int = (int - 1)

Version 2:
When ever you need the tower count do this a line before
Trigger:
Set SomeCount = (Number of units in (Units owned by SomePlayer of type TowerX))
06-23-2009, 02:28 AM#3
hweiqiang
that did helped. :D
one more thing,
can i put a Integer variable into a text message displayed?
06-23-2009, 02:32 AM#4
darkwulfv
Yes you can. There's an action (or subset of an action, or whatever) that lets you convert an integer into part of a string. Just do a text message action and in the text argument, look for "Conversion - Convert Integer to String".