Game crashes when executing an script from decorate
Posted: Wed Dec 07, 2016 7:56 pm
An icon is supposed to be shown on the hud displaying if the player has an item or not(This is so it can be shown too on chasecam mode), however when the player pickups an item that gives a random item which is supposed to be displayed on the hud the game freezes for a momment and then crashes, can somebody help me out?
Code: Select all
Actor RandomItem : Ammo 10000
{
Radius 64
Height 64
Inventory.PickupMessage "You got a Random Item!"
Inventory.PickupSound "ITEMBOX1"
Inventory.Amount 1
Inventory.MaxAmount 1
+MOVEWITHSECTOR
States
{
Spawn:
ITEM ABCDEFGHIJKLMNOP 4 Bright
Loop
Pickup:
TNT1 A 0
Stop
}
}
Actor Player : DoomPlayer
{
...
States
{
...
Stay:
...
TNT1 A 0 A_JumpifInventory("RandomItem",1,"GiveItem")
...
GiveItem:
TNT1 A 0 A_JumpifInventory("CheckItem",1,"Stay")
TNT1 A 0 A_GiveInventory("CheckItem",1)
TNT1 A 0 ACS_ExecuteAlways(602,0)
Goto Stay
Code: Select all
#library "HUDICONS"
#include "zcommon.acs"
Script 600 Enter
{
SetFont("ITMEMPTY");
HudMessage(s:"A"; HUDMSG_Plain, PlayerNumber(), 0 , 0.5, 0.1, 0);
}
Script 601 (Void)
{
SetFont("ITMEMPTY");
HudMessage(s:"A"; HUDMSG_Plain, PlayerNumber(), 0 , 0.5, 0.1, 0);
}
Script 602 (void)
{
int Check = Random(1,2);
if(Check == 1){
GiveInventory("GreenSkullAmmo",1);
SetFont("ITMGSKUL");
HudMessage(s:"A"; HUDMSG_Plain, PlayerNumber(), 0 , 0.5, 0.1, 0);
}
if(Check == 2){
GiveInventory("RedSkullAmmo",1);
SetFont("ITMRSKUL");
HudMessage(s:"A"; HUDMSG_Plain, PlayerNumber(), 0 , 0.5, 0.1, 0);
}
}