Is it possible to get an actor's TID via ACS/DECORATE?

Discuss all aspects of editing for ZDoom.
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.

Is it possible to get an actor's TID via ACS/DECORATE?

Postby Ravick » Mon Apr 30, 2012 12:50 am

I'm working in some small mods that joins some even smaller mods. Some of the smaller mods have changed the same actor, I mean, each mod has a version of the zombieman or so. I'm making spawners that can spawn the correct version depending on the current map. I got it to work fine, except by one problem: It does not transfer it's TID for the other actors. Is there a way to me to do that?

The spawners are like this one:

Code: Select allExpand view
ACTOR ZombieManSpawn : ZombieMan 3004
{
States
{
 Spawn:
    POSS AB 1
   POSS A 0 A_JumpIf(1 == (ACS_ExecuteWithResult(999,0,0,0)), "Spawn2")
   POSS A 1 A_SpawnItemEx ("Zombieman", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION| SXF_TRANSFERAMBUSHFLAG, 0)
   stop
 Spawn2:
   POSS A 1 A_SpawnItemEx ("ModdedZombieMan", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION| SXF_TRANSFERAMBUSHFLAG, 0)
   stop   
}
}


This is for a 2 maps mod.

I was thinking in change the spawned actor's via ACS, but I don't know how to get things TID.
Any idea? :?
User avatar
Ravick
Do what thou wilt, since you don't bug the hell out of me!
 
Joined: 22 Aug 2010
Location: Tubarão, Brasil

Re: Is it possible to get an actor's TID via ACS/DECORATE?

Postby Gez » Mon Apr 30, 2012 7:14 am

Well, use the tid keyword. It's one of the things supported by DECORATE expressions.
Gez
 
Joined: 06 Jul 2007

Re: Is it possible to get an actor's TID via ACS/DECORATE?

Postby Ravick » Mon Apr 30, 2012 10:57 am

Oops! Didn't know that :oops:

Thanks.
User avatar
Ravick
Do what thou wilt, since you don't bug the hell out of me!
 
Joined: 22 Aug 2010
Location: Tubarão, Brasil

Re: Is it possible to get an actor's TID via ACS/DECORATE?

Postby HellCattX » Mon Apr 30, 2012 3:38 pm

What i do for random spawners is this.
Edit the Dehacked info to this

Thing 2 (Trooper)
ID # = 21043 <------- ( enter any new number there )

Then Make a new spawner with the 3004 tid

Code: Select allExpand view
Actor ZombieManSpawner 3004
{
   +IsMonster
   Radius 20
   States
   {
   Spawn:
      TNT1 A 0
      TNT1 A 0 A_Jump(60,2)
      TNT1 A 1 A_SpawnItem(" ZombieMan1",1)
      Goto Death
      TNT1 A 0 A_Jump(128,2)
      TNT1 A 1 A_SpawnItem(" ZombieMan2",1)
      Goto Death
      TNT1 A 1 A_SpawnItem(" ZombieMan3",1)
      Stop
   Death:
      TNT1 A 0
      Stop
   }
}


now thats for a random encounter for one of the three zombiemen anyware a normal zombieman would spawn, but i am sure you can tweek it to not so random.
HellCattX
 
Joined: 26 Feb 2009

Re: Is it possible to get an actor's TID via ACS/DECORATE?

Postby Gez » Mon Apr 30, 2012 3:48 pm

HellCattX wrote:What i do for random spawners is this.

Did you know that there exist a RandomSpawner thing that is a lot better than your manual spawners?

The problem is that they do not allow for conditional spawning depending on script results like what Ravick needs, or I would have told him to use them. :P

Your spawners will not transmit the TID, spawn flags, Z height, or anything else that a correct replacer should. They will also break boss death maps (make some random mancubus replacer using your method and see what happens in Dead Simple -- or rather, what doesn't happen).
Gez
 
Joined: 06 Jul 2007

Re: Is it possible to get an actor's TID via ACS/DECORATE?

Postby HellCattX » Mon Apr 30, 2012 3:52 pm

i cant get that random spawner to work, but i never seen those issues you described before, but i never throughly tested out all the maps either. But just trying to help where i could, as it seems to work for me.
HellCattX
 
Joined: 26 Feb 2009

Re: Is it possible to get an actor's TID via ACS/DECORATE?

Postby Ravick » Mon Apr 30, 2012 6:22 pm

Thanks, guys. Help is always welcome! :)

So, I've set the master/child flag to the A_SpawnEX command, and make the spawned monsters call this script:

Code: Select allExpand view
Script 997 (void)
{
   int Tidareceber;   
   
   Tidareceber = GetActorProperty (0, APROP_MasterTID);
   Thing_ChangeTID (0, "Tidareceber");
}


But it did not work. Isn't APROP_MasterTID the TID of the master?
User avatar
Ravick
Do what thou wilt, since you don't bug the hell out of me!
 
Joined: 22 Aug 2010
Location: Tubarão, Brasil

Re: Is it possible to get an actor's TID via ACS/DECORATE?

Postby Apothem » Tue May 01, 2012 11:17 am

Try using something along the lines of print(i:activatortid()); and see what TID it's giving you to start. At the very least you should probably make a call to another script or something to print some debug output like print(s:"Lolol activator: ", i:activatortid(), s:" reporting!") for your master. Basically, my idea to it is to have two COMPLETELY separate scripts- one for the child and the other for the master. At that point you should be able to figure out what's going wrong I think. You can perform checks with things like playernumber() to make sure you're targeting a monster, and find out which one. You'll find out pretty fast by printing out your tid's to the screen what is going on I would think.

From the sounds of things, you dont have the right actor calling your TID scripts, but I'm too lazy tired to make sure that this is what's going on.

EDIT: whoops clicked submit before I finished typing, damn distractions :P
User avatar
Apothem
ACS scripting makes my head go BooM!
 
Joined: 29 Nov 2003
Location: Performing open heart surgery on an ACS compiler.

Re: Is it possible to get an actor's TID via ACS/DECORATE?

Postby Ravick » Thu May 03, 2012 12:41 am

I'll try it. But I've thought about it already, it would work well if it was only once; But the case is that each monster spawner in each map will call its own master-script instance, and every spawned children monster will call its own children-script instance too.

If it was only once, I could make the monster spawner (father/master) sent its TID to a variable and then pass it to the script of the monster child, and give this number as the new TID to the children. But I do not know how to make each instance of master-scripts send the correct value exactly to the corresponding children-script. :?

I guess it's beyond my skills. I think I will just try to contact all the authors of the smaller mods again and ask permission to make their modded actors DECORATE versions with new ednumbers, and change all the actors on their maps to the new ednumbers.
User avatar
Ravick
Do what thou wilt, since you don't bug the hell out of me!
 
Joined: 22 Aug 2010
Location: Tubarão, Brasil


Return to Editing

Who is online

Users browsing this forum: No registered users and 1 guest