HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Hello and HELP!

07-25-2002, 07:28 PM#1
Guest
Hi, everyone. There seems to be a wealth of mapmaking intelligence here, so maybe you fine people can help me too.

I have a custom race with units and buildings based on various other races' stuff. I want to make upgrades at custom buildings, and I plan on doing this with the "make a fake unit and put the button for it at the building, then when the unit finishes training, remove it, and use triggers to creae the upgrade" technique.

Fine and dandy. I used a similar method to make my custom Town Hall upgrade to a custom Keep. That works perfectly (though I can't do the same to upgrade from Keep to Castle, due to the following problem).

However, I don't know how to do this at a building which is not existing at the start of the game. How do you tell the computer to constantly search for a specific custom building AND whether the custom building has trained a unit, so I can run the trigger to replace the trained with the upgrade?

I get frustrated because, through the trigger language, I understand how to select a building or unit that is PRE-PLACED, but not one that may be placed by the player at some point during the game.

Please help me, and if you do, mae it as blatantly spelled-out as possible (specific EVENT->CONDITION->ACTION trigger language preferred!)

Thanks in advance!
07-26-2002, 04:42 PM#2
Guest
Well, not sure if I understood your problem. Don't have WE near so I'm not sure but... wouldn't this work?

EVENT Unit Enters Region (with region being Playable Area)
CONDITION Unit type is <Myfakeunittypeforthisupgrade>
ACTION remove triggering unit
Trigger-Run trigger <your trigger>

That should check anywhere, wouldn't it? I'm not quite sure.

But with that you don't know which was the building that ordered the upgrade. Anyway, Isn't there a way to detect when a building starts construction of an unit? you might then Note in a variable (probably in an array) the building, and maybe you could note also the unit? Then, in the above trigger you could check the arrays for the building, or something like that. I should try it tonight. Sounds too messy, and a little too hard if you are not a programmer.

I'll try to think a better way and post it if that doesn't help you. :)
07-26-2002, 07:01 PM#3
Guest
Well, it depends on what action you use, but some actions concerning a unit, allow - apart from the list of picked units - variables to apply to. For example, when the player finishes the construction of the building, make a trigger that will call that building "building1":

make a new variable of type "unit" named "building1"

Event:
a unit owned by player one finishes construction
Condition:
unit type of (constructed structure) is (your type)
Action
Set variable "Building1" equal to (constructed structure)


Whenever you want to apply further triggers on that new constructed building, simply refer to "building1".

PS
However, some functions do not allow variables to be specified, for example the "unit in range" condition (with that one only picked units can be specified, I don't know why it doesn't allow variables)
But actions like: create unit at position of unit do recognize unit variables.