DECORATE to ZScript Conversion questions

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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!)
User avatar
Enjay
 
 
Posts: 27668
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: DECORATE to ZScript Conversion questions

Post by Enjay »

phantombeta wrote: Sat Feb 15, 2025 8:31 pm Most of the time, the ZScript version matches the GZDoom version number. Right now it's 4.14.0.
...and that also makes sense. Thanks again. The reason I thought it was 4.8.2 was because the newest mod I could find had that version. As for me being confused and thinking that somehow the 4.12 in GZDoom.pk3 was lower than that, put it down to a late-night brain fart! :laff: :oops:
(Although, perhaps it should be 4.14?)


Anyway, I versioned my files at 4.14 and it flagged up a whole bunch of... well, flags actually, that were deprecated in 4.13. No problems there. I have fixed that. The wiki was nice and clear what the better/up to date alternatives are.

However, versioning to 4.14 has also thrown up some warnings that are beyond me to fix: comparison of signed and unsigned values.

I understand the problem, comparing a value that can only be +ve to one that could be +ve or -ve, and I've read about the potential resulting screwy big numbers, but I am unsure how to fix the code. None of it was my code originally.

All of the relevant lines look very similar (probably not surprisingly). Each line has a "uint", which I understand is an unsigned integer. I can "fix" the warnings (i.e. make them go away) by simply changing "uint" to "int" in each case. However, I want to check that it is safe to do that. The various scripts in question still seem to work, and their effects in game seem to be identical. So, fingers crossed that this is an acceptable fix, but can anyone confirm?

Here are the warnings followed by the relevant lines for each case.
Spoiler:
User avatar
phantombeta
Posts: 2223
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: DECORATE to ZScript Conversion questions

Post by phantombeta »

For these lines you posted, it should be safe to simply change uint to int, yes.
User avatar
Enjay
 
 
Posts: 27668
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: DECORATE to ZScript Conversion questions

Post by Enjay »

Perfect, thank you once again.
Post Reply

Return to “Scripting”