Aller au contenu

Photo

Spawn in a henchman


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Retpircs Wols

Retpircs Wols
  • Members
  • 18 messages
void main()
{
object oPC;
oPC = GetItemActivator ();

location oWP = GetItemActivatedTargetLocation ();

	CreateObject(OBJECT_TYPE_CREATURE, "fodmin0", oWP, FALSE);

	
	ActionForceFollowObject(GetItemActivator(), 1.0);


}

All,

 

This is probably noobish, especially since I cannot find anything on it.  Most of the promising links are no longer active.

 

I want to spawn in a character, tagged fodmin0, and would prefer it to be a henchman - one you cannot select. 

 

I use a Unique on Activate script and it gets the critter to spawn next to me, but nothing I have done will make it join my party or even follow me (last thing I tried and posted here).  Could anyone help me, please?

 

Ret

 

 



#2
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

Try with this and see if it works:

(Note: If you want to apply the tag "fodmin0" as the new tag to the creature, you need to put it as the fifth argument of the CreateObject function. The second argument is for the default tags of creatures in the toolset. Since I could not find anything named as "fodmin0" in the default folders, I decided to use "c_badger", this means that the script will spawn a badger tagged as "fodmin0". If you intend to use a different creature, just replace the "c_badger", with the original tag of said creature found in the toolset.)

void main()
{
    object oPC = GetItemActivator();
    location oWP = GetItemActivatedTargetLocation();
    object oAN = CreateObject(OBJECT_TYPE_CREATURE, "c_badger", oWP, FALSE, "fodmin0");
    DelayCommand(0.1, AddHenchman(oPC, oAN));
}


#3
Retpircs Wols

Retpircs Wols
  • Members
  • 18 messages

Thank you, ClanGeddin.  That did it.  I had tried the AddHenchman function at one point, but I had the arguments switched.

 

FodMin0 is the tag of a poor goblin-like creature with the companion script set.  Its name is Fodder Minion.  And, now he plays the part.

 

Ret