UGX-Mods

Call of Duty 5: World at War => Tutorial Desk => Scripting => Topic started by: steviewonder87 on June 15, 2016, 10:14:30 pm

Title: Remove/adjust burst fire delay (solo/host only)
Post by: steviewonder87 on June 15, 2016, 10:14:30 pm
Made this little script to remove/adjust the burst fire delay in WAW (think it's default 0.2 secs on all burst weapons in WAW), this allows you to shoot burst fire guns (e.g. Ray Gun Mk2) with no delay between bursts so it's almost like full auto (as in BO2).

Originally posted this as a reply but thought I might as well release it here so more people can see it/use it. :)

Code Snippet
Plaintext
burst()
{
while(1)
{
currentweapon = self GetCurrentWeapon();
if( ( currentweapon == "ray_gun_mark2" || currentweapon == "ray_gun_mark2_upgraded" || currentweapon == "chicom_mp" || currentweapon == "chicom_mp_upgraded" ) )
{
 self setClientDvar( "player_burstFireCooldown", 0);
}
else if( ( currentweapon == "fnfal_mp_upgraded" ) )
{
  self setClientDvar( "player_burstFireCooldown", 0.2);
}
else
self setClientDvar( "player_burstFireCooldown", 0.1);
wait .1;
}
}


Change the weapon names and timers as you wish, and paste this wherever you like (mine is at the bottom of my mapname.gsc)  and call it anywhere you like (mine is in mapname.gsc at the bottom of Function Calls Pre-Load, under maps\_zombiemode::main(); )

Code Snippet
Plaintext
 
players = get_players();
for(i=0;i<players.size;i++)
{

players[i] thread burst();

        }

So it should look something like this -

Code Snippet
Plaintext
 
        /*--------------------
FUNCTION CALLS - PRE _Load
----------------------*/
level thread DLC3_threadCalls();

/*--------------------
ZOMBIE MODE
----------------------*/
[[level.DLC3.weapons]]();
[[level.DLC3.powerUps]]();

maps\_zombiemode::main();


players = get_players();
        for(i=0;i<players.size;i++)
{

players[i] thread burst();

        }

/*--------------------
FUNCTION CALLS - POST _Load
----------------------*/
Title: Re: Remove/adjust burst fire delay
Post by: DidUknowiPwn on June 15, 2016, 10:52:46 pm
Again this is controlled by the server.

If non-host has 0 on dvar it'll look like it is but it won't be the same for the host.
Title: Re: Remove/adjust burst fire delay
Post by: steviewonder87 on June 16, 2016, 12:45:44 am
Again this is controlled by the server.

If non-host has 0 on dvar it'll look like it is but it won't be the same for the host.

Come again? You mean it only affects the host or what? I don't get what you mean by 'it'll look like it is'.
Title: Re: Remove/adjust burst fire delay
Post by: DidUknowiPwn on June 16, 2016, 01:02:04 am
Come again? You mean it only affects the host or what? I don't get what you mean by 'it'll look like it is'.

This dvar is only affected by the host. You can see the effect done client-side but viewport shit and the like isn't handled by the client it's handled by the server.
Title: Re: Remove/adjust burst fire delay
Post by: DidUknowiPwn on June 16, 2016, 03:08:50 am
you script now?  :gusta:
it's impossible to get this to work both sides properly  :please:
Title: Re: Remove/adjust burst fire delay
Post by: steviewonder87 on June 16, 2016, 03:27:40 am
I dont care if it doesnt work properly. I am just happy to see someone as talented as stevie take up yet another skill in modding.

Lol this isn't really 'scripting', I just found this dvar and made this ages ago and used my brain to copy and paste a similar function to get the dvar to work as I wanted.

DUKIP had to go and ruin it though. :'( Works fine in solo anyway and won't have any negative effects in co-op so fuck it. People add D2P which is broken AF in co-op and they don't mind. :P
Title: Re: Remove/adjust burst fire delay
Post by: DidUknowiPwn on June 16, 2016, 03:31:41 am
Lol this isn't really 'scripting', I just found this dvar and made this ages ago and used my brain to copy and paste a similar function to get the dvar to work as I wanted.

DUKIP had to go and ruin it though. :'( Works fine in solo anyway and won't have any negative effects in co-op so fuck it. People add D2P which is broken AF in co-op and they don't mind. :P

Dude it won't work in co-op as this dvar is only useful on the host.

Host -> player1 -> your cool down time = 1
player1 -> nah fuck you it's 0 -> host
host -> lolurfunnykid -> player1 -> your cool down time will always be 1
Edit:
What will happen in game:

Shoot -> settle -> broken anim plays if you try to shoot (doesn't actually send a bullet) -> waits until burst is available -> shoots
repeat.
Title: Re: Remove/adjust burst fire delay
Post by: steviewonder87 on June 16, 2016, 03:53:09 am
Dude it won't work in co-op as this dvar is only useful on the host.

Host -> player1 -> your cool down time = 1
player1 -> nah fuck you it's 0 -> host
host -> lolurfunnykid -> player1 -> your cool down time will always be 1
Edit:
What will happen in game:

Shoot -> settle -> broken anim plays if you try to shoot (doesn't actually send a bullet) -> waits until burst is available -> shoots
repeat.

Lol this has been in both my maps for months and nothing 'broken' happens at all. All it's gonna do is have clients have the default burst cooldown of 0.2 secs which they would have anyway with or without this script.

If you want to see 'broken' stuff for clients check out any map with D2P in it.
Title: Re: Remove/adjust burst fire delay
Post by: DidUknowiPwn on June 16, 2016, 03:57:39 am
Lol this has been in both my maps for months and nothing 'broken' happens at all. All it's gonna do is have clients have the default burst cooldown of 0.2 secs which they would have anyway with or without this script.

If you want to see 'broken' stuff for clients check out any map with D2P in it.

do you not understand that if the client has a modified player_ (along with a bunch of others) dvar the host will ignore it?

This is to prevent cheating you go try it in a public game and let me know.
Title: Re: Remove/adjust burst fire delay
Post by: steviewonder87 on June 16, 2016, 04:03:26 am
do you not understand that if the client has a modified player_ (along with a bunch of others) dvar the host will ignore it?

This is to prevent cheating you go try it in a public game and let me know.

Why would the host care if the clients have 0.2 secs burst fire cooldown or 0.1 secs cooldown lol? Like I said, for like the 3rd time, if the host ignores it THEY WILL STILL HAVE THE DEFAULT 0.2 SECS COOLDOWN - THE SAME AS IF THE SCRIPT IS THERE OR NOT. It doesn't affect anything negatively. This is hardly a game changing DVAR lol, we're talking about 10th of seconds difference on a burst delay here, not setting player health or something that actually impacts on the game or is important. :poker:
Title: Re: Remove/adjust burst fire delay
Post by: daedra descent on June 16, 2016, 04:37:05 am

Why would the host care if the clients have 0.2 secs burst fire cooldown or 0.1 secs cooldown lol? Like I said, for like the 3rd time, if the host ignores it THEY WILL STILL HAVE THE DEFAULT 0.2 SECS COOLDOWN - THE SAME AS IF THE SCRIPT IS THERE OR NOT. It doesn't affect anything negatively. This is hardly a game changing DVAR lol, we're talking about 10th of seconds difference on a burst delay here, not setting player health or something that actually impacts on the game or is important. :poker:


I think what he's trying to say is:


In COOP the host(server) > clients(other players). All settings are synced with the server and any changes made to the client's dvar don't do anything that actually impacts the game. This is why using cheats like godmode in servers with cheats disabled won't work(same applies to this).



Title: Re: Remove/adjust burst fire delay
Post by: steviewonder87 on June 16, 2016, 04:54:38 am

I think what he's trying to say is:


In COOP the host(server) > clients(other players). All settings are synced with the server and any changes made to the client's dvar don't do anything that actually impacts the game. This is why using cheats like godmode in servers with cheats disabled won't work(same applies to this).





So again for the umpteenth time, this won't do anything (positive OR negative in co-op) it will be ignored, I got that like 10 posts ago idk why you guys keep repeating it over and over lol. Clients will have 0.2 secs as standard. That is the same with or without this script. It's not 'breaking' anything or doing anything bad lol. And, again, even if it was, we're talking about .1 of a second, on a delay on a burst fire weapon; I think you guys are severely overestimating what this dvar does lol.

It does however work perfectly in solo or if you are host.

And Bam's laser Deadshot and Staminup uses the exact same method as this script (setting a couple dvars exactly the same way - I think I used it as the basis for this script actually) and that obviously works for clients, so idk what you mean. I was always under the impression that some dvars were gamewide and others were host only. And you can enable cheats in co-op anyway (e.g. god mode) if you want, so what's the difference here?
Title: Re: Remove/adjust burst fire delay
Post by: DidUknowiPwn on June 16, 2016, 05:28:24 am
The way this post/script is set up makes it sound like it works on all. Nobody would give a rat's ass if it only works on host but because it doesn't apply to non-host and you saying it doesn't matter but the post makes it assume it does irritates me.

As it obviously doesn't work as intended for normal scenarios.
Title: Re: Remove/adjust burst fire delay
Post by: treminaor on June 16, 2016, 05:35:46 am
yeah at least I would specify in the OP that this will only help the host and/or people playing solo. The dvar for clients is read from the host value, so no matter what the client value is set to in-game (even if they set it from their own console or you set it for them via GSC/CSC), it will read from the initial host value for cheat protection.
Title: Re: Remove/adjust burst fire delay
Post by: steviewonder87 on June 16, 2016, 05:42:54 am
The way this post/script is set up makes it sound like it works on all. Nobody would give a rat's ass if it only works on host but because it doesn't apply to non-host and you saying it doesn't matter but the post makes it assume it does irritates me.

As it obviously doesn't work as intended for normal scenarios.

Well obviously when I posted it I wasn't aware it was host only, I'm sorry that irritated you so much. ;D

I'm still not sure why you say it's going to 'break' stuff when you also say it's doing nothing, it's either one or the other surely? But anywho.

yeah at least I would specify in the OP that this will only help the host and/or people playing solo. The dvar for clients is read from the host value, so no matter what the client value is set to in-game (even if they set it from their own console or you set it for them via GSC/CSC), it will read from the initial host value for cheat protection.

And if co-op cheats are enabled?




Title: Re: Remove/adjust burst fire delay
Post by: treminaor on June 16, 2016, 06:02:35 am
And if co-op cheats are enabled?
I don't think it matters. It's considered read-only for clients.