Resources > Coding

Small GM Error [Solved]

(1/1)

Ryuza:
Hey, been a long time since I've been around but I figured I"d stop by and ask a quick GM question. It's been awhile since I've used GM and I'm still getting a bit used to Studio and encountered an error importing an old project of mine that I was gonna mess around with.

--- Code: ---switch ctrl_menu.slot[16, 0] {
    case global.item[15, 1]: scr_weapon_bow() break;
    }
--- End code ---
It's giving me the error: Case argument should be a constant.

It seems like it's probably something pretty obvious but I'm not really sure what. Anyone know what to do?

Edit: Got it working now, thanks Martijn!

Martijn dh:
I believe switch commands no longer work with non-constant values in Studio. Your case global.item[x,x] is variable. The compiler can't convert that to a constant value like for instance: case 5.

Ryuza:
Ah, well that was simple enough, I got it working now, thanks! :D

Navigation

[0] Message Index


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Go to full version