by D2JK » Fri Nov 11, 2016 12:28 pm
Code: Select all
Class NewPlayer : DoomPlayer
{
Default
{
Player.StartItem "NewPistol";
Player.StartItem "Clip", 50;
Player.WeaponSlot 2, "NewPistol";
}
}
Class NewPistol : Pistol
{
int testing;
States
{
Select:
TNT1 A 0 { invoker.testing = 9; }
Goto Super::Select;
Fire:
TNT1 A 0 A_ChangeVelocity(0,0, testing);
// TNT1 A 0 A_ChangeVelocity(0,0, invoker.testing);
SHTG A 35 A_LogInt(testing);
// SHTG A 35 A_LogInt(invoker.testing);
Goto Ready;
}
}
This will log "0" (zero) in the console, and A_ChangeVelocity has no effect. In my actual mod, the number logged in the console is random and very large (sometimes negative), such as
217 990 448.
If you try to use the two lines currently commented out, it should give an error message on startup:
Unknown identifier 'invoker'.
[code]
Class NewPlayer : DoomPlayer
{
Default
{
Player.StartItem "NewPistol";
Player.StartItem "Clip", 50;
Player.WeaponSlot 2, "NewPistol";
}
}
Class NewPistol : Pistol
{
int testing;
States
{
Select:
TNT1 A 0 { invoker.testing = 9; }
Goto Super::Select;
Fire:
TNT1 A 0 A_ChangeVelocity(0,0, testing);
// TNT1 A 0 A_ChangeVelocity(0,0, invoker.testing);
SHTG A 35 A_LogInt(testing);
// SHTG A 35 A_LogInt(invoker.testing);
Goto Ready;
}
}
[/code]
This will log "0" (zero) in the console, and A_ChangeVelocity has no effect. In my actual mod, the number logged in the console is random and very large (sometimes negative), such as [i]217 990 448[/i].
If you try to use the two lines currently commented out, it should give an error message on startup: [b]Unknown identifier 'invoker'[/b].