Sargeant Salsa
14 years ago
I would like to have two things happen:

If ANY (Unnamed) unit OF player0 enters Area1, that unit transfers to player1.

If ANY (Unnamed) unit OF player0 enters Area2, then that unit dies.

Any way of doing one, or both, of these things?
In war, the only salvation is annihilation.
Sponsor
VTULCobra
14 years ago
Both of them works in single- and multiplayer.
Rank up!
Sargeant Salsa
14 years ago
Yes, but I see no scripting for something like:

If
Player0 enters area Area1
then
all of player0's units within Area1 transfer control to player1
In war, the only salvation is annihilation.
i^love^mixery
14 years ago
you cant transfer unnamed units. so give the units in that Area1 which you want to transfer a name. for example:
Area1_01, Area1_02, Area1_03..

then make this script:
*If*
player0 has units in area Area1 (Player -> Area -> Player has units in area)
*Then*
Transfer unit Area1_01 to player0 (Player -> Transfer -> Transfer Unit)
Transfer unit Area1_02 to player0
Transfer unit Area1_03 to player0
.
.
.

and:
*If*
player0 has units in area Area2 (Player -> Area -> Player has units in area)
*then*
unit Area1_01 is dealt a lethal amount of damage. (Unit -> Damage or Remove -> Kill specific unit)
unit Area1_02 is dealt a lethal amount of damage.
unit Area1_03 is dealt a lethal amount of damage.
NewNightmare
14 years ago
you have to consider the design
do you want each unit to be transfered and die on their own? or if one enters all transfer/die?
you will have to do much more scripts for the second version.
and if you have a whole army entering the area... good luck :)
Also, what's the context of transfering the units? you can make them transfer when they finish following a path.
Lengo
  • Lengo
  • 69.5% (Friendly)
  • Captain
14 years ago
interesting concept, and this might work.

See

Conditions:Player:Area:Player has (comparison) units in an area.

You can select the headers INFANTRY or VEHICLE for the condition, then under Actions if True, there is

Player:Transfer:Transfer a specific unit.

the code will ask you for a unit named:. Use .



The Condition code looks like this:

Player 'player0' has Greater Than 0 unit or structure of type 'VEHICLE' in the area 'areaWhatever'
**OR***
Player 'player0' has Greater Than 0 unit or structure of type 'INFANTRY' in the area 'areaWhatever'
***OR***
(repeat for each player)

The Action if true code looks like this:

Unit '' is transferred to the command of Player 'playerN'

where N is a number, of course.

I can't say fer sure that this will work. I haven't tried it, but it looks real to me. Then again, if playerN is AmericanGeneral and the unit is ChinaTankGeneral, it will probably need further code to make the unit usable to the recipient.

BR-Alexandre
14 years ago
you can also select a lot of units at the same time and name them all the same then run script to transfer the named unit so all units should change owner right? never tested this
"The Only Way To Have Peace is Prepare for War" <---I forgot who said this...
"Lasers make superior weapons!" <--- Townes
"Laser crusader ready for engagement" <--- Laser Crusader Tank
"Tactical lasers online" <--- Avenger Support Venhice
"Storm climbed mountain" <--- Pathfinder Elite Infantry
"Ready for covert mission" <--- Stealth Fighter Tactical Support
i^love^mixery
14 years ago

you can also select a lot of units at the same time and name them all the same then run script to transfer the named unit so all units should change owner right? never tested this

BR-Alexandre wrote:



nope doesnt work.

unit names need to be unique. only one unit will be transfered (most likely the one that was there first in worldbuilder)

if you spawn a unit called UNIT1 then you cant even spawn a second one with the name UNIT1 for the same player. it just wont spawn.