Page 1 of 1

[weapon][zscript] set stuff on fire (Edit: also deep freeze)

Posted: Sun Jan 08, 2017 12:31 pm
by kodi
I'm pretty happy with how the burning code for my project is turning out, so I decided to share it independently for general use. It is provided as a super shotgun that ignites enemies with stacking DOT damage and fire/smoke particles. Hint: The code in the bullet puff actor can easily be adapted for a projectile if you want to make a flamethrower :)

Zscript:
Spoiler:
TEXTURES:
Spoiler:
Screenshot:
Spoiler:
EDIT:
Here's the opposite of the former, a grenade (replaces rocket launcher projectile) that freezes enemies. It's supposed to be more or less compatible with any monster replacement. I would very much appreciate bug reports on this :)
Note: it is NOT compatible with the fire code above right now and will probably crash the game if you attempt combining them.

Re: [weapon][code] set stuff on fire

Posted: Sun Jan 08, 2017 4:27 pm
by MrJohnny
Whenever I attempt to run it with GZDoom (even GZDoom 2.3.0, where ZScript is enabled by default), it throws the following error:

Code: Select all

Script error, "Firestarter.wad:DECORATE" line 1: Expected '{', got 'firestarter'.

Re: [weapon][code] set stuff on fire

Posted: Sun Jan 08, 2017 4:42 pm
by kodi
You need to put in in a lump called (or included in) "zscript" rather than "decorate" :)

Re: [weapon][code] set stuff on fire

Posted: Sun Jan 08, 2017 4:47 pm
by MrJohnny
Yeah... I guess that makes sense. :P Just gave it a whirl - pretty neat stuff. I might just use this sometime. Thanks for sharing!

EDIT: after playing for around 2-3 minutes, the game crashes to the console with this message:

Code: Select all

called from WPHitActor. StateFunction. 1 at Firestarter.wad:ZSCRIPT, line 111
called from state WPHitActor. 1 in WPHitActor

Re: [weapon][code] set stuff on fire

Posted: Mon Jan 09, 2017 5:04 pm
by Matt
Thanks! This is really helpful in trying to learn the new zscript paradigm.

So any of these actors can be referenced in DECORATE, right?

Re: [weapon][code] set stuff on fire

Posted: Mon Jan 09, 2017 5:59 pm
by kodi
Vaecrius wrote:Thanks! This is really helpful in trying to learn the new zscript paradigm.

So any of these actors can be referenced in DECORATE, right?
Glad it's of use!
I'm fairly certain you can spawn and compare these actors from DECORATE, but I've no idea what attempting inheritance will do.

Re: [weapon][code] set stuff on fire

Posted: Mon Jan 09, 2017 7:10 pm
by MrJohnny
Okay, I think you can pretty much ignore my previous post. It appears there was a typo somewhere (no typo of yours though, I have a bad habit of changing small things).

Re: [weapon][zscript] set stuff on fire (Edit: also deep fre

Posted: Wed Jan 11, 2017 5:38 am
by kodi
Updated the first post with a freeze grenade pk3. Any suggestions on code improvement/overhaul and bug reports (especially with custom monster types and other mods) is appreciated.