More DECORATE problems ahead

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
FireSeraphim
Posts: 407
Joined: Thu Nov 18, 2010 12:45 am

More DECORATE problems ahead

Post by FireSeraphim »

For the most part everything about the weapon (the new version of the Marksman Rifle in my TEOTPC mod) works correctly now except the scope crosshair that's supposed to appear when zoomed.
Zooming, firing while zooming and unzooming work fine right except for the distinct lack of the aforementioned scope. I deeply suspect that it's something deeper than a unforeseen problem with my DECORATE code. please PM me or ping me on discord for the latest bleeding edge dev revision of my mod if you are interested in helping me resolve this conundrum.
Last edited by FireSeraphim on Fri Apr 13, 2018 5:56 pm, edited 1 time in total.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: I am having problems with a weapon I'm working on

Post by Matt »

Maybe just upload it?
User avatar
FireSeraphim
Posts: 407
Joined: Thu Nov 18, 2010 12:45 am

Re: I am having problems with a weapon I'm working on

Post by FireSeraphim »

@Matt: I already have it uploaded to my dropbox, I just want to keep this somewhat confidential since the next public version of my mod is going to be huge in that I will be (hopefully) exiting the alpha phase (where I am satisfied enough with the gameplay aspect of it that I can focus more work on the maps) and entering the beta phase (which involves further refining existing elements, polishing existing maps and focusing more on making new maps overall)

Edit: I may as well share the dev build
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: I am having problems with a weapon I'm working on

Post by Apeirogon »

FireSeraphim wrote: I deeply suspect that it's something deeper than a unforeseen problem with my DECORATE code.
And you suspect wrong.

You use MSPC A sprite name in decorate, but image of scope have MSPC B name.

And change its offset to (351,444), so it fit screen correctly.

And change ready state to

Code: Select all

  Ready:
	MRIF A 0
	MRIF A 0 A_JumpIfInventory ("ZoomCheck", 1, "Unzoom")
    MRIF A 1 A_WeaponReady (WRF_ALLOWZOOM)
    Loop
because mad twitching rifle not the one I, player, want to see.

And, desirable, change zoom state to altfire, because most players bind altfire to second mouse button, not zoom.
User avatar
FireSeraphim
Posts: 407
Joined: Thu Nov 18, 2010 12:45 am

Re: I am having problems with a weapon I'm working on

Post by FireSeraphim »

Thank you Apeirogon! You too shall appear in the credits
User avatar
FireSeraphim
Posts: 407
Joined: Thu Nov 18, 2010 12:45 am

More DECORATE problems ahead

Post by FireSeraphim »

Once again I am stumped on another decorate thing, namely fixing a problem where the pistol in my mod continues to fire after running out of ammo instead of just autoswapping to another weapon, and this is in light of me working on adding a reloading system to my pistol. Here's the DECORATE code: https://hastebin.com/ilifajeqag.php I am literally at a lost to what the hell I could possibly be doing wrong.
Could someone go over my pistol code and maybe point out where I'm blundering? I am simply not seeing where I'm fracking up?

Also just discovered that I can hold down the reload key and drain my ammo that way.
User avatar
FireSeraphim
Posts: 407
Joined: Thu Nov 18, 2010 12:45 am

Re: More DECORATE problems ahead

Post by FireSeraphim »

One step forward, two steps back.
There's no winning for losing, is there? even with going as far as swapping ammo1 and ammo2 It still will not deselect the weapon. and if I try the other way or any other tweak I run into the opposite problem of the weapon deselecting right away instead of going to the reload state when there's still ammo to load into the clip
My Pistol Code as it stands right: https://hastebin.com/wuqotinovi.php
Ideally I want the pistol to not fire and deselect when there's absolutely no ammo in both the clip and main ammo pool the clip reloads from. The real problem is that with Weapon.Ammo_Optional, the weapon works right for the most part but WILL NOT deselect when there is no clip2 or officerpistolloaded left. If I remove Weapon.Ammo_Optional, the weapon deselects the moment I press the fire key, consequences be damned (this applies even when I give 12 officerpistolloaded via the playerpawn).
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: More DECORATE problems ahead

Post by Apeirogon »

You mod should work with zandronum or no?

Anyway, here. Just change name of sprite and ammo.
Spoiler:
User avatar
FireSeraphim
Posts: 407
Joined: Thu Nov 18, 2010 12:45 am

Re: More DECORATE problems ahead

Post by FireSeraphim »

Thank you!
Post Reply

Return to “Scripting”