I have an instance where an NPC relays some info to the PC and his party and then leaves the scene. I am not sure what the script would look like which I assume I would added to the conversation actions to make the NPC walk off and disappear. Any help wouldbe appreciated.
Making NPC leave and disappear after conversation
Débuté par
JonnieR
, sept. 24 2012 04:49
#1
Posté 24 septembre 2012 - 04:49
#2
Posté 24 septembre 2012 - 04:58
The function to use is ga_move_exit. Presumably you want him leaving when he's done so the function should go with the last line of the conversation.
#3
Posté 24 septembre 2012 - 06:40
ga_force_exit
Put it at the very last line of the conversation, if the NPC is the main interlocutor. Otherwise the convo gets broken as soon as the script runs.
Put it at the very last line of the conversation, if the NPC is the main interlocutor. Otherwise the convo gets broken as soon as the script runs.
#4
Posté 24 septembre 2012 - 10:57
Thanks, ga_force exit seems to work fine. But the following script does not work. The message appears but the NPCs do not spawn in at all. I am not a very skilled scripter.
//Put this script OnEnter
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
FloatingTextStringOnCreature("You come across a group of rough looking men who are menacing a small man.", oPC);
object oTarget;
object oSpawn;
location lTarget;
oTarget = oPC;
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_krevish", lTarget);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_yartarthug", lTarget);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_yartarthug", lTarget);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_yartarthug", lTarget);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_yartarthug", lTarget);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_yartarthug", lTarget);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_vasily", lTarget);
oTarget = oSpawn;
AssignCommand(oTarget, ActionStartConversation(oPC, ""));
}
//Put this script OnEnter
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
FloatingTextStringOnCreature("You come across a group of rough looking men who are menacing a small man.", oPC);
object oTarget;
object oSpawn;
location lTarget;
oTarget = oPC;
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_krevish", lTarget);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_yartarthug", lTarget);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_yartarthug", lTarget);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_yartarthug", lTarget);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_yartarthug", lTarget);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_yartarthug", lTarget);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "n_vasily", lTarget);
oTarget = oSpawn;
AssignCommand(oTarget, ActionStartConversation(oPC, ""));
}
#5
Posté 24 septembre 2012 - 11:17
Are those the template, or the tag? The template is also known as the resref, if you look at the properties of the blueprints.
#6
Posté 24 septembre 2012 - 11:28
I thought they were suppose to be the Resref template and not the tag when spawning in a creature. The references above are the resref.
#7
Posté 25 septembre 2012 - 04:36
I check everything, even created new characters to spawn in, nothing seems to be working. I must have made a error somewhere but I have not discovered it as yet.
#8
Posté 25 septembre 2012 - 05:49
I found the error, but I am confused. The script requires the resref and I had created two unique characters to be spawned in. I gave them unique tags and resref. The game would not spawn in my unique characters. So I then created a test script and used generic orcs and did not change the resref. They all spawned in as planned. How do you create unique NPCs (i.e., thugs and a thug leader) without a unique Resref since the spawn in does not use the tag which is always unique.
#9
Posté 25 septembre 2012 - 07:08
I have spawned plenty of creatures with unique tag and resref without any problem. It may be something in your blueprints properties.
Check that 'Hidden Script' is properly set to FALSE. Otw the creature is spwaned but not rendered and do not trigger collision until a special event occurs.
Sorry, my toolset in in French so the property's translation is approximative.
Check that 'Hidden Script' is properly set to FALSE. Otw the creature is spwaned but not rendered and do not trigger collision until a special event occurs.
Sorry, my toolset in in French so the property's translation is approximative.
#10
Posté 25 septembre 2012 - 08:55
Your correct. I got sloppy when I created these NPCs and the Resref was really screwed up. I fixed all that and the script works pretty well now. I expanded the script somewhat and specified waypoints to spawn in the NPCs. Otherwise they just closter around your party. Your ga_force_exit script works just as I it wanted too, Merci.
#11
Posté 26 septembre 2012 - 02:48
De rien. Glad you have solved the problem.





Retour en haut







