4. DECORATE will remain supported, however it will not itself be updated, only the action functions you can use. (And I believe, actually, those can be defined in ZScript anyhow, and used in DECORATE later, if I am not mistaken)Gez wrote:A few things:
- DECORATE and ZScript have the same backend. Once it's compiled there is no difference for the engine whether something was coded in DECORATE or ZScript.
- There's no need to convert stuff just for the purpose of having converted it. Only convert what you need to convert.
- DECORATE will remain forever supported.
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.
-
- Posts: 13791
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: ZScript Documentation
-
- Posts: 545
- Joined: Sat Aug 30, 2014 8:21 am
Re: ZScript Documentation
If I override the CanCollideWith function, and just want to add a single rule, is it possible to end it with Super.CanCollideWith(); like with some of the other overrides? Or does it mess things up if the only thing I include in the override is that single addition of my own, and nothing else?I just spent some time editing in the virtual functions for thinker and actor.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
You can do super. Any virtual function can do that but just note, if it inherits from Actor/internal class, it's pointless to do that because it's empty.
-
- Lead GZDoom+Raze Developer
- Posts: 49182
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Documentation
AActor.CanCollideWith does nothing, there's no need to call it. If you want to stack rules for subclasses it can surely be used that way.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
Remind me again, when is the 'action' word necessary?
-
- Posts: 545
- Joined: Sat Aug 30, 2014 8:21 am
Re: ZScript Documentation
Code: Select all
Override bool CanCollideWith(actor other, bool passive)
{
if (other.health < 50) return false;
else return true;
}
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
You forgot to add passive bool checks. Check the information carefully.
-
- Posts: 545
- Joined: Sat Aug 30, 2014 8:21 am
Re: ZScript Documentation
Ok, I think I get it. If the monster is not solid, this function will not be called in the first place, so it doesn't matter what conditions I've written in it.
-
- Lead GZDoom+Raze Developer
- Posts: 49182
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Documentation
Major Cooke wrote:Remind me again, when is the 'action' word necessary?
Only for weapons, overlays and custom inventory states.
-
-
- Posts: 26571
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: ZScript Documentation
Something that might be useful in the documentation as a bit of a primer for people, a sort of "What can ZScript do for me" section to let people know how ZScript fits in to and dovetails with the various scripting systems and text definition options available in ZDoom and some basic suggestions of the kind of thing a modder could use ZScipt for.
I know that the page currently says "ZScript (formerly known as DoomScript) is a text-format lump used to create classes or structs for use in ZDoom. It can include the names of other lumps for processing similar to DECORATE." and that's fine as a basic introduction but something to ease people in to zscript and show them what it's all about, thereby making it more accessible, would be good IMO. I would do it myself but I don't feel expert enough in ZScript. Having missed the whole thing kicking off properly, I'm a bit behind the curve and only slowly getting to grips with it myself.
I know that the page currently says "ZScript (formerly known as DoomScript) is a text-format lump used to create classes or structs for use in ZDoom. It can include the names of other lumps for processing similar to DECORATE." and that's fine as a basic introduction but something to ease people in to zscript and show them what it's all about, thereby making it more accessible, would be good IMO. I would do it myself but I don't feel expert enough in ZScript. Having missed the whole thing kicking off properly, I'm a bit behind the curve and only slowly getting to grips with it myself.
-
- Posts: 545
- Joined: Sat Aug 30, 2014 8:21 am
Re: ZScript Documentation
I'm sure it's been explained somewhere, but how do I convert a pointed class name into a string, so that I can use this string in A_Log, for example?
Being able to do this should help me a lot when trying to fix certain problems.
Code: Select all
if (target)
{
String S = target. <What do I write here?>
A_Log(S);
}
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
Does GetClass() work in that regard?
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
Join the club. We gots cookies.Enjay wrote:Something that might be useful in the documentation as a bit of a primer for people, a sort of "What can ZScript do for me" section to let people know how ZScript fits in to and dovetails with the various scripting systems and text definition options available in ZDoom and some basic suggestions of the kind of thing a modder could use ZScipt for.
I know that the page currently says "ZScript (formerly known as DoomScript) is a text-format lump used to create classes or structs for use in ZDoom. It can include the names of other lumps for processing similar to DECORATE." and that's fine as a basic introduction but something to ease people in to zscript and show them what it's all about, thereby making it more accessible, would be good IMO. I would do it myself but I don't feel expert enough in ZScript. Having missed the whole thing kicking off properly, I'm a bit behind the curve and only slowly getting to grips with it myself.
Seriously though, I cannot exactly do that when I am still coming to grips with it too. I still have a lot to learn about it, and thus I cannot recommend it until someone like Graf does some of the editing himself on the wiki page.
-
- Posts: 545
- Joined: Sat Aug 30, 2014 8:21 am
Re: ZScript Documentation
No. "Cannot convert to string".Does GetClass() work in that regard?
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
Maybe this might help you.