MantisBT - Zandronum
View Issue Details
0000661Zandronum[All Projects] Suggestionpublic2012-01-26 18:082018-09-30 23:07
Minigunner 
 
normalfeatureN/A
closedfixed 
 
2.02.0 
0000661: Backport A_SetArg, as well as the DECORATE user-variable and user-array system
A_SetArg (from ZDoom 2.5.0) allows an actors args, which are already definable via DECORATE, to be altered via DECORATE.

The user variable system (also from ZDoom 2.5.0) is different from the ACS variable system in that it is actor-specific and that the values carry over to and can be set via DECORATE. Same with the user array system. Despite the fact that these are two ZDoom versions ahead of ST, they should be backported as today's mods get more complex and use substantial amounts of ACS and variables.
'http://zdoom.org/wiki/A_SetArg [^]'

'http://zdoom.org/wiki/A_SetUserVar [^]'
'http://zdoom.org/wiki/GetUserVariable [^]'
'http://zdoom.org/wiki/SetUserVariable [^]'

'http://zdoom.org/wiki/A_SetUserArray [^]'
'http://zdoom.org/wiki/GetUserArray [^]'
'http://zdoom.org/wiki/SetUserArray [^]'
Args, Arrays, Variables
child of 0001490closed Torr Samaho Backport ZDoom 2.5.0 
Issue History
2012-01-26 18:08MinigunnerNew Issue
2012-02-19 07:15ZzZomboNote Added: 0002644
2012-07-30 11:40ZzZomboNote Edited: 0002644bug_revision_view_page.php?bugnote_id=2644#r2254
2013-09-09 10:42DuskRelationship addedchild of 0001490
2013-09-09 10:43DuskTarget Version => 2.0
2013-10-24 18:10QentNote Added: 0007460
2013-10-24 18:10QentStatusnew => resolved
2013-10-24 18:10QentFixed in Version => 2.0-beta
2013-10-24 18:10QentResolutionopen => fixed
2013-10-24 18:10QentAssigned To => Qent
2015-01-23 04:55Blzut3Assigned ToQent =>
2015-01-23 04:55Blzut3Fixed in Version2.0-beta => 2.0
2018-09-30 23:07Blzut3Statusresolved => closed

Notes
(0002644)
ZzZombo   
2012-02-19 07:15   
(edited on: 2012-07-30 11:40)
I strongly support this issue, I'm damn currently very limited to use Inventory instead of normal variables.

Since Torr asked me to explain why I need this feature, I do so. I just leave here two examples of my usual work.
actor UACRobot:HumansTeam 30001
{//$Category Infected Horde NPCs
    Obituary "%o was shot down by a UAC Bot."
    Health 3000
    Radius 40
    Height 110
    Mass 3000
    Speed 16
    PainChance 0
    SeeSound "uacbsee"
    AttackSound "chainguy/attack"
    ActiveSound "uacbact"
    DeathSound "dsbarexp"
    DamageType "UACRobotBullet"
    DamageFactor "GunShot",0
    DamageFactor "Melee",0.5
    DamageFactor "UACRobotGrenade",1.7
    DamageFactor "UACRobotStomp",0
    DamageFactor "UACRobotBullet",0.9
    MONSTER
    +NOPAIN
    +NOBLOOD
    +BOSS
    +FLOORCLIP
    +NORADIUSDMG
    +DONTMORPH
    +MISSILEEVENMORE
    +NOTELEPORT
    +NOINFIGHTING
    +NOTIMEFREEZE
    //+DOHARMSPECIES
    //+SEEINVISIBLE
    //-DONTHARMCLASS
    States
    {
        Spawn:
        TNT1 A 0
        TNT1 A 0 A_GiveInventory("UACRobotGrenadeAmmo",50)
        TNT1 A 0 A_GiveInventory("ChaingunAmmo",500)
        Idle:
        UACB G 10 A_Look
        loop
        Idle.NoAmmo:
        UACB A 3 A_Hoof
        UACB A 3 A_Chase("","")
        UACB B 3 A_Metal
        UACB BCC 3 A_Chase("","")
        UACB D 3 A_Hoof
        UACB D 3 A_Chase("","")
        UACB E 3 A_Metal
        UACB EFF 3 A_Chase("","")
        loop
        See:
        UACB A 3 A_Hoof
        UACB A 3 A_Chase
        UACB B 3 A_Metal
        UACB BCC 3 A_Chase
        UACB D 3 A_Hoof
        UACB D 3 A_Chase
        UACB E 3 A_Metal
        UACB EFF 3 A_Chase
        loop
        Missile:
        TNT1 A 0 A_JumpIfInventory("GrenadeAmmo",1,2)
        TNT1 A 0 A_Jump(255,4)
        TNT1 A 0 A_JumpIfCloser(512,2)
        TNT1 A 0 A_Jump(255,2)
        TNT1 A 0 A_Jump(210,"Missile.GrenadeLauncher")
        TNT1 A 0 A_JumpIfInventory("ChaingunAmmo",1,2)
        TNT1 A 0 A_Jump(255,"Idle.NoAmmo")
        Missile.Chaingun:
        UACB G 2 A_FaceTarget
        UACB H 3 bright A_CPosAttack
        TNT1 A 0 A_TakeInventory("ChaingunAmmo",1)
        UACB G 2 A_SpidRefire
        goto Missile
        Missile.GrenadeLauncher:
        UACB G 6 A_FaceTarget
        TNT1 A 0 A_PlaySound("grenpop",CHAN_AUTO)
        UACB IJ 3 A_FaceTarget
        TNT1 A 0 A_PlaySound("gren")
        UACB K 6 bright A_CustomMissile("UACRobotGrenade",106,0,0)
        TNT1 A 0 A_TakeInventory("GrenadeAmmo",1)
        UACB J 6 A_FaceTarget
        TNT1 A 0 A_PlaySound("grenpop",CHAN_AUTO)
        UACB JIG 3 A_FaceTarget
        goto Missile
        Death:
        TNT1 A 0 bright
        UACD K 4 bright A_Scream
        UACD L 4 bright
        UACD MN 4 bright
        UACD O 4 A_NoBlocking
        UACD PQR 4
        UACD S 30
        UACD T 4 bright A_Scream
        UACD UVW 4 bright
        UACD XYZAB 2
        UACD C -1 A_BossDeath
        stop
    }
}
...

With user variables it might look like:
actor UACRobot:HumansTeam 30001
{//$Category Infected Horde NPCs
    Obituary "%o was shot down by a UAC Bot."
    Health 3000
    Radius 40
    Height 110
    Mass 3000
    Speed 16
    PainChance 0
    SeeSound "uacbsee"
    AttackSound "chainguy/attack"
    ActiveSound "uacbact"
    DeathSound "dsbarexp"
    DamageType "UACRobotBullet"
    DamageFactor "GunShot",0
    DamageFactor "Melee",0.5
    DamageFactor "UACRobotGrenade",1.7
    DamageFactor "UACRobotStomp",0
    DamageFactor "UACRobotBullet",0.9
    MONSTER
    +NOPAIN
    +NOBLOOD
    +BOSS
    +FLOORCLIP
    +NORADIUSDMG
    +DONTMORPH
    +MISSILEEVENMORE
    +NOTELEPORT
    +NOINFIGHTING
    +NOTIMEFREEZE
        var int user_grenadeammo;
        var int user_chaingunammo;
    States
    {
        Spawn:
        TNT1 A 0
        TNT1 A 0 A_SetUserVar("user_grenadeammo",50)
        TNT1 A 0 A_SetUserVar("user_chaingunammo",500)
        Idle:
        UACB G 10 A_Look
        loop
        Idle.NoAmmo:
        UACB A 3 A_Hoof
        UACB A 3 A_Chase("","")
        UACB B 3 A_Metal
        UACB BCC 3 A_Chase("","")
        UACB D 3 A_Hoof
        UACB D 3 A_Chase("","")
        UACB E 3 A_Metal
        UACB EFF 3 A_Chase("","")
        loop
        See:
        UACB A 3 A_Hoof
        UACB A 3 A_Chase
        UACB B 3 A_Metal
        UACB BCC 3 A_Chase
        UACB D 3 A_Hoof
        UACB D 3 A_Chase
        UACB E 3 A_Metal
        UACB EFF 3 A_Chase
        loop
        Missile:
        TNT1 A 0 A_JumpIf(user_grenadeammo>0,2)
        TNT1 A 0 A_Jump(255,4)
        TNT1 A 0 A_JumpIfCloser(512,2)
        TNT1 A 0 A_Jump(255,2)
        TNT1 A 0 A_Jump(210,"Missile.GrenadeLauncher")
        TNT1 A 0 A_JumpIf(user_chaingunammo>0,2)
        TNT1 A 0 A_Jump(255,"Idle.NoAmmo")
        Missile.Chaingun:
        UACB G 2 A_FaceTarget
        UACB H 3 bright A_CPosAttack
        TNT1 A 0 A_SetUservar(user_chaingunammo,user_chaingunammo-1)
        UACB G 2 A_SpidRefire
        goto Missile
        Missile.GrenadeLauncher:
        UACB G 6 A_FaceTarget
        TNT1 A 0 A_PlaySound("grenpop",CHAN_AUTO)
        UACB IJ 3 A_FaceTarget
        TNT1 A 0 A_PlaySound("gren")
        UACB K 6 bright A_CustomMissile("UACRobotGrenade",106,0,0)
        TNT1 A 0 A_SetUservar(user_grenadeammo,user_grenadeammo-1)
        UACB J 6 A_FaceTarget
        TNT1 A 0 A_PlaySound("grenpop",CHAN_AUTO)
        UACB JIG 3 A_FaceTarget
        goto Missile
        Death:
        TNT1 A 0 bright
        UACD K 4 bright A_Scream
        UACD L 4 bright
        UACD MN 4 bright
        UACD O 4 A_NoBlocking
        UACD PQR 4
        UACD S 30
        UACD T 4 bright A_Scream
        UACD UVW 4 bright
        UACD XYZAB 2
        UACD C -1 A_BossDeath
        stop
    }
}

Advantages: no need in declaring a bunch if unused otherwise inventory actors (here were shown only two of them, but I already have declared 0000002:0000050-60 of them), inheritance, does work in inventory itself -- VERY useful when you wish to store amount of items equipped from an item in order to give only limited amount without complex ACS and Decorate scripting.

(0007460)
Qent   
2013-10-24 18:10   
These all work in 131006.