Hendricks266, on 17 October 2017 - 08:09 AM, said:
What is that SHOTGUNAMMO variable? I suspect you don't need it.
Thank you for the help. I've got it to work now like this:
gamevar SHOTGUNAMMO 0 1
gamevar choice 0 1
gamevar PWEAPON 0 1
onevent EVENT_TURNAROUND
{
setvar RETURN -1
ifvare PWEAPON 2
{
ifvare choice 0
{
ifvarl SHOTGUNAMMO 10
{
quote 36
break
}
setvar choice 1
sound SELECT_WEAPON
setvar WEAPON2_SHOOTS 1092
setvar WEAPON2_SHOTSPERBURST 10
setvar WEAPON2_FIRESOUND PISTOL_RICOCHET
setvar WEAPON2_FLAGS 17472
quote 34
}
else
{
setvar choice 0
sound SHOTGUN_COCK
setvar WEAPON2_SHOOTS SHOTGUN
setvar WEAPON2_SHOTSPERBURST 7
setvar WEAPON2_FIRESOUND SHOTGUN_FIRE
setvar WEAPON2_FLAGS 1024
quote 35
}
}
}
endevent
onevent EVENT_DOFIRE
{
ifvare PWEAPON 2
{
ifvare choice 1
{
ifvarl SHOTGUNAMMO 10
{
setvar choice 0
sound SHOTGUN_COCK
setvar WEAPON2_SHOOTS SHOTGUN
setvar WEAPON2_SHOTSPERBURST 7
setvar WEAPON2_FIRESOUND SHOTGUN_FIRE
setvar WEAPON2_FLAGS 1024
quote 40
}
}
}
}
endevent
I think I need the var SHOTGUNAMMO inorder to keep track of current ammo of the shotgun?. Can I do it without the var and without causing an out-of-sync error? I've btw also managed to get rid of the out-of-sync thing - I still don't see the big difference between using a var like I do to keep track of the players current weapon and a call to currentweapon, which was what caused it..

Help
Duke4.net
DNF #1
Duke 3D #1


