Home   Help Search Login Register  

Author Topic: Changin Side during gameplay  (Read 1257 times)

0 Members and 1 Guest are viewing this topic.

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Changin Side during gameplay
« on: 16 Jun 2005, 18:34:41 »
There is a Way tho change the side during gameplay? I mean, not the Resistance "allied whit.." thing, In mi Mission there is a Western pilot, and I want him to turn Easter when a trigger is hit or something.... Could be done???

waiting 4 ideas!


(and forget mi english)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Changin Side during gameplay
« Reply #1 on: 16 Jun 2005, 18:36:29 »
no and yes ;)

no, you can't change the side of the same loon.

yes, you could get rid of the pilot, and in the same moment setpos an east pilot who looks the same into his place.

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Re:Changin Side during gameplay
« Reply #2 on: 16 Jun 2005, 18:47:39 »
wow!
 nice IDEA! :D I will be testing it now... but how U will do the script?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Changin Side during gameplay
« Reply #3 on: 16 Jun 2005, 19:10:10 »
west pilot, named spy2, grouped with an east colonel whose 'probablility of presence' is 0. this will make 'spy2' east. place them away on an island someplace.

west pilot, named spy, just west, wherever he needs to be. in your trigger to swap them, [] exec "swap_pilots.sqs", as below:

Code: [Select]
_x = getpos spy1 select 0
_y = getpos spy1 select 1
_dir = getdir spy1

spy1 setpos [0,0,0]
spy2 setdir _dir
spy2 setpos [_x,_y]

exit

you may also wish to make sure that the combat mode of both pilots is the same, and that they have the same weapons.... first thing i did when i rescued the pilot is give him a gun ;)

Offline Ottie

  • Members
  • *
  • And you think this is personal
Re:Changin Side during gameplay
« Reply #4 on: 17 Jun 2005, 10:07:02 »
You can just group the west pilot with an east officer and he will change sides .:

Code: [Select]
westPilot join group easttOfficer

This will do the job.
« Last Edit: 17 Jun 2005, 10:09:18 by Ottie »
If you can't beat them, buy them

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Re:Changin Side during gameplay
« Reply #5 on: 18 Jun 2005, 02:26:50 »
this is my mod of the Bedge's Script... (the Pilot was on the player group)

Code: [Select]
_x = getpos spy1 select 0
_y = getpos spy1 select 1
_dir = getdir spy1
_wep = weapons spy1
_mag = magazines spy1
_dam = damage spy1

removeallweapons(spy2)
[spy1] joingroup "null"

#mags

? (count _mag) == 0 : goto "wep"
_i = _mag select 0
spy2 addmagazine _i
_mag = _mag - _i

goto "mags"

#wep

? (count _wep) == 0 : goto "done"
_i2 = _wep select 0
spy2 addweapon _i2
_wep = _wep - _i2

goto "wep"

#done
spy2 setdammage (_dam)
spy1 setpos [0,0,0]
spy2 setdir _dir
spy2 setpos [_x,_y]

exit


But it is surely Wrong.. I havn't tested it yet..
there is a Way to delete a element of an array whitout knowing the order? like i have tried to do on the "_mag = _mag - _i" thing... becuase [stringA, stringB,stringC,stringD,stringA] - [stringA,stringC] == [stringB,stringD].. but DK if [stringB,stringD] - stringB == [stringD]..

Offline Ottie

  • Members
  • *
  • And you think this is personal
Re:Changin Side during gameplay
« Reply #6 on: 18 Jun 2005, 07:54:01 »
Just use the "join" command its much simpler .....
If you can't beat them, buy them

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Changin Side during gameplay
« Reply #7 on: 18 Jun 2005, 09:32:55 »
hmmm, instead of taking away from the array, i would do it like this -

Code: [Select]
_x = getpos spy1 select 0
_y = getpos spy1 select 1
_dir = getdir spy1
_wep = weapons spy1
_numweps = count _wep
_mag = magazines spy1
_totalmags = count _mag
_dam = damage spy1

removeallweapons spy2
[spy1] join grpnull

? _totalmags == 0 : goto "wep"

_i = 0

#mags

spy2 addmagazine (magazines spy1 select _i)
_i = _i + 1
?not (_i>_totalmags):goto "mags"

? _numweps == 0 : goto "done"

_i = 0
#wep

spy2 addweapon (weapons spy1 select _i)
_i = _i + 1
?not (_i>_numweps):goto "wep"


#done
spy2 setdammage _dam
spy1 setpos [0,0,0]
spy2 setpos [_x,_y]
spy2 setdir _dir
spy2 dowatch [_x + (10*sin(_dir)), _y + (10*cos(_dir)), 1.4]

exit

that starts at weapon/magazine 0 and goes through them one after the other adding each to the other spy.
« Last Edit: 18 Jun 2005, 10:01:33 by bedges »

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Re:Changin Side during gameplay
« Reply #8 on: 18 Jun 2005, 20:30:36 »
Thanks a lot!!!
I`ll be testing it!