"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!)
- Matt
- 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
- Contact:
Re: "How do I ZScript?"
What's the ZScript equivalent to DrawSelectedInventory? (i.e., no bar, instantly use the moment you hit the use item key)
EDIT: add "cplayer.inventorytics=0;" so that the inventory bar popup lifetime is always zero so you never have to wait.
Also is there any sort of list of all the various status bar commands?
EDIT: add "cplayer.inventorytics=0;" so that the inventory bar popup lifetime is always zero so you never have to wait.
Also is there any sort of list of all the various status bar commands?
Last edited by Matt on Fri Jun 30, 2017 12:56 am, edited 1 time in total.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: "How do I ZScript?"
JPL wrote:Is there a way I can use TexMan.CheckForTexture to determine if a sky texture has been defined in a PWAD versus the IWAD? A bit more context on what I'm trying to do here. I notice there are lots of settings you can pass in for the second and third arguments for CheckForTexture (such as TEX_FirstDefined, TEXMAN_Overridable etc) and it's not clear from looking at the FTextureManager source code what they all do.
No. This is a very fishy thing anyway. Consider two TEXTUREx lumps, both defining SKY1 the same way. It then will report it as a PWAD texture but it's only so because originally these lumps were not cumulative.
Re: "How do I ZScript?"
Eh, wrong destination, Graf.
Re: "How do I ZScript?"
What's so wrong about that post? JPL asked the question in this thread and Graf's answering the question in this thread.ZzZombo wrote:Eh, wrong destination, Graf.
-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: "How do I ZScript?"
I don't think there's one, but this (https://github.com/coelckers/gzdoom/blo ... r.txt#L156) block of code, for instance, handles that.Vaecrius wrote:What's the ZScript equivalent to DrawSelectedInventory? (i.e., no bar, instantly use the moment you hit the use item key)
Also is there any sort of list of all the various status bar commands?
As for your other question, check the base status bar class: https://github.com/coelckers/gzdoom/blo ... tusbar.txt
- Matt
- 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
- Contact:
Re: "How do I ZScript?"
:/
That's what I was using just before I asked... this still requires you to hit the use key twice before the item is actually used.
I'll keep looking in the source code to see how DrawSelectedInventory works... (unless I'm totally off base and the single-tap use was enabled by some other thing I did outside of SBARINFO)
That's what I was using just before I asked... this still requires you to hit the use key twice before the item is actually used.
I'll keep looking in the source code to see how DrawSelectedInventory works... (unless I'm totally off base and the single-tap use was enabled by some other thing I did outside of SBARINFO)
-
- Posts: 33
- Joined: Wed Mar 16, 2016 4:19 pm
Re: "How do I ZScript?"
Is it possible to have "A_RadiusGive" deliver an inventory item with some of its variables already defined, without resorting to ThinkerIterator and stuff? (For example, give enemies an item with caller PlayerNum as a var)
Spoiler:Also, is it possible to alter ammo capacity via ZScript only, as looking around I didn't find anything about it?
-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: "How do I ZScript?"
This might do it:Pink Baron wrote:Also, is it possible to alter ammo capacity via ZScript only, as looking around I didn't find anything about it?
Code: Select all
let blah = FindInventory(<ammoitem>);
if(blah != null)
{
blah.MaxAmount += 3; // Increase the capacity by 3.
}
-
- Posts: 33
- Joined: Wed Mar 16, 2016 4:19 pm
Re: "How do I ZScript?"
Didn't know can directly edit ammo like that, thanks!Blue Shadow wrote:This might do it:
Code: Select all
let blah = FindInventory(<ammoitem>); if(blah != null) { blah.MaxAmount += 3; // Increase the capacity by 3. }
Sill no clue about passing "custom" items to actors in a radius...guess it's time to use that damn Thinker...
- Silentdarkness12
- Posts: 1555
- Joined: Thu Aug 15, 2013 5:34 pm
- Location: Plains of Pride
Re: "How do I ZScript?"
I am considering trying to remake my godawful HUD in ZScript, but I do need to ask first, in it's current state, is ZScript capable of doing all the important things with a hud, that could normally be done in SBARINFO? Conditional draws, querying inventory, cvars, so on and so forth?
-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: "How do I ZScript?"
Speaking from experience, I would say yes.
- Silentdarkness12
- Posts: 1555
- Joined: Thu Aug 15, 2013 5:34 pm
- Location: Plains of Pride
Re: "How do I ZScript?"
Alright, so I just need to.............somehow.......gain a basic understanding of ZScript.
I still have no idea where to start, even after looking up the GZDoom pk3 and the ZDoom wiki....
I still have no idea where to start, even after looking up the GZDoom pk3 and the ZDoom wiki....
- Matt
- 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
- Contact:
Re: "How do I ZScript?"
I think Graf might have has solved the one major blocker preventing me from upgrading HD's HUD to ZScript, so...
-
- Posts: 33
- Joined: Wed Mar 16, 2016 4:19 pm
Re: "How do I ZScript?"
Hi again!
Is it possible (for bookeeping purposes and such) to declare a multi-dimensional constant string array via ZScript, akin to ACSes?
What I did wrong? .-.
Is it possible (for bookeeping purposes and such) to declare a multi-dimensional constant string array via ZScript, akin to ACSes?
Code: Select all
str SomeNames[6][2] = { // ACS array, works just fine
{"NiceName1", "EvilName1"},
{"NiceName2", "EvilName2"},
{"NiceName3", "EvilName3"},
{"NiceName4", "EvilName4"},
{"NiceName5", "EvilName5"},
{"NiceName6", "EvilName6"},
};
static const String SomeNames[] = // This mono-sized array inside an anonymous function works, too
{
"NiceName1",
"NiceName2",
"NiceName3",
"NiceName4",
"NiceName5",
"NiceName6"
};
static const String SomeNames[] = // This one does not
{
{"NiceName1", "EvilName1"},
{"NiceName2", "EvilName2"},
{"NiceName3", "EvilName3"},
{"NiceName4", "EvilName4"},
{"NiceName5", "EvilName5"},
{"NiceName6", "EvilName6"}
};
- Rip and Tear
- Posts: 187
- Joined: Tue May 02, 2017 3:54 pm
Re: "How do I ZScript?"
Is it okay to override PostBeginPlay() on an actor without calling Super.PostBeginPlay()? What kind of issues would it cause, if any?
Edit: The Super is just inheriting from actor.
Edit: The Super is just inheriting from actor.