Scripts / Help with respawn script

Author
Message
Mathiasdam
9
Years of Service
User Offline
Joined: 21st Apr 2015
Location:
Posted: 5th Dec 2015 16:01
Hey does anyone know if it's posible when you die to make a timer for like 40 seconds and then make you respawn at another location than where you died ?

On a totally side note when i do lightmapping should i do like f1 and then after f4 or how does it work ?
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 5th Dec 2015 20:18
Quote: "Hey does anyone know if it's posible when you die to make a timer for like 40 seconds and then make you respawn at another location than where you died ? "

with some trickery yes but it'll require a workaround to make it look like the player is still dead (an image over the screen to hide the view and freezing the player and AI so they wont continue to hunt you and to stop you moving around), why would you want the person playing the game to stay dead for 40s though? long respawns in a single player game are kinda weird idea

Quote: "On a totally side note when i do lightmapping should i do like f1 and then after f4 or how does it work ? "

you only need to do 1 mode, which 1 you do is up to you but basically 1 is quickest but doesnt do much, 4 is full bake and offers the best quality (of baked shadows) but takes a long time
personally i stick to real time though
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
Mathiasdam
9
Years of Service
User Offline
Joined: 21st Apr 2015
Location:
Posted: 5th Dec 2015 21:00
Hey i want to make like a simple multiplayer Moba so that's why But how do i make the respawn at another place ? Want to respawn in "graveyard" but start in the town for the game ^^
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 5th Dec 2015 22:32
ah ok well afaik custom scripts dont work in multiplayer yet
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
Mathiasdam
9
Years of Service
User Offline
Joined: 21st Apr 2015
Location:
Posted: 6th Dec 2015 16:28
Do you know then how i can make the spawn happen at another place than the start ?
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 6th Dec 2015 18:11
yes using a dummy object and this script (press e to kill yourself just to show it works - remove the code after testing)
set always active = yes and copy the name of the entity into it's own 'ifused' field
random_player_spawn_location.lua
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
Mathiasdam
9
Years of Service
User Offline
Joined: 21st Apr 2015
Location:
Posted: 7th Dec 2015 00:22
Wow thanks a lot man !
PM
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 8th Dec 2015 08:17
Quote: "yes using a dummy object and this script (press e to kill yourself just to show it works - remove the code after testing)
set always active = yes and copy the name of the entity into it's own 'ifused' field
random_player_spawn_location.lua

"


Another awesome script from smallg, nice work!

Just to clarify, this script send your to a random location on the map when dead right?

What would I change if I wanted to send them to the dummy object instead?
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Dec 2015 08:59
Just remove the line SetPosition().
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 8th Dec 2015 10:06
Ah I see it now, the script uses the entity as a centre point and transports you to a random location based on that point, so removing that line forces it to spawn on the entity, gotcha. hanks again smallg.
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 8th Dec 2015 10:09
Oh, hold on a second, I see two SetPosition lines ...

SetPosition(e,g_PlayerPosX,g_PlayerPosY,g_PlayerPosZ)

and

SetPosition(e,x,y,z)

Which one do I remove? or do I remove both?
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Dec 2015 15:31
Both is fine, if the entity is always active it doesn't really require the setposition(e,playerx,playery,playerz), I just added that to make sure the object stays active if you forget.

The 2nd call, SetPosition (e,x,y,z) is the one that moves it to its randomed location and is the one I was referring to earlier though and would be enough to make it work.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 8th Dec 2015 16:49
That's awesome, thanks smallg. The plan for my own game is to have players respawn outside a church in a graveyard when they die. Just need to work out how to change everything to black and white for say 10 seconds or so after they respawn and i'm golden!

Login to post a reply

Server time is: 2024-12-22 10:44:25
Your offset time is: 2024-12-22 10:44:25