"How do I ZScript?"
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!)
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!)
-
- Lead GZDoom+Raze Developer
- Posts: 49182
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: "How do I ZScript?"
A dummy object is just the same as your thinker in terms of cost. If you need it repeatedly, store it in a local variable. The expensive action is to retrieve the global storage thinker, not to use it.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: "How do I ZScript?"
What's with all the const function stuff and what is its purpose?
-
- 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: "How do I ZScript?"
I'm sick of typing out this sort of thing constantly:I'm seeing in the actor function list a bunch of things like "Vec3Angle". Can those be used instead?
Code: Select all
vel+=(
cos(angle)*cos(pitch),
sin(angle)*cos(pitch),
-sin(pitch)
)*10;
Last edited by Matt on Sat Mar 04, 2017 2:08 pm, edited 1 time in total.
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: "How do I ZScript?"
I think there are static methods in vector3... Its just that these are not defined anywhere in the ZScript files and are instead directly set on the C++ side.
Anyway I'd write a function here and forget about the overhead. Like vector3 GetRotatedUnitVector(double angle, double pitch, double roll).
There are methods in actor that can give you only angle (Vec3Angle), but not angle+pitch and certainly not roll.
Anyway I'd write a function here and forget about the overhead. Like vector3 GetRotatedUnitVector(double angle, double pitch, double roll).
There are methods in actor that can give you only angle (Vec3Angle), but not angle+pitch and certainly not roll.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: "How do I ZScript?"
Use A_ChangeVelocity with the CVF_RELATIVE flag.
-
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
Re: "How do I ZScript?"
Just a quick question this time:
I notice in gzdoom.pk3, the definition for Key features a flag with a semicolon after it. I know it's not required, but does this mean it's optional? Does it hold any significance?
Code: Select all
class Key : Inventory
{
Default
{
+DONTGIB; // Don't disappear due to a crusher
Inventory.InterHubAmount 0;
Inventory.PickupSound "misc/k_pkup";
}
override bool HandlePickup (Inventory item)
{
// In single player, you can pick up an infinite number of keys
// even though you can only hold one of each.
if (multiplayer)
{
return Super.HandlePickup (item);
}
if (GetClass() == item.GetClass())
{
item.bPickupGood = true;
return true;
}
return false;
}
override bool ShouldStay ()
{
return !!multiplayer;
}
}
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: "How do I ZScript?"
It holds no significance with flags and are completely optional.
-
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
Re: "How do I ZScript?"
Alright, just checking. Wanna make sure I keep all my syntax proper and correct.
-
-
- Posts: 17465
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: "How do I ZScript?"
Probably a typo since everything else doesn't.
I'd still be careful because knowing ZDoom's history of 'IT USED TO WORK WTF NOW ITDOESN'T"
I'd still be careful because knowing ZDoom's history of 'IT USED TO WORK WTF NOW ITDOESN'T"
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: "How do I ZScript?"
No, that's a feature. People requested if it could be done for consistency and Graf obliged.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: "How do I ZScript?"
Graf: How does the versioning system work? What needs to be considered when using it? What will be enabled/disabled when (not) using it?
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: "How do I ZScript?"
1.at the top of your zscript.txt
2. Nothing
3. Only GZDoom 2.3 ZScript features with unspecified version
P.S. It's NOT DONE. It's literally not done, the latest master branch in GZDoom's repo is in an intermediate state, half there. Don't try to use versions just yet.
Code: Select all
version "<latest gzdoom version goes here>"
2. Nothing
3. Only GZDoom 2.3 ZScript features with unspecified version
P.S. It's NOT DONE. It's literally not done, the latest master branch in GZDoom's repo is in an intermediate state, half there. Don't try to use versions just yet.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: "How do I ZScript?"
I have no intention of doing it right now anyway. Considering how broken things are at the moment, I'm not updating my GZDoom to the latest git right now until after it's safer.
But the whole determination of the syntax for inserting play and ui keywords will definitely need clarification so I know what and when to use them with 2.4 features.
But the whole determination of the syntax for inserting play and ui keywords will definitely need clarification so I know what and when to use them with 2.4 features.
-
- Lead GZDoom+Raze Developer
- Posts: 49182
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: "How do I ZScript?"
Major Cooke wrote:Graf: How does the versioning system work? What needs to be considered when using it? What will be enabled/disabled when (not) using it?
I can't tell you how something works that isn't even done yet.
-
-
- Posts: 1355
- Joined: Mon May 06, 2013 8:02 am
Re: "How do I ZScript?"
How do apply a player property to a pointer?