[DECORATE] User variables and different frames

Mon Sep 13, 2021 9:27 am

I have an idea for a future project after my map pack is released, but I'm already asking now to see if my idea is even possible. My idea is for a custom gun that has a sideways magazine with visible bullets, so after every shot, there would need to be a new frame with the magazine shifted to the side and when the magazine is empty, the same cycle repeats, but flipped. I'm thinking of using user variables like this:


Spoiler:


I would of course reduce the user_bullets variable by one at each shot and after 46 shots, put it back to 46. Is the way I intend to use "if" and user variables even possible, or is there another way I could implement my idea?

Re: [DECORATE] User variables and different frames

Mon Sep 13, 2021 11:06 am

DECORATE is very limited with user variables and what you are thinking about is not possible that way.
For one to check user variables you have to use specific functions, and the "equals" operator is "==" and not "=".
For two, you cannot do the states like that. You can do the checks inside a frame, but you can't use checks to specify a frame.
And lastly, user variables don't even work with weapons.

You are better off using inventory tokens instead of user variables and also overlays are way better for what you want to do.
Example of an inventory token:
Code:
Actor MyGunBullets Inventory {Inventory.MaxAmount 46

DECORATE is very limited, so you either have to hack around it with inventory tokens or use ZScript, as it allows variables inside weapons.

Re: [DECORATE] User variables and different frames

Mon Sep 13, 2021 6:46 pm

Jarewill wrote:DECORATE is very limited with user variables and what you are thinking about is not possible that way.
For one to check user variables you have to use specific functions, and the "equals" operator is "==" and not "=".
For two, you cannot do the states like that. You can do the checks inside a frame, but you can't use checks to specify a frame.
And lastly, user variables don't even work with weapons.

You are better off using inventory tokens instead of user variables and also overlays are way better for what you want to do.
Example of an inventory token:
Code:
Actor MyGunBullets : Inventory {Inventory.MaxAmount 46}

DECORATE is very limited, so you either have to hack around it with inventory tokens or use ZScript, as it allows variables inside weapons.


Yeah, that's what I though... DECORATE is very limited, I only thought of it because I know a little bit of it but it looks like if this project is ever going to happen, I'm gonna have to learn ZScript...