ZScript Documentation
Moderators: GZDoom Developers, Raze Developers
Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
-
- Lead GZDoom+Raze Developer
- Posts: 49140
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Documentation
For that you need to call self.AngleTo(X).
-
-
- Posts: 1355
- Joined: Mon May 06, 2013 8:02 am
Re: ZScript Documentation
Is there a way to make pitch and yaw input not affect the playerpawn in szcript? Other than constantly turning "against" it with getplayerinput.
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
You'd have to basically freeze the player and rely solely on GetPlayerInput in that regard. Two of them: one for pitch and one for yaw.
-
-
- Posts: 1355
- Joined: Mon May 06, 2013 8:02 am
Re: ZScript Documentation
So I'd have to freeze the player completely and re-implement all movement, shooting, reloading etc. with GetPlayerInput then? Would be inconvenient, but should at least solve the rendering interpolation issues with the "turn-against" method.
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
Just dont expect it to be very compatible with mods that rely on PROP_(TOTALLY)FROZEN.
-
-
- Posts: 1355
- Joined: Mon May 06, 2013 8:02 am
Re: ZScript Documentation
Well it's for improving the custom movement system in a gameplay mod (doomshock), so support for heavily scripted maps is not something I'm particularly concerned about Thanks for the help.Major Cooke wrote:Just dont expect it to be very compatible with mods that rely on PROP_(TOTALLY)FROZEN.
By the way, could there be a zscript topic on the wiki where people can post general code examples (experimental or not)?
-
- Posts: 545
- Joined: Sat Aug 30, 2014 8:21 am
Re: ZScript Documentation
double AngleTo(Actor target, bool absolute = false);
What is the boolean option supposed to do here? I tried enabling and disabling it, but couldn't notice any difference.
I was hoping unsetting it would make the function return the relative angle towards the target:
What is the boolean option supposed to do here? I tried enabling and disabling it, but couldn't notice any difference.
I was hoping unsetting it would make the function return the relative angle towards the target:
Spoiler:
-
- Lead GZDoom+Raze Developer
- Posts: 49140
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Documentation
These functions are portal-aware. If you set absolute to true it won't factor in portal offsets. In some cases this may be necessary.
-
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Re: ZScript Documentation
I've been staring at the Structs page for a while now and I am still completely baffled as to what use it could possibly have. The example shows the grammar but it is completely useless in demonstrating its significance. (The one thing I could imagine doing, setting virtual functions across actors that do not inherit from a common custom actor, cannot be done.)
A lot of the DECORATE examples are really good about this: "this function causes this to happen. Here's an example of an imp that calls it twice to spin around on the spot 3 times before exploding..." You didn't even need to look at the description, the example alone could show what it could do and why.
It would be great if someone could add something like that to this page.
A lot of the DECORATE examples are really good about this: "this function causes this to happen. Here's an example of an imp that calls it twice to spin around on the spot 3 times before exploding..." You didn't even need to look at the description, the example alone could show what it could do and why.
It would be great if someone could add something like that to this page.
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
Ya know, it'd be a real lovely treat if other people could work on helping out... I have very little time to work on the documentation right now.
That example was written before functions could be inserted.
Also, it wouldn't hurt to learn a bit of C++/Java, Vaecrius. That'll teach you how to use structs. There's a link right on that wiki page.
That example was written before functions could be inserted.
Also, it wouldn't hurt to learn a bit of C++/Java, Vaecrius. That'll teach you how to use structs. There's a link right on that wiki page.
-
- Admin
- Posts: 6190
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
Re: ZScript Documentation
https://zdoom.org/wiki/Controlling_dynamic_lights
There's something on this page I really don't get:
There's something on this page I really don't get:
I mean, what the hell? How does that make any sense?The MISSILEEVENMORE flag has a special use for dynamic lights. When present, it enables the subtractive mode.
-
- Lead GZDoom+Raze Developer
- Posts: 49140
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Documentation
Remember, this is from a time when DECORATE wasn't that configurable, roughly 2006 or so. So I chose 3 flags that had no meaning for dynamic lights and repurposed them for some features I wanted settable in DECORATE.
-
-
- Posts: 17922
- Joined: Fri Jul 06, 2007 3:22 pm
Re: ZScript Documentation
Are you going to try to make dynamic lights that attack players? Because that'd be weird (and honestly you could have that effect by attaching a dynamic light to an invisible actor).
-
- Lead GZDoom+Raze Developer
- Posts: 49140
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Documentation
Dynamic lights cannot act as regular actors because they adjust their radius to their light size. Don't even try. In fact, ADynamicLight should proably demoted to a thinker instead of a real actor and also use attachment to handle the light map things.
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
If you change it, can you give us an example on how to attach it, please?