[ACS] Another way for A_RadiusGive but on ACS?
[ACS] Another way for A_RadiusGive but on ACS?
Boop, is there a way to give everything an inventory via ACS?
By everything I mean PROJECTILES - MONSTERS - PLAYERS and possibly some other stuff I'm missing.
Like, I either dont know if A_RadiusGive(stuff,stuff,RGF_MISSILES,1) actually works (because slade keeps throwing an error) or I don't know how to use it.
By everything I mean PROJECTILES - MONSTERS - PLAYERS and possibly some other stuff I'm missing.
Like, I either dont know if A_RadiusGive(stuff,stuff,RGF_MISSILES,1) actually works (because slade keeps throwing an error) or I don't know how to use it.
[ACS] Re: Another way for A_RadiusGive but on ACS?
What is the code that is causing an error, and what is the error?
"For the world is hollow, and I have touched the sky."
[ACS] Re: Another way for A_RadiusGive but on ACS?
"unknown identifier RGF_MISSILES" from the A_Radius give, thats why I'm looking for another workaround
[ACS] Re: Another way for A_RadiusGive but on ACS?
I think a more interesting question is why are you trying to give every single actor an inventory item. Question needs context.
Upfront though, I don't think it's possibly to do that. For one, that DECORATE function doesn't have all the flags that are in the current build of GZDoom so most likely whatever flag you're trying to apply just isn't supported in Zandronum. Another thing is even if you recreate the function in ACS there still isn't a way to interact and directly control actors that are within whatever radius you have. You can do it with players because you know players have their own id's you can refer to and keep track of, etc, but when it comes to items or projectiles on the other hand... Yeah not so much.
Upfront though, I don't think it's possibly to do that. For one, that DECORATE function doesn't have all the flags that are in the current build of GZDoom so most likely whatever flag you're trying to apply just isn't supported in Zandronum. Another thing is even if you recreate the function in ACS there still isn't a way to interact and directly control actors that are within whatever radius you have. You can do it with players because you know players have their own id's you can refer to and keep track of, etc, but when it comes to items or projectiles on the other hand... Yeah not so much.
<Dynamo_>uh
<Dynamo_>did you just take the thread away
<FusedQyou>Dunno
<FusedQyou>ask the thread
<Dynamo_>did you just take the thread away
<FusedQyou>Dunno
<FusedQyou>ask the thread
-
- Retired Staff / Community Team Member
- Posts: 2558
- Joined: Sat Jun 02, 2012 2:44 am
[ACS] Re: Another way for A_RadiusGive but on ACS?
Is a_radiusgive even in Zandronum? If so then just create an actor in decorate that exists for 1 tic which calls a_radiusgive and then spawn it using ACS.
[ACS] Re: Another way for A_RadiusGive but on ACS?
Okok, heres a bit more context (I think)
Since RGF_MISSILES (for A_Radiusgive) is nonexistant at the moment, I wanted to give everything an item (custominventory) that checks it's flags
if it had whatever the "PROJECTILE" combo flag gives in it, it would succesfully do whatever thing it's supposed to do if it had the flags
Said pickup would be given to everything (because again, RGF_MISSILES is nonexistant), players - monsters - pickups laying around, but since I THINK none of the 3 use the projectile combo it just wouldn't do anything unless it was a projectile
Since RGF_MISSILES (for A_Radiusgive) is nonexistant at the moment, I wanted to give everything an item (custominventory) that checks it's flags
if it had whatever the "PROJECTILE" combo flag gives in it, it would succesfully do whatever thing it's supposed to do if it had the flags
Code: Select all
actor IsProjectilePickup : Custominventory
{
Pickup:
TNT1 A 0
TNT1 A 0 A_CheckFlag("MISSILE","NextCheck-NoGravity") //Or A_CheckFlag("PROJECTILE","stuffstuff") if it even works
stop
NextCheck-NoGravity:
TNT1 A 0 A_CheckFlag("NOGRAVITY","MoreStuff")
stop
}
[ACS] Re: Another way for A_RadiusGive but on ACS?
A possible workaround might be to make a custom version of every projectile, and have them do the stuff you want. Whether that would work depends largely on what stuff you are trying to do.
A_RadiusGive is indeed in Zandronum. It was added in 3.0. I use it for the healing function in my OPWeapons, so players can heal themselves and other players nearby.
A_RadiusGive is indeed in Zandronum. It was added in 3.0. I use it for the healing function in my OPWeapons, so players can heal themselves and other players nearby.
"For the world is hollow, and I have touched the sky."
[ACS] Re: Another way for A_RadiusGive but on ACS?
Hmmm... Seem to have found a workaround that actually works, sadly, it depends on A_SpawnItemEx because A_FireCustomMissile can't pass tids.
And it can also give the stuff to players if the user_CustomID is set to 0, the only thing (at least the one I notice) is that if the owner fires a lot of the same projectile, the script would give it to every projectile that is currently spawned. And works only on own projectiles so far.
Note: The real script is a bit more large and has more stuff in it, but this works the same way.
Code: Select all
//This is the thing that is going to be given the Item, called from a weapon.
A_SpawnItemEx("MAGICMISSILE",0,8,32,cos(pitch)*30,0,sin(-pitch)*30,0,1,0,tid+1000)
=========
//This is the actor that calls the RadiusGiveLikeScript
actor TestingRadiusGive {
PROJECTILE
var int user_CustomID;
States
{
Spawn:
TNT1 A 0
TNT1 A 1
TNT1 A 0 A_SetUserVar("user_CustomID",1000) //Which things to give the projectile to
TNT1 A 0 ACS_NamedExecuteAlways("WIZ_TEAMGIVER",0,256,1,1)
loop
}
}
Code: Select all
str WizardyItems[6]={
"Item1", //0
"Item2", //1
"Stuff" //2
};
script "WIZ_TEAMGIVER" (int range, int WhichItem, int Amount)
{
int Target_TID;
int Owner = ActivatorTID();
int user_ID = GetUserVariable(Owner,"user_CustomID");
int OwnerNumber = PlayerNumber();
if ( ActivatorTID() == 0 ) {SetActivatorToTarget(0);} //If its called from a projectile, set the activator to the player that fired it.
for(int i=0; i<32; i++) {
if (owner != 1000 + i) {
if(distanceVal(x,y, 1000+i) < range) {
Target_TID = 1000+i;
//For TeamGames
/*If(GetPlayerInfo(OwnerNumber,PLAYERINFO_TEAM)==GetPlayerInfo(Target_TID-1000,PLAYERINFO_TEAM))
{
GiveActorInventory(Target_TID+user_ID,ItemList[WhichItem],Amount);
terminate;
}*/
//For everyone
GiveActorInventory(Target_TID+user_ID,ItemList[WhichItem],Amount); //Gives the item.
terminate;
}
}
}
}
function int distanceVal (int tid1x, int tid1y, int tid2)
{
int x, y, d;
x = tid1x - GetActorX(tid2) >> 16; //Convert fixed point to integer
y = tid1y - GetActorY(tid2) >> 16;
d = sqrt8( x*x + y*y );
return d;
}
Note: The real script is a bit more large and has more stuff in it, but this works the same way.
[ACS] Re: Another way for A_RadiusGive but on ACS?
custom damagetypes and a_explode
it’s hacky but it probably works
it’s hacky but it probably works
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community