ZScript line specials?

Moderator: GZDoom Developers

Post Reply
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

ZScript line specials?

Post by gwHero »

Just thinking how to replace more ACS scripts by Zscript: are there plans of offering line specials for calling ZScript functions like for ACS (i.e. 80 Script Execute)? Maybe as an intermediate solution it would be not to difficult to make it possible to call SendNetworkEvent thru a line special, but I can imagine that that would be an unwanted development.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: ZScript line specials?

Post by Rachael »

ACS_Execute* specials, and all other line specials, are already inherently available in ZScript.
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

Re: ZScript line specials?

Post by gwHero »

Hi, I think my post was not clear enough. I don't mean executing line specials from ZScript, but a line special that calls a ZScript function directly (the other way around).

Where I can now define line special 80 on the map, it's not yet possible to define a line special to call a ZScript function directly.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: ZScript line specials?

Post by Rachael »

Reopened, but AFAIR this was already asked for, so it's likely this will be closed as a duplicate. (I just can't find the thread atm, though)
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

Re: ZScript line specials?

Post by gwHero »

Thanks :) I could not find something like it either.

I posted this not in a desperate need for this to be build in very quickly, but mainly because I'm interested if there are already some thoughts how the engine is going to deal with these. Like you said yourself recently to consider ACS as deprecated, and I myself got rid of most of my ACS now, I do have linedefs triggering ACS scripts that do nothing more than passing things thru to ZScript. Would be nice to get these last parts out too, but of course no hurry at all.
User avatar
phantombeta
Posts: 2084
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: ZScript line specials?

Post by phantombeta »

ACS shouldn't really be considered deprecated.
In fact, IIRC Graf has said before that ACS should only not be used for actor behaviour like people were doing before ZScript was a thing, and that ACS should still be used for map scripting. (and I agree with that. ZScript is global, it makes no sense to make map-specific scripts in a global scope.)

Related. Also read Xaser's post.
Last edited by phantombeta on Tue Nov 28, 2017 9:04 am, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript line specials?

Post by Graf Zahl »

So this entire request came out of a fundamental misunderstandiing. I actually see very little point in adding such a feature. The action special namespace needs to be protected because it is shared across ports, so I am a bit reluctant to open it up.
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

Re: ZScript line specials?

Post by gwHero »

Well indeed I did read posts and opinions that contradict with each other, and to be honest I indeed believed at first that it was best to leave ACS and ZScript coexist - which will be necessary for a long time, I understand that, deprecated does not mean it will be abandoned.

However, although reluctant at first, because I'm so used to ACS, I found out that there is a lot possible yet also on map control in ZScript. So I thought I give it a try to see how far I would get in migrating the stuff. So to my surprise I found out that even the day/night light system I had developed for my TC in ACS, was improved a lot by moving it to ZScript. With ACS it needed sector tags throughout the maps, which were a pain to be maintained, so I even developed a small custom C# program to generate the tags in the TEXTMAP's.

But after migrating it to ZScript, I could write this easily without need for the sector tags, and I was able the kick the custom C# code out. So for me I've actually changed my mind, and I'm no longer convinced that ACS is better for certain kind of stuff.

But okay, this post was merely to see what the future mindset was on ZScript.
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

Re: ZScript line specials?

Post by gwHero »

Graf Zahl wrote:I actually see very little point in adding such a feature. The action special namespace needs to be protected because it is shared across ports, so I am a bit reluctant to open it up.
I understand. Well, maybe it can be done in another way later. The only thing I miss at the moment is triggering a VM function from the map; I still have to use ACS as a bridge for that. From the console it's already possible with NetworkProcess.
phantombeta wrote:ACS shouldn't really be considered deprecated.
In fact, IIRC Graf has said before that ACS should only not be used for actor behaviour like people were doing before ZScript was a thing, and that ACS should still be used for map scripting. (and I agree with that. ZScript is global, it makes no sense to make map-specific scripts in a global scope.)

Related. Also read Xaser's post.
Thanks, I now remember reading that post before. As a matter of fact, a lot of months after the birth of ZScript was a fact, as a newcomer concerning ZScript like me it's rather difficult to get the big picture of which way it is going, because all information is scattered throughout many posts, and I've seen a lot of opinions.
Actually, it was this discussion viewtopic.php?f=18&t=57814&start=30#p1024869a couple of weeks ago where I defended ACS first, that made me thinking to reconsider afterwards.

My thoughts were this: "okay, here I am, after 6 months busy creating a game, I have now 2.5k of ACS lines in a big library and it's still growing. The game will not be finished before 2019; assuming that in the end ZScript might do a lot of things better, I think it's not desirable to have a game finished in 2019 with a outdated scripting language. If I want to switch, I'd better do it now." So I did, and actually I'm quite pleased with it, because ZScript gives me more control and far better organized code. I agree ZScript is not complete yet, and not having latent functions requires a little bit more code, but it's not too difficult to check moving planes during ticks (a lot of the necessary functionality is already exposed). Assuming more things to be exposed to ZScript later, I think it will be easier to replace some more complex ZScript with simplified code then rewriting complete ACS libraries after 2 years when all's finished. :)
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: ZScript line specials?

Post by Nash »

Yes, jumping on ZScript as early as possible is definitely worth it for large-scale projects and I am so glad I did - getting yelled at for doings things wrong in the process and even forcing developer intervention that ultimately led to the entire scope-blocking system and the birth of event handlers was SO worth it. ;) I have about 260 KB of ZScript (11332 lines according to my line counter script), and I can't imagine if I slept on ZScript and have to convert much later... I'd probably just rage and give up.
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

Re: ZScript line specials?

Post by gwHero »

Yes, I think I read most of the posts :) Because of that, we owe you and the dev's a lot for being inspirational and getting such a result there. I've been a fan of ZDoom & GZDoom for quite some time now, but it's getting better every day.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”