Monster that checks any dead monsters near him to loot.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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.

Monster that checks any dead monsters near him to loot.

Postby Alice Grimhall » Thu Jul 29, 2021 1:02 pm

Hello, I recquire some help for monster coding, and I haven't found any way to achieve what i'm looking for.

Basically, I want a monster to check any dead monsters near him to start looting them.
I know I should use A_CheckProximity, but I can't specify ANY monster in the actor section.

Is there an alternative way to do it ? If ACS is necessary , i'm afraid I can't use it because I know nothing about it...
Alice Grimhall
 

Re: Monster that checks any dead monsters near him to loot.

Postby Jarewill » Thu Jul 29, 2021 1:23 pm

I don't know if it's possible purely in DECORATE, but you can do that using ZScript as shown here.
ZScript mostly looks like DECORATE and you don't even need to rewrite your monster fully, simply create a new monster in ZScript with the above function and inherit from it in DECORATE.

Example of the above taken straight from my mod:
Spoiler:
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Monster that checks any dead monsters near him to loot.

Postby Alice Grimhall » Thu Jul 29, 2021 1:33 pm

Thank you for your reply, I still need to figure out how to use ZScript, as I probably never used it ever, but this could probably be what i'm looking for.
Is there any good guides about ZScript to make monsters ? I'd be extremely grateful !
Alice Grimhall
 

Re: Monster that checks any dead monsters near him to loot.

Postby Jarewill » Thu Jul 29, 2021 1:52 pm

For the most part, ZScript is like DECORATE and you can see the differences on this page.
The only things that are really different are the ability to make functions.
For example, instead of writing this:
Spoiler:

You can make this:
Spoiler:

As well as being able to define variables for actors. (Even for weapons)
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Monster that checks any dead monsters near him to loot.

Postby Alice Grimhall » Thu Jul 29, 2021 2:12 pm

Oh wow it really makes the script looks way cleaner ! I had no idea this was so much better, thank you very much !
I'll try to use this to make what I had in mind, thanks :)
Alice Grimhall
 


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests