STEAM GROUP
Left 4 Dead 2 Workshop Beta L4D2WSB
STEAM GROUP
Left 4 Dead 2 Workshop Beta L4D2WSB
3
IN-GAME
35
ONLINE
Founded
15 October, 2012
shotgunefx 3 Jun, 2013 @ 7:57pm
Problem with PickupObject crashing to desktop
Just doing some testing and in a simple non-mutation mode map, I'm having issues with PickupObject.

As a simple test, I have this code.
// test model is models/props_misc/tea_pot-1.mdl local sv = Entities.FindByName(null,"!nick"); local item = Entities.FindByName(null,"pickup"); printl(sv+" picking up "+item); PickupObject(sv,item);

Now for the prop_physics and prop_physics_multiplayer I've tried, (unchecking generate output on +USE as the wiki suggests), this simple causes a crash to desktop.

If I mark the flag to Force Serverside, the script executes and nothing happens.

If I set it to a normal carryable like Gnome, it doesn't crash either way, but still won't pick it up.

Is there something I'm missing here?
< >
Showing 1-11 of 11 comments
Rectus 4 Jun, 2013 @ 3:11am 
Apparently you also need g_ModeScript::CanPickupObject(object) set up right. I only got it working after overriding CanPickupObject after the mode script has been run (setting it to run on an entity in hammer does not work). Also it only works if there is an actual mode script file, I created one for coop, and it worked.
shotgunefx 4 Jun, 2013 @ 6:37am 
Thanks for the info. I tried just adding it to g_ModeScript and g_MapScript with no luck. Really too bad. This should work for custom campaigns as well.
Rectus 4 Jun, 2013 @ 7:31am 
I did some further testing. It seems to only hook the CanPickupObject function if it's there when the mode script first loads. Afterwards it's possible to replace the contents with anything you want. Putting a placeholder function in coop.nut works for me, but it doesn't feel very portable.

I really wanted to use this feature in my campaign, so I hope Valve improves it.
Last edited by Rectus; 4 Jun, 2013 @ 7:31am
shotgunefx 4 Jun, 2013 @ 7:45am 
Me too
shotgunefx 4 Jun, 2013 @ 8:32am 
And even in mutation mode, it only seems to work with certain things, Gnome yes, teakettle no. Am I missing something?
Rectus 4 Jun, 2013 @ 9:44am 
It probably won't work on props set up as client side or debris, since the vscripts are run on the server. Not sure if the "force serverside" option helps though. At least it's possible to pick up big things, like cars and dumpsters.
shotgunefx 4 Jun, 2013 @ 9:59am 
That's what I figured, I'm sure it's user error.
Neil - 119 4 Jun, 2013 @ 10:13am 
Forcing serverside won't network the changes to the entity state. Did you set the ent data for your model before compiling the QC?
Rectus 4 Jun, 2013 @ 10:55am 
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=150498358
I made a little test mutation that allows you to pull objects toward you, and then throw them, WITH YOUR MIND!
Neil - 119 4 Jun, 2013 @ 1:32pm 
Now that's pretty awesome. Would you be able to add that to VSLib? If not, do you mind if I do?
shotgunefx 4 Jun, 2013 @ 6:59pm 
Very nice Rectus! Luke, do you know what's supposed to be in Keyvalues in the QC?
< >
Showing 1-11 of 11 comments
Per page: 1530 50