Home   Help Search Login Register  

Author Topic: Change Model or Side in Game !  (Read 1596 times)

0 Members and 1 Guest are viewing this topic.

Offline Roni

  • Members
  • *
  • Play the Game !
Change Model or Side in Game !
« on: 17 Feb 2005, 02:38:17 »
Hello All

I think I just discovered a way to change a player's model and or side in game !

I have been working on a script that automatically creates a new group member whenever a group member dies.  Not the simple way, the hard way !  :P

The mission has respawn set to "Group", with each member running a script at start that re-equips them with a standard sidearm and three clips.  The idea is that the player will keep coming back as the next guy in the group, but new group members appear at the black ops camp deep in the desert.

Enuff with the background.  It's taken ages to implement but the end result is one script called newMan.sqs which does the equipping bit while also adding an EH to run a respawn script called respawnRoutine.sqs any time the unit is hit with fatal damage.

It had to be a "Hit" EH and not a "Dammaged" or "Killed" EH as the player's new "body" is actually selected by the game engine once the player is confirmed dead and not at the time of respawn (as I discovered).  :P

The EH script simply creates a new group member for the player to respawn in to BEFORE he is registered as dead.  Kind of neat.

But now the fun begins !

My man was a West black ops Captain and I kept creating West Corporals.  But what if created a new East Major instead ?  Sure enough - a little sidechat message confirmed that the player was now Side "Enemy".  Not perfect, but in my book that qualifies as a change of side !

Now try another trick.  Same EH, same scripts but create a new addAction called "Transmute" or whatever.  The script should black out the screen, create the new unit (opposite side, different type or both), kill the player, delete his body fadeIn.  To be complete you'd also want to take ensure that the payer re-appeared with his old weapons in his new incarnation.

Two caveats - the new unit must have a higher rank than the player (which can be changed back again via script, no ?) and this will cause hell with the players score (again - fixable ?).

Now imagine - you create this script as a "flip flop" - if side player = "West" then goto "convertToEast" and vice versa.

The first scripts are attached, I am still working on the "Transmute" script.  To use, create two West units of any rank so long as they are less than "Major" and one object called camp1.

As soon as you appear, turn and shoot your friend.  A Russian officer should appear and tell you that you are now side Enemy.

Voila !

I am hoping that this is the solution to many of our problems - feedback and comments gratefully accepted.


Roni


EDIT - I just created a version of the Swap Sides script and haven't been able to replicate the above effect.  I went back and tried the original script again and got "Side = Enemy" again then realised that maybe it might be because I keep shooting my own men !  D'Oh !  :-[

I haven't given up hope but I'm not sure this way will work.   :'(

Rats !

« Last Edit: 17 Feb 2005, 08:23:53 by Roni »

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Change Model or Side in Game !
« Reply #1 on: 23 Feb 2005, 07:43:46 »
u should probably make a demo mission to go with it.


Dubieman

  • Guest
Re:Change Model or Side in Game !
« Reply #2 on: 02 Mar 2005, 04:59:17 »
I'm curious, is this done in multiplayer or single player mode?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Change Model or Side in Game !
« Reply #3 on: 03 Mar 2005, 03:33:32 »
Quote
will cause hell with the players score (again - fixable ?).
yep, right at the start, get their score at the start, saved to a varible, then switch them get their core again, subract their score from their score (to get 0) then add the saved previous score, and vwala, back to normal