Home   Help Search Login Register  

Author Topic: Respawn in SP, is it possible?  (Read 836 times)

0 Members and 5 Guests are viewing this topic.

zeev

  • Guest
Respawn in SP, is it possible?
« on: 18 Jun 2004, 08:26:53 »
Hello. Im working on a single player map, and i need respawn script for a player. If it possible, please help me writing this script. Thanks.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Respawn in SP, is it possible?
« Reply #1 on: 18 Jun 2004, 12:57:16 »
I'm 99 % sure that is impossible. Sorry. :-\

:beat: *Gets Shot* :beat:

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Respawn in SP, is it possible?
« Reply #2 on: 18 Jun 2004, 14:26:27 »
Let's say there is 100 topics about this in the forums. 99 of them must say that it's impossible, as I would have said too, but with a quick search I found this thread
http://www.ofpec.com/yabbse/index.php?board=8;action=display;threadid=14853;start=15
There it's said that respawn for player is possible in SP. I haven't tried it so don't ask me anything more.

You can fake AI respawn in SP with a clever createunit spell. There must be topics about that too in the forums.
Cheers.
Not all is lost.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Respawn in SP, is it possible?
« Reply #3 on: 18 Jun 2004, 14:43:09 »
Yeah, why haven't I thought of that before? Although I would recommend using the EH "killed" instead of getdammage in a loop.

:beat. *Gets Shot* :beat:

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Respawn in SP, is it possible?
« Reply #4 on: 18 Jun 2004, 15:10:53 »
I've experimented with this sort of thing for beta testing purposes, although I was making an invincibility script rather than a respawn one.   If you want to make it "foolproof" I'd recommend an eventhandler "killed" and an eventhandler "hit" and a looping script checking damage state.      The problems arise when you get multiple hits or hits from odd things like your own grenade.
Plenty of reviewed ArmA missions for you to play

zeev

  • Guest
Re:Respawn in SP, is it possible?
« Reply #5 on: 18 Jun 2004, 16:01:51 »
I need to disable the "You are dead, retry, end" screen, because there is a 30 sec respawn script built in the mission i want to edit. Is it possible?

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Respawn in SP, is it possible?
« Reply #6 on: 18 Jun 2004, 16:17:24 »
That screen comes when OFP has realised you're dead. In other words, you must make the unit NOT dead before OFP can notice that he was dead at some point. This is exactly what macguba said.

_unit = player
#loop
?getdammage _unit >= 1: titlecut ["","black out",0.000001]; _unit setdammage 0; _unit setpos getmarkerpos "start"
goto "loop"

The above would check if player's damage is 1 or above and if so, it would heal the unit and move him to a marker called start. That script will check the units damage as fast as it can. The question is how fast does OFP check the players condition - pretty fast.

As macguba I've tried these things too, as every "let's-see-if-this-works-ofp-editor" has, and come to the conclusion that sometimes it works and sometimes OFP is just faster than your computer :D
Not all is lost.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Respawn in SP, is it possible?
« Reply #7 on: 18 Jun 2004, 18:19:36 »
Let's be very clear about what's happening here.    Respawn is not possible in SP.    However, it is possible to fake it, as Armsty, Artak and I have suggested.

If you are trying to convert a MP mission to SP, while preserving respawn, one of the things you need to do is throw out the respawn script - as a whole, it's irrelevant.   However, you may be able to salvage and use substantial parts of it in your fake respawn script.

If you want a 30s delay you'll need to decide what the player is going to do for that time.   You may be able to use a specator script.   Alternatively you could setPos the player immediatly to a position 30s run away from the weapon and vehicle depot.
Plenty of reviewed ArmA missions for you to play

DBR_ONIX

  • Guest
Re:Respawn in SP, is it possible?
« Reply #8 on: 19 Jun 2004, 13:36:57 »
Hmm...
What about suppling a modiyed scripts.pbo.. With the Onplayerkilled script... So it doesn't end the mission when he's killed

Dunno

The dead event handler is useless, you can't bring him back to life
The hit one doesn't work if your hit by an explosion, like a grenade or mortar

- Ben

Mr.BoDean

  • Guest
Re:Respawn in SP, is it possible?
« Reply #9 on: 21 Jun 2004, 18:53:12 »
Hmmm, maybe I'm missing something to see what the big difference is between getting complicated with scripting and just making it a MP mission with respawn.  i.e., I've played my MP Respawn mission solo in testing so many times I've lost count.    I'm only using:

Respawn = "INSTANT";
RespawnDelay = 15;

in the description.ext

Plus a line in the weaponsrespawn script which adds random placement to the respawn area.

The other difference might be Intro/outro cutscene, but we all know that can be done internally in the mission, as well.

So what gives?  :-\