MantisBT - Zandronum
View Issue Details
0001626Zandronum[All Projects] Suggestionpublic2013-12-30 00:302018-09-30 22:28
Visual Vincent 
Torr Samaho 
normalminorhave not tried
closedfixed 
MicrosoftWindowsXP/Vista/7
1.2 
3.03.0 
0001626: Backport ZDoom's Named Scripts and make the number of scripts exceed 999.
Please backport ZDoom's named scripts and make the script numbers able to exceed 999. This would be very useful to prevent mods from overriding each others scripts.
2.6
child of 0002172closed Torr Samaho Upgrade GZDoom base to 1.8.6 
Issue History
2013-12-30 00:30Visual VincentNew Issue
2013-12-30 12:33DuskStatusnew => acknowledged
2013-12-30 12:33DuskResolutionopen => backport later
2013-12-31 18:22ZzZomboNote Added: 0007803
2013-12-31 18:58Visual VincentNote Added: 0007804
2013-12-31 19:00Visual VincentNote Added: 0007805
2015-04-04 21:21ArcoRelationship addedchild of 0002172
2015-04-05 08:16WaTaKiDTarget Version => 3.0
2015-04-05 14:38ZzZomboNote Added: 0012050
2015-04-06 21:30Visual VincentNote Added: 0012066
2015-04-06 21:31Visual VincentNote Edited: 0012066bug_revision_view_page.php?bugnote_id=12066#r6926
2015-04-06 21:31Visual VincentNote Edited: 0012066bug_revision_view_page.php?bugnote_id=12066#r6927
2015-04-06 21:33Visual VincentNote Edited: 0012066bug_revision_view_page.php?bugnote_id=12066#r6928
2015-04-06 22:04ArctangentNote Added: 0012068
2015-04-07 09:30Visual VincentNote Added: 0012070
2015-04-07 09:31Visual VincentNote Edited: 0012070bug_revision_view_page.php?bugnote_id=12070#r6932
2015-04-08 02:21ArctangentNote Added: 0012071
2015-04-08 09:26DuskNote Added: 0012072
2015-05-09 13:56DuskStatusacknowledged => assigned
2015-05-09 13:56DuskAssigned To => Torr Samaho
2015-05-09 13:58DuskStatusassigned => needs testing
2015-05-11 21:30HypnotoadNote Added: 0012251
2015-05-11 21:35WaTaKiDStatusneeds testing => resolved
2015-05-11 21:35WaTaKiDResolutionbackport later => fixed
2015-05-11 21:35WaTaKiDFixed in Version => 3.0
2018-09-30 22:28Blzut3Statusresolved => closed

Notes
(0007803)
ZzZombo   
2013-12-31 18:22   
Named scripts of special types are already supported though. That means you can't execute them manually (unless you know their number, then yeah).
(0007804)
Visual Vincent   
2013-12-31 18:58   
I meant the ACS scripting.
Like:

Script 1 OPEN
{
ACS_NamedExecute("I am a script", 0, 0, 0, 0);
}

Script "I am a script" (void)
{
Print(s:"Hi :D");
}
(0007805)
Visual Vincent   
2013-12-31 19:00   
When i try to make a named script it only gives me an error.
(0012050)
ZzZombo   
2015-04-05 14:38   
Vincent, this works, as I've already stated:
script "TEST" ENTER
{
    Print(s:"It works!");
}
(0012066)
Visual Vincent   
2015-04-06 21:30   
(edited on: 2015-04-06 21:33)
ZzZombo:
ENTER != (void)


Named scripts as ENTER or OPEN worked in Zan 1.3, but since it's converted into a number, and script numbers won't exceed 999 it doesn't work in Zan 2.0

(0012068)
Arctangent   
2015-04-06 22:04   
These two requests are entirely different things, I think,

I'm pretty sure ZDoom's named scripts use negative numbers, not over-999 numbers. Trying to use an over-999 script in ZDoom will give you the exact sae error, iirc.
(0012070)
Visual Vincent   
2015-04-07 09:30   
(edited on: 2015-04-07 09:31)
Arctangent:
Yes, I've heard before that ZDoom uses negative numbers...
But that's probably also converted in some way. Because the error I get is this:
Error: Script number 65535 exceeds 999!


(0012071)
Arctangent   
2015-04-08 02:21   
I'm pretty sure the bytecode for named scripts don't actually have a number assigned, but rather when everything is loaded the scripts are given negative numbers to make sure that the engine has a way to refer to them. If they were given numbers when the code is compiled, you'd still run into number conflicts, just it'd be a lot less obvious when that happens because you'd only know the scripts by their names, not numbers.

So, I'm thinking this is more of an error in Zandronum's assigning of numbers upon loading.
(0012072)
Dusk   
2015-04-08 09:26   
Let me clear a few things up:
- Zandronum has never, ever supported named scripts! They only happened to """work""" because of lack of safeguard code. Zandronum 2.0 fixed this behavior by giving an error message instead of undefined behavior. "Named scripts" in 1.3 caused random crashes and who knows whatever else.
- I figure the named script number is converted to unsigned somewhere as part of the error message for the same reason. Negative script numbers don't exist in Zandronum anyway so I guess there's got to be an unsigned integer somewhere in the pipeline.
- Named scripts were added in ZDoom 2.6 and will be ported as part of the scheduled ZDoom upgrade for Zandronum 3.0.

Now, please cut the FUD as if named scripts ever worked in Zandronum.
(0012251)
Hypnotoad   
2015-05-11 21:30   
Testing named scripts in 3.0, named scripts execute successfully, and I tested ACS_NamedExecute, which works fine too.