Aller au contenu

Photo

UT_hirefollower and strange happenings. (SOLVED)


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

#1
Sonmeister

Sonmeister
  • Members
  • 167 messages
I have a call in a conversation node, to set a plot flag that has a case, which sets up
a hire follower.  Simple enough.  Problem is that not only does it hire the follower but it
generates a new instance of the creature instead of just hiring the one with the conversation.
So then I have the original (who does not follow) and a duplicate that is following me.

Any ideas why?  I've done the same thing in another mod and it isn't a problem.

Modifié par Sonmeister, 11 février 2012 - 02:55 .


#2
Sunjammer

Sunjammer
  • Members
  • 925 messages
Are you sure it is UT_HireFollower? Have you checked your plot script to ensure that all the case statements are terminated with a break statement? If your plot script also spawns the creature you could be falling through into that logic.

Modifié par Sunjammer, 10 février 2012 - 08:56 .


#3
Sonmeister

Sonmeister
  • Members
  • 167 messages
Here's a copy of the plot script. I can't see anything wrong except maybe at the very bottom I may need another break? What do you think?

//--------------------------------------------------------------------------------------------------
/*
Plot script
*/
//--------------------------------------------------------------------------------------------------

#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "utility_h"
#include "wrappers_h"
#include "pre_objects_h"
#include "sys_ambient_h"

#include "plt_ds_spiritslayer"

// The tag of the destination
const string SS_AREA_TAG = "ds_area_three_sisters";
const string SS_FINAL_AREA = "ds_area_spiritslayer_final";
const string SS_BFORFINAL_AREA = "ds_area_spiritslayer_b4finl";
//const string SS_TOMBS = "ds_area_threesis_under"; _


// The tag of the waypoint
const string SS_AREA_WP_TAG = "entry_3sisters";
const string DS_THREE_PIN = "ds_three_sis_pin";
const string SPIRITS_WP = "four_spirit_entry";
const string DEMONSLAIR_WP = "entry_demons_lair";
const string TOMBS_WP = "three_sis_entry";

// The tag of creatures for this plot

const string DS_ARIOCH = "ds_arioch";
const string DS_ARIOCH_DEMON = "ds_arioch_demon";

const int SHAPESHIFT_IN_SMOKE = 1135;

void main()
{
// deconstruct event
event evCurrent = GetCurrentEvent();
int nEventType = GetEventType(evCurrent);
int nPlotFlag = GetEventInteger(evCurrent, 1);

// common
object oHero = GetHero();
object oDemon_form = GetObjectByTag("ds_arioch_demon");
object oArioch = GetObjectByTag("ds_arioch");
object oElric = GetObjectByTag("ds_cr_elric");
object oSpiritslayer = GetObjectByTag("sword_spiritslayer");

switch(nEventType)
{
case EVENT_TYPE_SET_PLOT:
{
int nNewValue = GetEventInteger(evCurrent, 2); // value to be assigned
int nOldValue = GetEventInteger(evCurrent, 3); // value currently assigned

switch(nPlotFlag)
{
case SPIRITSLAYER_ACCEPT:
{
object oElric = GetObjectByTag("ds_cr_elric");
SetPlotGiver(oElric, FALSE);

// Activate way point
object oMapPinRoad = GetObjectByTag(DS_THREE_PIN);
WR_SetWorldMapLocationStatus(oMapPinRoad, WM_LOCATION_ACTIVE);

break;
}
case SPIRITSLAYER_RETAINED:
{

break;
}
case SPIRITSLAYER_DONE:
{

break;
}
case SPIRITSLAYER_KEEP:
{

break;
}
case SPIRITSLAYER_ELRIC_FOLLOWER:
{
object oElric = GetObjectByTag("ds_cr_elric");
UT_HireFollower(oElric, TRUE);

break;
}
case FIRE_ELRIC:
{
object oElric = GetObjectByTag("ds_cr_elric");
UT_FireFollower(oElric, TRUE, TRUE);
Safe_Destroy_Object(oElric,2);

break;
}
case SPIRITSLAYER_DEMONLORD_DEAD:
{

break;
}
case SPIRITSLAYER_ARIOCH_TRANSFORM: // Arioch transforms into a demon
{
location lArioch = GetLocation(oArioch);

Engine_ApplyEffectAtLocation(EFFECT_DURATION_TYPE_INSTANT, EffectVisualEffect(90054), lArioch);
WR_SetObjectActive(oArioch, FALSE, 1, SHAPESHIFT_IN_SMOKE); //Set human form inactive

//fire a VFX and these two line must be together

location lDemon_form = GetLocation(oDemon_form);

Engine_ApplyEffectAtLocation(EFFECT_DURATION_TYPE_INSTANT, EffectVisualEffect(90047), lDemon_form);
WR_SetObjectActive(oDemon_form, TRUE, 1, SHAPESHIFT_IN_SMOKE); //Set Arioch Demon active

break;
}
case SENT_TO_THREE_SISTERS:
{
UT_DoAreaTransition(SS_AREA_TAG, SS_AREA_WP_TAG);

break;
}
}
break;
}
}
}

Modifié par Sonmeister, 11 février 2012 - 02:57 .


#4
Sunjammer

Sunjammer
  • Members
  • 925 messages
Do you have multiple instances of Elric in the current area or area list's areas?

Be aware that GetObjectByTag can return a reference to an object for an instance from any area in the current area list or from any global object like the world map or char_stage. Obviously the world map isn't relevant here but the others might.

You could try swapping GetObjectByTag to GetNearestObjectByTag or UT_GetNearestObjectByTag to ensure you get a reference to the instance the player is currently talking.

Modifié par Sunjammer, 11 février 2012 - 01:47 .


#5
Sonmeister

Sonmeister
  • Members
  • 167 messages
That was the problem. As soon as I changed it to UT_GetNearestObjectByTag - it worked fine. Thanks.