Home   Help Search Login Register  

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

0 Members and 1 Guest 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

Offline TonyRanger

  • Members
  • *
  • I'm a llama!
Re:Making THe Player Switch Sides
« Reply #15 on: 22 Dec 2004, 08:54:09 »
you can do it like this,first join a high rank enemy,than
[player]join objnull,you can do this in 1 second,then nobody'll notice it ;D

Lean Bear

  • Guest
Re:Making THe Player Switch Sides
« Reply #16 on: 22 Dec 2004, 13:39:28 »
Thanks TriggerHappy! I made a few adjustments to your script cause atm it only works once and to switch to only one side.

So I made a few scripts (although, if they all work, I'll put them all in one and use labels to call them etc.) so that the player can repeatedly join different sides (and, since they all hate eachother, I don't need to change anything else).

I'll let you now if they worked.

Lean Bear

  • Guest
Re:Making THe Player Switch Sides
« Reply #17 on: 22 Dec 2004, 17:04:26 »
OK, after much testing and re-testing, I have discovered a major problem with the scripts; none of them work :P

The original one came up with a load of crap about the first line:

_guy = _this select 0

something like Error: Type Object, Expected Array

I couldn't tell if the rest of the script woked or not. I know it works in-game so I don't understand why it doesn't work in a simple script.

It should be so easy :'(

Mr.Pibb

  • Guest
Re:Making THe Player Switch Sides
« Reply #18 on: 22 Dec 2004, 18:05:33 »
Just to poke into the subject here, are you guys saying that there is a way one can make a player join an enemy side group and then he would be considered freindly to that groups side? Cause I tried that before and it never worked in-game, it did work at startup if I set him in the enemy group initially with the editor tho. In game(at some later point) it would add you(player) to the enemy group, but player was still enemy, in the same group! lol

 Anyhow, was just curious cause this was something I was tryin to do before and quit on it.

Hint to ya Lean Bear, im still learning myself, but if you put down what you have to a 'T', tends to help, then experienced people can identify the problem(changing sides, hmmmm, Triggerhappy, sound familiar? ;D )

Pibb
« Last Edit: 22 Dec 2004, 18:06:16 by Mr.Pibb »

Lean Bear

  • Guest
Re:Making THe Player Switch Sides
« Reply #19 on: 22 Dec 2004, 18:16:18 »
OK, so according to Mr. Pibb, it can't be done. (btw As I was using the same script that TriggerHappy posted but with minor adjustments (names etc.) I didn't think it was necessary to post it again)

But, there is another option (I think). If I were to put one unit from each side on the map in the editor then use these units to join and die with the player....

Would that work?

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Making THe Player Switch Sides
« Reply #20 on: 22 Dec 2004, 18:32:32 »
I refer you to reply #1

Mr.Pibb

  • Guest
Re:Making THe Player Switch Sides
« Reply #21 on: 23 Dec 2004, 00:40:59 »
umm no offense, but I didnt say anything couldnt be done, I was asking if a particular scenario here could be done, which I had failed at doing before.

 Sorry, didnt mean to poke into the topic here, was just curious if I had missed something in my testing. And shoulda looked more closely at the topic before saying to put up more info, my bad. Just used to myself putting up every detail I can when I post a problem, but its not always neccessary, so sorry bout that, back to modding :)

 :)

Pibb
« Last Edit: 23 Dec 2004, 00:45:07 by Mr.Pibb »

Lean Bear

  • Guest
Re:Making THe Player Switch Sides
« Reply #22 on: 23 Dec 2004, 12:34:35 »
ok, np Pibb.

I am beginning to see myself that this could be difficult to do, as so far there has been no porgress. :P

I'll add a different twist now: how about if there was a tolerence bar for each of the sides (I could quickly whip up some graphics).

I was thinking of using the rating thing (or something like that) so that when a sides tolerence drops below, say, 40% , then they will try to kill you. But above that then they don't try anything (maybe use setCaptive?).

Would this be possible?


Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Making THe Player Switch Sides
« Reply #23 on: 23 Dec 2004, 14:01:53 »
I love your tenacity

Lean Bear

  • Guest
Re:Making THe Player Switch Sides
« Reply #24 on: 23 Dec 2004, 14:21:52 »
I love your tenacity

Good, otherwise we'd never het anywhere ;D

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Making THe Player Switch Sides
« Reply #25 on: 23 Dec 2004, 18:22:43 »
in your mission, you're using all 4 sides correct?
if so , addrating and setcaptive won't do the trick
it will make him "allied" to the other 3 sides and against his original

Lean Bear

  • Guest
Re:Making THe Player Switch Sides
« Reply #26 on: 23 Dec 2004, 19:46:38 »
But surely if the player started shooting the "allied" sides, then he wouldn't be allied to him anymore?

Also, how does addRating work anyway?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Making THe Player Switch Sides
« Reply #27 on: 23 Dec 2004, 20:43:06 »
basically addrating is used to change how much the players buddies like him
if his rating drops a lot, they're gonna try and kill him, then when it goes up, they like him a lot
the reason it won't work for 4 teams is that you can't be captive to just 1 side, its all your enemies, so the workaround if there were 2 side would be when he changes sides setcaptive him and addrating -10000000
so his enemy won't fight him and his friends will, so it can't work with 4 sides

Lean Bear

  • Guest
Re:Making THe Player Switch Sides
« Reply #28 on: 23 Dec 2004, 20:48:10 »
But if the players rating is, as you say, set to about -10000000, then all the sides will hate him, right? even. his. allies.

OK I see the problem.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Making THe Player Switch Sides
« Reply #29 on: 23 Dec 2004, 20:57:15 »
no no.
his "allies" wouldn't actually be allies
here is what was proposed
set his rating low and set him captive
lets say he is west
you take down his rating:other westies try to kill him
you set him captive: all his enemies don't care about him
so: he will be fighting only west and the other sides will basically ignore him, that is why it won't work with 4 sides
2, on the other hand, will work fine

Lean Bear

  • Guest
Re:Making The Player Switch Sides
« Reply #30 on: 23 Dec 2004, 21:33:39 »
Instead of maknig other isdes hate you, is there a way for other sides to like you (with 4 sides though)?

Cause if you setCaptive the player, then addRating (say +100000) so that his enemies will like him (or tolerate him //whatever) then, when the player shoots at any of the sides they will all try to kill him.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Making THe Player Switch Sides
« Reply #31 on: 23 Dec 2004, 21:48:22 »
if he shot any of his enemies i think he loses captive status (don't quote me on this)
with an extra 100000000 rating he could eat his team and they wouldn't care

Mr.Pibb

  • Guest
Re:Making THe Player Switch Sides
« Reply #32 on: 25 Dec 2004, 05:15:35 »
Interested to hear results on that, if setCaptive on a renegade rating player would only stop enemy sides from attackin I may be able to use that too ;D

Sadly I'm stuck with finishing my last dam mission for my mod in GR so I can say I finished what I started, I'll be back to this soon, after gettin into the scripting with ofp GR will be old news for good real soon. ::)

« Last Edit: 26 Dec 2004, 05:01:50 by Mr.Pibb »