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!)
This function makes my GZDoom silently suicide on init. (closes without error, remains in the process list)
Replacing Line with anything else still causes it.
Pls add either Actor.GetArg0Str() or more universal typecast from int to Name (since arg0str is Name(-args[0]), but that's not possible due to how VM works).
With the new [wiki]ScriptCall[/wiki] function, would it be possible to call a function on the activator, rather than a static function?
Or, at least, some way to identify the activator in a way that a static function could find them.
Calling a function on the activator is not possible because the activator has no type and you cannot extend Actor.
Passing the activator should be doable later but will be tricly to implement safely.
... which may bring us into even worse undefined situations if the function that gets called can differ, based on class, and ever require different parameters if you get two classes with the same method name but no relation to each other. Far too dangerous for my taste. A static function is always a well-defined entry point.
I wonder if it's possible to hack Visual Studio or VS Code somehow to support ZScript? Having Intellisense on ZScript files would be cool to have.
EDIT: VS Code is promising. Just by installing the C++ extension and then opening your ZScript files as C++ (I had to change the ZScript file to have a .cpp extension) works quite well. You can do let <something> and autocompletion works (I see all my custom fields!), and most methods inside your class are recognized and can be peeked at, just like in Visual Studio.
What doesn't work yet is if you do MyClass.MyMethod. Need to figure this out.
I think with a little tweaking, a ZScript extension can be made to fully recognize it.
Man, I wish there was a way to only compile ZScript without actually running the game. I'm guessing the sum of the total accumulated time every time my ZScript fails to make the game start has reached hours by now, haha...