RederickDeathwill Posted December 27, 2017 (edited) When I use them, the script does not compile. It doesn't matter whether it's ZDoom ACS or Zandronum ACS (Using GZDoom Builder here). Had read somewhere in the wiki that I can use Action Specials as normal procedures/functions. How am I supposed to lower / raise sectors without them? Any idea why I can't use them? And this bloody compiler has no stacktrace / does not state the error. EDIT: Solved, sorry. Beginner mistake. Forgot to use the #include directive -.- Absolutely pathetic. Without including "zspecial.acs", it would never work. Edited December 27, 2017 by RederickDeathwill 0 Share this post Link to post
StormCatcher.77 Posted December 27, 2017 (edited) You need to initialize "SectorTag" variable first. Add a only one line "Int SectorTag;" above the first script. Not in each script. This creates conflict. I think you'll have to create a few special variables or reconsider the structure of the scripts. What exactly do you plan, if not secret? 1 Share this post Link to post
RederickDeathwill Posted December 27, 2017 5 minutes ago, StormCatcher.77 said: You need to initialize "SectorTag" variable first. Add a only one line "Int SectorTag;" above the first script. Not in each script. This creates conflict. I think you'll have to create a few special variables or reconsider the structure of the scripts. What exactly do you plan, if not secret? But sectorTag is just the input argument (Which I pass when I call the script). There's no reason to initialize it in global scope. When I press "use" on this sidedef I get a: "p_startscript unknown script 3" error. The ACS script is not being compiled, because I'm using action specials (They're not working for some reason). Just want to lower it :p Prefer to use scripts / get used with the actions. 0 Share this post Link to post
RederickDeathwill Posted December 27, 2017 I've tried to compile manually through the CMD in order to see if it would give me any errors... I was right, the action specials are not defined -.- 0 Share this post Link to post
StormCatcher.77 Posted December 27, 2017 (edited) I try to compile your code in empty map... no any errors. >.< ????? #include "zcommon.acs" Script 1 (Void) { For (int i = 1; i < 6; i++) { SpawnSpot("ShotgunGuy", i); } } Script 2 (Int sectorTag) { For (int i = 6; i < 10; i++) { SpawnspotFacing ("Cacodemon", i); } SpawnSpotFacing ("SuperShotgun", 10); Light_Fade(sectorTag, 350, 5000); } Script 3 (Int sectorTag) { Floor_LowerToNearest(sectorTag, 16); } I try it in GZDoomBuilder2.3.0 By the way, I really did not know that scripts can have the same input arguments. 0 Share this post Link to post
RederickDeathwill Posted December 27, 2017 54 minutes ago, StormCatcher.77 said: I try to compile your code in empty map... no any errors. >.< ????? #include "zcommon.acs" Script 1 (Void) { For (int i = 1; i < 6; i++) { SpawnSpot("ShotgunGuy", i); } } Script 2 (Int sectorTag) { For (int i = 6; i < 10; i++) { SpawnspotFacing ("Cacodemon", i); } SpawnSpotFacing ("SuperShotgun", 10); Light_Fade(sectorTag, 350, 5000); } Script 3 (Int sectorTag) { Floor_LowerToNearest(sectorTag, 16); } I try it in GZDoomBuilder2.3.0 By the way, I really did not know that scripts can have the same input arguments. Discovered in the other post. I was developing an "ammo recharger" script that can take many terminals. The terminals could only be differentiated through input arguments. I'm using input arguments for the tags of the sectors. It's way clearer than using raw numbers in the script which seem to come from nowhere (Hate that. In C++/Java/Python, I'd use constants to avoid that). In this way, when I click on the sidedef, I know to which sector the script belongs. The post had some usefulness then, because it was all about me being stupid :p Forgot to include the bloody functions!! (Probably a Python evil). 0 Share this post Link to post
Empyre Posted December 27, 2017 3 hours ago, RederickDeathwill said: In C++/Java/Python, I'd use constants You can use constants in ACS (and DECORATE, too, also described on that page): https://zdoom.org/wiki/Constants 0 Share this post Link to post
RederickDeathwill Posted December 27, 2017 2 hours ago, Empyre said: You can use constants in ACS (and DECORATE, too, also described on that page): https://zdoom.org/wiki/Constants In this specific case wouldn't make much sense to do something like: #define SECTOR_ONE 1 I'm enjoying using input arguments because it's easier / clearer to identify to which script the to-be-altered sector is associated to. But yeah, quite a beautiful work the creator did with this scripting language. It's quite complete, and with a hell of a syntax for a scripting language (I mean, he could have used LUA or something instead, but nope, he reinvented the wheel using a C++ syntax, and in a quite admirable fashion). 0 Share this post Link to post
boris Posted December 27, 2017 9 hours ago, RederickDeathwill said: And this bloody compiler has no stacktrace / does not state the error. It does display the error, but it's awkwardly hidden. If you look at the bottom of the editing window you'll see a bar with two triangles: That's the retractable error list. But for some reason it doesn't expand automatically when an error occurs. So if there's an error the triangles should switch to point down. Then you can drag the bar up (not on the dotted line, but to the left or right of it) to see the error. I think you have to do that once after starting the program. The result will be something like this: 2 Share this post Link to post
RederickDeathwill Posted December 27, 2017 1 hour ago, boris said: It does display the error, but it's awkwardly hidden. If you look at the bottom of the editing window you'll see a bar with two triangles: That's the retractable error list. But for some reason it doesn't expand automatically when an error occurs. So if there's an error the triangles should switch to point down. Then you can drag the bar up (not on the dotted line, but to the left or right of it) to see the error. I think you have to do that once after starting the program. The result will be something like this: -.-, i had clicked everywhere! Thank you very much for pointing out those arrows. 0 Share this post Link to post
Nevander Posted December 27, 2017 I see you solved it but yes, you ALWAYS need #include "zcommon.acs" at the top or else nothing will work. I wonder why GZDoom Builder doesn't automatically add this when you go into the script editor? 0 Share this post Link to post
RederickDeathwill Posted December 27, 2017 17 minutes ago, Nevander said: I see you solved it but yes, you ALWAYS need #include "zcommon.acs" at the top or else nothing will work. I wonder why GZDoom Builder doesn't automatically add this when you go into the script editor? The zcommon.acs file includes the other 3 in it: #include "zspecial.acs" #include "zdefs.acs" #include "zwvars.acs" Perhaps some more "advanced" users like to use their own .acs files, with their own specific declarations. In general, it's basic stuff, the GZDoom developer probably assumes that the user wanting to play with scripting knows that. And besides, under edit there's an "insert snippet" submenu with an #include directive that inserts zcommon.acs :p 0 Share this post Link to post
Empyre Posted December 27, 2017 Another option you have to make it clear which script is which is to use named scripts. 0 Share this post Link to post