STEAM GROUP
Left 4 Dead 2 Workshop Beta L4D2WSB
STEAM GROUP
Left 4 Dead 2 Workshop Beta L4D2WSB
2
IN-GAME
22
ONLINE
Founded
15 October, 2012
Vscript sometimes not working.
In Helm's Deep Reborn a vscript is used to teleport dead players to make the map more fun to play. The vscript was created by The Fish and has worked flawlessly for a long time. Recently the vscript sometimes doesn't work at all, it fails to teleport dead players.

The name of the vscript file is "l4d2_helms_deep_respawnscript.nut" and it is in the VPK with the map. The vscript looks like this:


//Left 4 Dead 2 Helms Deep respawn script by The Fish
teleporterPrefix <- "deadbody_teleporter_";
printl("Helms Deep Reborn Respawn System by The Fish successfully loaded!");
function moveDeadBodies(buttonCaller){
ent <- null;
while(ent = Entities.FindByClassname(ent, "survivor_death_model")){
try{
ent.SetOrigin(Entities.FindByName(null, teleporterPrefix+buttonCaller).GetOrigin());
}catch(error){}
}
}


In the map I have an info_director entity with this output: OnGameplayStart, !self, BeginScript, l4d2_helms_deep_respawnscript, Delay 0.00, Only Once: No.

There are 2 levers in the map which you press and hold your use key to teleport dead players. 1 lever consists of these entites and outputs:
A func_button_timed which sends this output: OnTimeUp, func_rot_button, Press, Delay: 0.00, Only Once: Yes.
The func_rot_button then sends this output: OnPressed, info_director, RunScriptCode, DirectorScript.MapScript.LocalScript.moveDeadBodies(1), Delay 0.00, Only Once: Yes.
and then there's a nearby info_target entity named deadbody_teleporter_1 where the dead players get teleported to.


So the question is why doesn't this setup work 100% anymore? About 1 out of 15 games dead players fail to teleport. I have only experienced this issue when playing the map on Official dedicated servers. Other players say they have experienced this issue when playing on third party dedicated servers. No one has experienced this issue on local servers (if you choose local server in the lobby before starting the map).
< >
Showing 1-6 of 6 comments
Fish 9 Mar, 2013 @ 10:27pm 
There may be an error. It won't show it though because I added a catch with no body.

Where it says catch(error){}

Change to: catch(error){printl(error);}

That will print errors to the console.
Fish 9 Mar, 2013 @ 10:29pm 
In fact, no. There wont be, forgot you said the "Helms Deep Reborn Respawn System by The Fish successfully loaded!" never showed up. That should always show up.
SeriouS_Samurai 9 Mar, 2013 @ 10:40pm 
"Helms Deep Reborn Respawn System by The Fish successfully loaded!" doesn't appear in the console when joining or restarting the map on official- or third party dedicated servers. It only appears in console if I host my own local server.

I just played on an official server and "Helms Deep Reborn Respawn System by The Fish successfully loaded!" didn't appear in console but the respawn lever worked fine and successfully teleported the dead bodies. But then as i've said, about 1 out of 15 games the bodies don't get teleported at all.
Fish 10 Mar, 2013 @ 5:54am 
Ah, as far as I'm aware printl (the command I use) only appears in the servers console. I think msg is the command to broadcast one.
Rectus 11 Mar, 2013 @ 7:06am 
Is there any particular reason it's run as a director script? If you're using other director scripts this one could get overwritten.

You could launch it with a logic_script, and make the function global
(so you can access the function, I'm not sure if there are better ways) with this in the script:
::moveDeadBodies <- moveDeadBodies
Then call it the same way, exept with only moveDeadBodies(1).
Last edited by Rectus; 11 Mar, 2013 @ 7:08am
SeriouS_Samurai 11 Mar, 2013 @ 11:42am 
There's no particular reason why the director is in charge of it, but I am not using other scripts and i'm not using EndScript input. Either way I will have to do some changes. Thank you, Rectus.
< >
Showing 1-6 of 6 comments
Per page: 1530 50