[ZScript] Order in Events intentionally different?

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!)

[ZScript] Order in Events intentionally different?

Postby gwHero » Sun Nov 12, 2017 8:28 am

Hi,
since I couldn't find the answer on the wiki and the several topics concerning ZScript EventHandlers, I'll post my question here.

I was surprised to find out that the PlayerEntered event is called BEFORE the WorldLoaded event.
Is this intentionally different from their ACS counterparts, where ENTER is called AFTER the OPEN event?

It's of course not a problem, but quite fundamental to know if this shift in order is indeed as designed.
User avatar
gwHero
Be your own Siddhartha
 
Joined: 08 May 2017
Location: The Netherlands
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: Intel with Vulkan Support

Re: [ZScript] Order in Events intentionally different?

Postby Graf Zahl » Sun Nov 12, 2017 10:24 am

This is because the player enters a map BEFORE it is fully loaded - the player spawn is part of loading the map.
The reason why ACS is different is, because ACS scripts are not run when being requested, but later when the ACS thinker performs its first thinking turn and has a chance to do a bit of ordering.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [ZScript] Order in Events intentionally different?

Postby gwHero » Sun Nov 12, 2017 11:57 am

Thanks for answering, it's good to know for migrating from ACS to ZScript to keep this in mind.
User avatar
gwHero
Be your own Siddhartha
 
Joined: 08 May 2017
Location: The Netherlands
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: Intel with Vulkan Support

Re: [ZScript] Order in Events intentionally different?

Postby Drake Raider » Wed Nov 15, 2017 1:12 pm

Out of curiousity, because this may or may not relate to something I was thinking of, does this mean we can use zscript to affect things such as slopes and other stuff that used to be the exclusive domain of map definition? It would be cool to add slopes to existing doom maps ingame.
User avatar
Drake Raider
I seem to keep alot of my work to myself....
 
Joined: 18 Jul 2008
Location: Plane of thought.


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest