Zandronum Chat on our Discord Server Get the latest version: 3.2
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002849Zandronum[All Projects] Bugpublic2016-10-02 20:362017-02-07 18:06
Reporterfr-blood 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformMicrosoftOSWindowsOS VersionXP/Vista/7
Product Version3.0-beta 
Target Version3.0Fixed in Version 
Summary0002849: Something wrong with SetWeapon() online.
DescriptionHellow, so in my project I've added a custom hotkey and when the player press it, a script will select a "handgrenade" weapon, launch the grenade then get try to get the old weapon that the player had before using the grenade.

I managed to make it works, but here the problem is that the grenade is not spawned online, all the weapon animation will be here the ammo will be used but the grenade won't be launched.
Additional InformationHere is a video link when you can see the result online and then offline.

'https://www.youtube.com/watch?v=6_xzkfzrq4c&feature=youtu.be [^]'

And some informations about the hotkey and the script.

In MENUDEF: 'Control "Launch Grenade", "Puke -150 1"'
In ACS:
'{// Hot Keys Actions
str OldWeapon0 = GetWeapon();
else if(Typ == 1 && CheckInventory("Busy") == 0 && ACS_NamedExecuteWithResult("Mech Check",0,0,0,0) == 0)
{// Launch Grenade
    if(CheckInventory("FragGrenadeAmmo") > 0 && CheckInventory("SelectedFragGrenade") == 1 && SpecialWeapon() == FALSE)
    {
        GiveInventory("HandFragGrenade",1);SetWeapon("HandFragGrenade");GiveInventory("Busy",1);
        while(CheckInventory("Busy") == 1)delay(1);SetWeapon(OldWeapon0);
    }
    else if(CheckInventory("FlashBangAmmo") > 0 && CheckInventory("SelectedFlashBang") == 1 && SpecialWeapon() == FALSE)
    {
        GiveInventory("HandFlashBang",1);SetWeapon("HandFlashBang");GiveInventory("Busy",1);
        while(CheckInventory("Busy") == 1)delay(1);SetWeapon(OldWeapon0);
    }
    else if(CheckInventory("PlasmaGrenadeAmmo") > 0 && CheckInventory("SelectedPlasmaGrenade") == 1 && SpecialWeapon() == FALSE)
    {
        GiveInventory("HandPlasmaGrenade",1);SetWeapon("HandPlasmaGrenade");GiveInventory("Busy",1);
        while(CheckInventory("Busy") == 1)delay(1);SetWeapon(OldWeapon0);
    }
    else if(CheckInventory("FlyingGrenadeAmmo") > 0 && CheckInventory("SelectedFlyingGrenade") == 1 && SpecialWeapon() == FALSE)
    {
        GiveInventory("HandFlyingGrenade",1);SetWeapon("HandFlyingGrenade");GiveInventory("Busy",1);
        while(CheckInventory("Busy") == 1)delay(1);SetWeapon(OldWeapon0);
    }
    else if(CheckInventory("BouncingBettyAmmo") > 0 && CheckInventory("SelectedBettyMine") == 1 && SpecialWeapon() == FALSE)
    {
        GiveInventory("HandBouncingBetty",1);SetWeapon("HandBouncingBetty");GiveInventory("Busy",1);
        while(CheckInventory("Busy") == 1)delay(1);SetWeapon(OldWeapon0);
    }
    else if(CheckInventory("IncendiaryGrenadeAmmo") > 0 && CheckInventory("SelectedIncendiaryGrenade") == 1 && SpecialWeapon() == FALSE)
    {
        GiveInventory("HandIncendiaryGrenade",1);SetWeapon("HandIncendiaryGrenade");GiveInventory("Busy",1);
        while(CheckInventory("Busy") == 1)delay(1);SetWeapon(OldWeapon0);
    }
    else if(CheckInventory("TimedGrenadeAmmo") > 0 && CheckInventory("SelectedTimedGrenade") == 1 && SpecialWeapon() == FALSE)
    {
        GiveInventory("HandTimedGrenade",1);SetWeapon("HandTimedGrenade");GiveInventory("Busy",1);
        while(CheckInventory("Busy") == 1)delay(1);SetWeapon(OldWeapon0);
    }
}
}'
Attached Files? file icon setweapontest.wad [^] (272,593 bytes) 2016-10-04 09:44
? file icon hotkeyinventorytest.pk3 [^] (4,015 bytes) 2017-02-06 17:59

- Relationships

-  Notes
User avatar (0015737)
Edward-san (developer)
2016-10-02 20:40

We can't help without a minimal example wad.
User avatar (0015739)
fr-blood (reporter)
2016-10-03 04:10

I can give you my project:'https://www.dropbox.com/s/4quy7403zylvl55/afterdoom.pk3?dl=0 [^]'

The script is number 150 inside PART1.acs.

You just have set the custom controls in "After Doom Options", then launch a grenade both offline and online to see the difference.
User avatar (0015744)
Torr Samaho (administrator)
2016-10-03 14:06

Please try to boil this down to a minimal example wad.
User avatar (0015752)
fr-blood (reporter)
2016-10-04 09:48

I've managed to copy past the important part of the code, but here it is somehow working online, I really don't know from where is the problem then.

But you got the idea here:
Set a key for the bomb in custom controls
start a map you've got an assault rifle, then press the key and the player will launch an imp ball which will work both online and offline here.

In After Doom the scripts are the same, the player is able to make a lots of actions that way but here only the weapon animation will work the sound too, but nothing from A_CustomMissile or A_SpawnItemEx.
User avatar (0015757)
Torr Samaho (administrator)
2016-10-04 18:22

Quote from fr-blood

I've managed to copy past the important part of the code, but here it is somehow working online, I really don't know from where is the problem then.

This indicates that the problem is something else. Without a minimal example wad it's not really feasible for us to debug this. One way to create the minimal example is to remove things from your wad till the problem disappears.
User avatar (0016747)
fr-blood (reporter)
2017-02-01 22:17

Well it looks like that the problem is not from SetWeapon() finaly.

It's something else, any action coming from my custom hotkeys doesn't really work online(the grenade won't spawn, or a powerup won't be given when it's supposed to).
User avatar (0016753)
Torr Samaho (administrator)
2017-02-05 14:15

Any idea what could be the problem? Unfortunately, I have not enough information to fix this yet.
User avatar (0016782)
fr-blood (reporter)
2017-02-06 17:58

I've tried many times to make a smaller .pk3 deleting all the stuff which wasn't included in the script in my opinion but without succes, each time it's working fine both online/offline.

I've tested my project by setting the special hotkeys from KEYCONF then MENUDEF and in the both situation the bug happen online. So I guess the problem is not from the custom hotkey option.

I'm still uploading the last test wad that I created it has normaly all the script included in the special actions.
User avatar (0016812)
fr-blood (reporter)
2017-02-07 12:57

Alright I found the problem it wasn't SetWeapon() or anything else.
It happened because of ZACompatFlags: CLient Side Scripts (NET) [1].
So we can't tell that it's a bug but a big mistake made by me.

The ticked can be closed.

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2016-10-02 20:36 fr-blood New Issue
2016-10-02 20:40 Edward-san Note Added: 0015737
2016-10-02 20:40 Edward-san Status new => feedback
2016-10-03 04:10 fr-blood Note Added: 0015739
2016-10-03 04:10 fr-blood Status feedback => new
2016-10-03 14:06 Torr Samaho Note Added: 0015744
2016-10-04 09:44 fr-blood File Added: setweapontest.wad
2016-10-04 09:48 fr-blood Note Added: 0015752
2016-10-04 18:22 Torr Samaho Note Added: 0015757
2016-11-29 20:39 Torr Samaho Status new => feedback
2016-12-24 22:41 Dusk Target Version => 3.0
2017-02-01 22:17 fr-blood Note Added: 0016747
2017-02-01 22:17 fr-blood Status feedback => new
2017-02-05 14:15 Torr Samaho Note Added: 0016753
2017-02-05 14:16 Torr Samaho Status new => feedback
2017-02-06 17:58 fr-blood Note Added: 0016782
2017-02-06 17:58 fr-blood Status feedback => new
2017-02-06 17:59 fr-blood File Added: hotkeyinventorytest.pk3
2017-02-07 12:57 fr-blood Note Added: 0016812
2017-02-07 18:06 Dusk Status new => closed
2017-02-07 18:06 Dusk Resolution open => no change required






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker