Home   Help Search Login Register  

Author Topic: Respawn in SP  (Read 1950 times)

0 Members and 1 Guest are viewing this topic.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Respawn in SP
« on: 13 Mar 2004, 08:26:29 »
Is it possible to have a respawn in single player?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

MGeo

  • Guest
Re:Respawn in SP
« Reply #1 on: 13 Mar 2004, 09:14:11 »
No. I think it is not possible. I tried to do something like that but it doesn't work. Only in multiplayer. Maybe there is a script for this but i am not sure it will be possible.

DBR_ONIX

  • Guest
Re:Respawn in SP
« Reply #2 on: 13 Mar 2004, 10:52:25 »
It is possible!
If you download Castle Ruins (ofp.info news achive I think.. Search should find it)
I de-pbo-ed it.. And theres file called respawn_z1.sqs

I'll look in to later..
- Ben

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Respawn in SP
« Reply #3 on: 13 Mar 2004, 11:41:29 »
If you want to respawn in single player, you make the mission as a multiplayer mission, allow only one possible position to choose and tell people that while the mission is in the multiplayer missions menu, its only for one person.

You cant respawn in regular single player.

Offline Maddmatt

  • Members
  • *
Re:Respawn in SP
« Reply #4 on: 13 Mar 2004, 11:44:48 »
I once managed to do an sp respawn, but after you respawn nothing happens when you press escape and enemies dont seem to attack you. You have normal control over your character but the only way to exit the game then is by ALT+F4.
http://bushfires.org/
African Conflict Mod
Mission editor and scripter

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Respawn in SP
« Reply #5 on: 13 Mar 2004, 12:16:50 »
"Respawn" in SP is possible but highly unreliable. Basicly, what you want to do is to either have a script detect when the player is killed, then heal and setpos him or use eventhandler to lauch a script which does the same. The whole process must be done in a flash; before ofp notices that the player has been killed.. I assume we're talking about < 0.5 seconds.
Anywho, as said there's a high propability of the player becoming a vegetable. The script could look something like this.


;SPrespawn.sqs
;SP respawn test
;place a marker on the map and name it as 'start'
;place a trigger with condition true and on activation: [] exec "SPrespawn.sqs"

#start
@!alive player
titlecut ["aww crap","Black Out",0.000001]
player setdammage 0
player setpos getmarkerpos "start"
~3
titlecut ["respawn respawn..","Black In",5]
goto "start"
Not all is lost.

DBR_ONIX

  • Guest
Re:Respawn in SP
« Reply #6 on: 13 Mar 2004, 20:53:11 »
You can use this addeventhandler ["hit","setpos this getpos respawn; this setdammage 0"]
But if you get hit by a small round.. You still respawn..
The dead respawn doesn't work, it just moves a corpse around (setdammage mustn't work after the player is dead or something)

The export it as mutliplayer thing would work perfectly.. It's just not ideal..
In the readme for that, tell them to host a LAN game, load the mission and drag there name on to it..

Only things are you don't get savegames in multiplayer.. But if you respawn, that shouldn't be a prob..

- Ben

Tactician

  • Guest
Re:Respawn in SP
« Reply #7 on: 14 Mar 2004, 10:09:36 »
It might be more reliable to use Artak's script (I assume it works sometimes?) and change the @ to a very fast loop, maybe even a loop without delay (although I've never used loops without delays and can't claim to know how they work).

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Respawn in SP
« Reply #8 on: 14 Mar 2004, 13:25:07 »
They cycle every frame.

DBR_ONIX

  • Guest
Re:Respawn in SP
« Reply #9 on: 14 Mar 2004, 15:04:14 »
And they do a pretty good job of screwing up the game by crashing it :P

The castle ruins II script is basicly:
A trigger that if the players dammage, the script sets playerdead to true or 1
And a looping script with a 0.01 delay, that checks if the playerdead is true
Then playmoves "combattodying"
Then setpos's the player to a coord and setdammage's them to 0

It seems to work okay.. I didn't get a You Are Dead screen, even though I got killed a few times

- Ben

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Respawn in SP
« Reply #10 on: 17 Mar 2004, 18:05:36 »
What about respawning as the next in command as part of a team?
Surely if it's possible in MP, the scripting or whatever can be switched to SP play.
« Last Edit: 17 Mar 2004, 18:06:35 by The-Architect »
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."