A_radiusgive is not a_radiusgiving

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.

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!)
Post Reply
User avatar
Grey-Wolf
Posts: 179
Joined: Sun Jul 15, 2018 4:59 pm
Graphics Processor: nVidia (Modern GZDoom)

A_radiusgive is not a_radiusgiving

Post by Grey-Wolf »

Hello there. I'm trying to make an inventory item receive another item in certain conditions, but the a_radiusgive command doesn't seem to be working as intended.
Here's both of them:

Code: Select all

ACTOR removeingredient : inventory {Inventory.MaxAmount 1}
(the actor to be given)

Code: Select all

ACTOR EmptyVial : inventory 30018
{
	scale 0.3
	+vulnerable
	+NOBLOOD
	+cannotpush
	Height 1
	radius 5
	Health 1
  Inventory.PickupMessage "$GOTVIAL"
  Inventory.amount 1
  Inventory.MaxAmount 10
  Inventory.Pickupsound "GLVIALPK"
  tag"empty vial"
  +thruactors
  +ROLLSPRITE
  +ROLLCENTER
  +FORCEXYBILLBOARD
  States
  (...continues)
(the actor that should receive the item)

A third actor then calls this command:

Code: Select all

A_radiusgive("removeingredient",100, RGF_ITEMS | RGF_OBJECTS | RGF_NOSIGHT , 1, "emptyvial", 0, 0, 2)
For testing purposes, I've made the Empty vial a state that checks for that item in its inventory, and if it's there, jumps to another state that makes it disappear.

Code: Select all

 State: 
    VIAL E 1 a_jumpifinventory("removeingredient",1,"Disappear")
    Loop
As you've probably guessed, the jump isn't made, sign that the item wasn't received. What is going wrong here? The only parameter I didn't use was the species' filter, which shouldn't be needed. Any ideas?
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: A_radiusgive is not a_radiusgiving

Post by Jarewill »

Setting the species argument to 0 was preventing the item from being given due to not finding the correct species, even if it did pass the actor filter.
The default value for that argument is actually None, not 0.
User avatar
Grey-Wolf
Posts: 179
Joined: Sun Jul 15, 2018 4:59 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: A_radiusgive is not a_radiusgiving

Post by Grey-Wolf »

Yup, that was it! Thank you very much!
Post Reply

Return to “Scripting”