HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

just a quick question

01-19-2003, 11:15 PM#1
badomen
i want it so if a player selects a building and types something it changes ownership of that building...

im guessing i would use an "if/then/else" trigger but what exactly would it be?

i want it to be : (if) owner of tower = nutral pass (then) change ownership to {whoever triggered it} (else) do nothing

some help would be much appr
01-19-2003, 11:46 PM#2
AlexBS
u can do it with a cupl trigs

event:unit is selected

action:set selected unit to (variable1)

event:player types message= giveunit

action:give (variable1) to player something

thats pretty basic u need stuff in there to say WHO get s the unit
like a trigger for each player that has (givep1),(givep2) etceteras
01-20-2003, 12:05 AM#3
badomen
there has to b an easyer way...

i have 150 odd buildings to do this to!

in some TD maps if you sel a tower and type "sell" it sells the tower......how is that done?
01-20-2003, 12:18 AM#4
mikedogdude
Ok, do this:

Events: player chat message (giveto [player #])?

Actions: unit group - pick every unit in units currently selected by player (whatever player) and - give selected unit to player (convert player index[convert string to integer (Substring[entered chat message, 7, 9])])])

This should work
01-20-2003, 02:09 AM#5
AlexBS
i always try to help *sniff sniff* but i just suck so much that im usually a pain 50% of the time BOOHOO
01-20-2003, 03:07 AM#6
badomen
thanks 4 the help but i found an easyer way :)

incase anyone cares here it is.....

EVENT: player 1-6 types "buy" as an exact match

COND: Player 1-6 gold greater than or equal to 50

ACTION: IF ((owner of (random unit from (units currently selected by player 1 (red))) equal to neutral passive*)THEN do (unit change ownership of (unit currently selected by player 1 (red))) to player 1 (red) and chang colour ELSE do nothing

this stops players buying out from under other players


thanks for the help
01-20-2003, 05:32 AM#7
Dinadan87
Quote:
Originally posted by badomen
there has to b an easyer way...

i have 150 odd buildings to do this to!

in some TD maps if you sel a tower and type "sell" it sells the tower......how is that done?


Regardless of the number of buildings, his trigger should work fine. Although his trigger allows you to take ownership of ANY unit, so you'd have to specify just for towers. :P
01-20-2003, 11:54 PM#8
badomen
sorry i forgot to say its a TD map

so there will only be towers to pick (player 12 trigger stops people stealing others prev bought towers)