I'm trying my hand at this ZDoom modding business and would like to apply some new flags/properties to all my monsters as an OPEN script, but after a few days of Googling and some experimentation I'm not really sure how to go about this. Here's some hideous pseudocode:
script "monsterChanger" OPEN
{
for every_thing_in_map
{
if CheckActorProperty(0, "ISMONSTER", true)
{
ActorSetProperty(0,APROP_DamageFactor,0.66)
}
}
}
Hopefully that's somewhat legible. What I'm trying to do specifically is provide every monster resistance a custom damagetype used by a RIPPER weapon I'm working on; as you probably know, RIPPER projectiles do damage every tic they're passing through a monster so they tend to do a lot of damage to larger demons, but I'd like some of the really tough monsters to not be rippable so simply reducing the damage of the projectiles themselves isn't satisfactory (I want the weapon to do roughly the same damage against everything, not absolutely heaps to mid-tier stuff, middling to low-tier and sweet FA to the unrippable nasties).
I thought I could use a script similar to the one above to apply a DamageFactor property based on the monster's radius vs. the projectile's speed, but I've stymied myself at the first step, ie. I don't know how to write a script that steps through every thing/monster on the map. While I could simply replace all the monsters in DECORATE, (a) that's tedious and (b), I can see some other uses for this on a per-level basis, for example having a level where monster respawning is forced on until the player does something or other/everything's fuzzy like a Spectre etc. etc. so I'd still like to know how to do it.
Anyway my questions are:
1. How do I go through every thing, as described, in a script?
2. Is the damagefactor thing I want even possible? It seems like SetActorProperty is the function to use but that seems to be only capable of setting the general damagefactor, at least if I'm reading the wiki right.
FYI I'm using DECORATE/ACS in a probably stupid attempt to have some level of cross-port compatibility. I'm willing to be talked into using ZScript if that would make my life significantly easier. Oh, and thanks for reading!
Question
Apex CHUD
Sup Doomchads,
I'm trying my hand at this ZDoom modding business and would like to apply some new flags/properties to all my monsters as an OPEN script, but after a few days of Googling and some experimentation I'm not really sure how to go about this. Here's some hideous pseudocode:
script "monsterChanger" OPEN { for every_thing_in_map { if CheckActorProperty(0, "ISMONSTER", true) { ActorSetProperty(0,APROP_DamageFactor,0.66) } } }
Hopefully that's somewhat legible. What I'm trying to do specifically is provide every monster resistance a custom damagetype used by a RIPPER weapon I'm working on; as you probably know, RIPPER projectiles do damage every tic they're passing through a monster so they tend to do a lot of damage to larger demons, but I'd like some of the really tough monsters to not be rippable so simply reducing the damage of the projectiles themselves isn't satisfactory (I want the weapon to do roughly the same damage against everything, not absolutely heaps to mid-tier stuff, middling to low-tier and sweet FA to the unrippable nasties).
I thought I could use a script similar to the one above to apply a DamageFactor property based on the monster's radius vs. the projectile's speed, but I've stymied myself at the first step, ie. I don't know how to write a script that steps through every thing/monster on the map. While I could simply replace all the monsters in DECORATE, (a) that's tedious and (b), I can see some other uses for this on a per-level basis, for example having a level where monster respawning is forced on until the player does something or other/everything's fuzzy like a Spectre etc. etc. so I'd still like to know how to do it.
Anyway my questions are:
1. How do I go through every thing, as described, in a script?
2. Is the damagefactor thing I want even possible? It seems like SetActorProperty is the function to use but that seems to be only capable of setting the general damagefactor, at least if I'm reading the wiki right.
FYI I'm using DECORATE/ACS in a probably stupid attempt to have some level of cross-port compatibility. I'm willing to be talked into using ZScript if that would make my life significantly easier. Oh, and thanks for reading!
Share this post
Link to post
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.