Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Sargeant Salsa  
#1 Posted : Monday, February 20, 2012 2:21:53 PM(UTC)
Sargeant Salsa
Private
Joined: 2/7/2012(UTC)
Posts: 16
Location: USA

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
Offline VTULCobra  
#2 Posted : Monday, February 20, 2012 2:27:07 PM(UTC)
VTULCobra
Major
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 10/20/2011(UTC)
Posts: 383
Sweden

Thanks: 39 times
Was thanked: 33 time(s) in 33 post(s)
Both of them works in single- and multiplayer.
Rank up!
Offline Sargeant Salsa  
#3 Posted : Monday, February 20, 2012 2:31:22 PM(UTC)
Sargeant Salsa
Private
Joined: 2/7/2012(UTC)
Posts: 16
Location: USA

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.
Offline i^love^mixery  
#4 Posted : Tuesday, February 21, 2012 12:35:35 AM(UTC)
i^love^mixery
Colonel
Joined: 10/13/2008(UTC)
Posts: 782

Thanks: 7 times
Was thanked: 201 time(s) in 147 post(s)
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.

Edited by user Tuesday, February 21, 2012 12:38:18 AM(UTC)  | Reason: Not specified

Offline NewNightmare  
#5 Posted : Tuesday, February 21, 2012 10:35:46 PM(UTC)
NewNightmare
Colonel
Joined: 5/24/2010(UTC)
Posts: 492

Was thanked: 48 time(s) in 40 post(s)
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.
Offline Lengo  
#6 Posted : Wednesday, March 28, 2012 1:36:36 PM(UTC)
Lengo
Captain
Joined: 12/17/2010(UTC)
Posts: 70
Location: Springfield, OR

Thanks: 2 times
Was thanked: 4 time(s) in 3 post(s)
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 <this unit>.



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 '<This Object>' 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.

Edited by user Wednesday, March 28, 2012 2:32:56 PM(UTC)  | Reason: Not specified

Offline BR-Alexandre  
#7 Posted : Thursday, March 29, 2012 2:03:10 PM(UTC)
BR-Alexandre
Major
Joined: 10/1/2010(UTC)
Posts: 230
Location: Bras&#237;lia, Brazil

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
Offline i^love^mixery  
#8 Posted : Friday, March 30, 2012 4:32:29 AM(UTC)
i^love^mixery
Colonel
Joined: 10/13/2008(UTC)
Posts: 782

Thanks: 7 times
Was thanked: 201 time(s) in 147 post(s)
BR-Alexandre wrote:
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


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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.