Home   Help Search Login Register  

Author Topic: Making THe Player Switch Sides  (Read 3793 times)

0 Members and 2 Guests are viewing this topic.

Lean Bear

  • Guest
Making THe Player Switch Sides
« on: 21 Dec 2004, 17:08:59 »

How can you make the player switch sides in the middle of a mission? (via a script possibly)

The problem is, the only things I can find on it just return what side the player is on or confirms it.


Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Making THe Player Switch Sides
« Reply #1 on: 21 Dec 2004, 17:18:26 »
It cannot be done within a mission

Lean Bear

  • Guest
Re:Making THe Player Switch Sides
« Reply #2 on: 21 Dec 2004, 18:28:27 »
Are you sure?

I don't mean switching models or anything, just so that the side the player is "on" doesn't shoot him. (And so the other sides do, but don't unfairly target the player)


Offline Blip

  • Members
  • *
  • ...Old OFP FART...
Re:Making THe Player Switch Sides
« Reply #3 on: 21 Dec 2004, 18:36:28 »
You could use the setcaptive command.  Basically if your a west unit and you don't want to get shot at by the east you put this in your init line:
this setcaptive true
However, as soon as you shoot at the east they will turn on you.  There are also some spy units in the editor which look like one side but are technically the other sides unit.

As far as scripting is concerned, THobson is right.  It can't be done in the mission.

Later,

Blip  :joystick:
...NIGHT WALKER....

Lean Bear

  • Guest
Re:Making THe Player Switch Sides
« Reply #4 on: 21 Dec 2004, 18:38:05 »
Yeah, that's what I had been using.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Making THe Player Switch Sides
« Reply #5 on: 21 Dec 2004, 18:39:34 »
im not sure but i dont think that is possible.

you could make a scrpt that setcaptives him when he is near enemies and un setcaptives him when he is around friendlys and also makes them try to kill them.

actualy:

use player joingrp"so'n'so" and make so'n'so an enemy group.

i think

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Making THe Player Switch Sides
« Reply #6 on: 21 Dec 2004, 18:58:15 »
Afraid so.

By grouping soldiers with a high rank leader of a different side and setting his condition of presence to false you can make units look like they are on a different side.  So you could create some east soldiers that look like west and vice verca.  You might be able to make it look like he has changed sides.  But you cannot actually make it happen for real.
« Last Edit: 21 Dec 2004, 19:25:48 by THobson »

bored_onion

  • Guest
Re:Making THe Player Switch Sides
« Reply #7 on: 21 Dec 2004, 19:36:52 »
maybe you could try:

this setcaptive true in conjunction with adding a rating to make guys turn on you. (in case you don't know, ratings are judged by how many guys from your own side or other side you shoot and if it gets beyond a certain point then everyone on your own side shoots you). of course you would need to leave the group as well.

is this possible?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Making THe Player Switch Sides
« Reply #8 on: 21 Dec 2004, 21:41:30 »
one problem with that, is that when that happens, if its ai, he will still be the enemy of whatever side he is captive to, and he won't attack his mates.  also you can't do any trigger conditions involving a certain side because
1)he never went to the other team's side. and
2)he becomes a side called "enemy" when his rating drops

Lean Bear

  • Guest
Re:Making THe Player Switch Sides
« Reply #9 on: 21 Dec 2004, 21:45:33 »
@ THobson

That's how I've been getting all 4 sides (East, West, Civ and Res) to all be enemies with eachother - a very useful "trick".

@ bored_onion & penguinman & Blip

The setCaptive command is the one I am currently using, and , as you said Blip, when the player shoots at the enemy the enemy turns on him.

And penguinman, due to the mission plot, there is a script that resets the player to the setCaptive state at a certain place after a cutscene or two.

But bored_onion I have no idea what you're on about with the rating //moreover, how to use it in scripting etc.


Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Making THe Player Switch Sides
« Reply #10 on: 21 Dec 2004, 21:48:57 »
he means using something like
guy addrating -100000
so his teammates will turn on him, but the better way is to have him join an east soldier or whatever his enemy is midgame.

is it the player that switches or ai?

Lean Bear

  • Guest
Re:Making THe Player Switch Sides
« Reply #11 on: 21 Dec 2004, 21:50:29 »
Only the player.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Making THe Player Switch Sides
« Reply #12 on: 21 Dec 2004, 23:40:39 »
then either way will work, but the joining one is better.
just make a script that creates a guy and then has the player join him

[nameofplayer] exec "changesides.sqs"

Changesides.sqs
Code: [Select]
_guy = _this select 0
_newside = "name of unit on other side(like soldierWB, for a west unit)" createunit [[0,0,0],grpnull,"",1,"major"]
[_guy] join _newside
deletevehicle _newside
exit

something like that
« Last Edit: 21 Dec 2004, 23:41:08 by Triggerhappy »

Sophion

  • Guest
Re:Making THe Player Switch Sides
« Reply #13 on: 21 Dec 2004, 23:56:51 »
you don't need a script... you can open mision.sqm through notepad and find the unit you wish to change:

Code: [Select]
      {
         side="EAST";
         class Vehicles
         {
            items=1;
            class Item0
            {
               position[]={4157.853516,11.166650,3208.751221};
               azimut=270.000000;
               id=0;
               side="EAST";
               vehicle="SoldierEB";
               leader=1;
               skill=0.600000;
               text="R1";
               init="This SetBehaviour ""SAFE""";
            };
         };
      };

under "EAST" you can name him under "CIV", "GUER", or "WEST" on everything that says "Side=****".

EDIT: forgot... the name of the unit would be under "Text=***"
« Last Edit: 21 Dec 2004, 23:59:12 by Sophion-Black »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Making THe Player Switch Sides
« Reply #14 on: 22 Dec 2004, 00:10:04 »
except you can't do that in the middle of the game  ;D