MP - weaponbehaviour + Movement in SP Created 8 years ago2016-02-16 15:00:48 UTC by Alles_Ratten Alles_Ratten

Created 8 years ago2016-02-16 15:00:48 UTC by Alles_Ratten Alles_Ratten

Posted 8 years ago2016-02-16 15:00:48 UTC Post #328902
Hello again,
for my singleplayermodification I would like to use the whole movementsystem and weaponbehaviour from Half-Life's Multiplayer.

Now I am not a real programmer and also I never saw c++ before :/
Does anyone have an Idea what the easiest way to implement that would be?

Things I thought of:
1: change the code for every weapon manualy whenever it asks if it is multiplayer or not. I tried that with the crossbow but had no full success.

Instead of normal bolts with airtime i now have explosive bolts outside the zoom and the instant shots (sniperbolts) when inside the zoom.
Sounds like multiplayerbehavior so far,
however it wont show the bolt (at the target) when fired from zoom (only damage applies[with blood])
When I shoot without zoom and hit a monster it wont make an explosion, but make a normal singleplayerhit.
So I obviously still missed something somewhere :/

2. Changing the gamerules in Singleplayer to Multiplayer
I saw that there are different booleans: "bisMultiplayer" and "g_pGameRules->IsMultiplayer()"

Do you think changing the gamerules to multiplayer would also disable monsterspawn and such? Or might those things still work cause the other boolean "bisMultiplayer" will still always be false.

I would be very grateful for any ideas or if anyone in particular would help me some with the code in general (i don't want to change so much actually)
Posted 8 years ago2016-02-16 16:29:56 UTC Post #328903
Like you said, you will have to remove all the conditions related to multiplayer (the famous "if ( g_pGameRules->IsMultiplayer() )") and keep the "multiplayer part" of the code.
Posted 8 years ago2016-02-16 20:31:20 UTC Post #328904
Thats what I did and im quite certain that I didnt change anything else but my shot from zoom is still not creating a bolt or its sound...

I'll probably recreate the situation from scratch by time and test if the problem occurs again :/

Does anyone know where the speedcap (bhop) is saved?
Posted 8 years ago2016-02-16 20:57:44 UTC Post #328905
In the "pm_shared.c" file, check for something called "PM_PreventMegaBunnyJumping();", can't remember the exact name but it's something like that.
Posted 8 years ago2016-02-16 21:06:10 UTC Post #328906
nice, i changed that
yet one more thing to say about my crossbow... it also pushes the cameraangle up inside the zoom when firing. (doesnt do so in mp)

i have the feeling that something outside the crossbow.cpp is beeing called but I guess my main question was if i have to fix it for each weapon manually

so that seems to be the case
Posted 8 years ago2016-02-17 00:23:42 UTC Post #328910
Client side - ev_hldm.cpp - EV_FireCrossbow - Check for calls to methods whose name is something like "ViewPunch".
You must be logged in to post a response.