I'm trying to write a script that will add a NPC to the party after a certain conversation option has been met.
And I'm habinga bit of a difficulty.
I have a plot (aquae_plot) that has a flag (AQUAE_JOIN) that is set to 1after a certain conversation choice is picked.
I'm trying to write a script that will add that NPC (tag "aquae") to the party.
Since I plan to palce it in the Mage Tower, I'm not certain a area script is a good idea (methinks the mage tower has its' own area script active). So I'm sure how to proceed. Should I make it a conversation script?
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "plt_aquae_plot"
void main()
{
event eParms = GetCurrentEvent(); // Contains all input parameters
int nType = GetEventType(eParms); // GET or SET call
string strPlot = GetEventString(eParms, 0); // Plot GUID
int nFlag = GetEventInteger(eParms, 1); // The bit flag # being affected
object oPC = GetHero();
plot_GlobalPlotHandler(eParms);
if(nType == EVENT_TYPE_SET_PLOT) // actions -> normal flags only
{
if(strPlot = AQUAE_JOIN)
{
int p = GetPlotActionStatus;
if(p == TRUE)
{
object oAquae = UT_GetNearestCreatureByTag(oPC,aquae);
UT_HireFollower(oAquae);
}
else{};
}
}
}
I'm cofused ATM as to how exactly check the current status of a plot flag!
Help with script
Débuté par
Lotion Soronarr
, janv. 05 2010 07:42
#1
Posté 05 janvier 2010 - 07:42
#2
Posté 05 janvier 2010 - 11:51
Does that compile? aquae is being used as a tag and it's not in quotes. unless you defined it as a constant somewhere.
#3
Posté 26 janvier 2010 - 03:21
Lotion Soronnar wrote...
And yet ANOTHER question.
I want a NPC to move (walk, visibly) after a conversation to a new location.
Now, since this is a npc I added to a singleplayer area with a script, I can't use ambient behavior to move it.
Is there any way to make it happen or should I drop the idea?
Put a script on the end of the conversation. There's a function, I think it's AmbientStart, which you can use to specify whatever behavior you want from the ambient system. If neccessary, you can set the local variables using SetLocalString or SetLocalInt to set up whatever ambient behavior you would have were the creature placed directly in the area.
Or you could call UT_QuickMove to tell the creature to move to the waypoint.
#4
Posté 27 janvier 2010 - 08:56
You can order a creature to move to a location rather than a waypoint. As an example:
vector vPosition = Vector(1.0, 2.0, 3.0);
location lMoveTo = Location(GetArea(GetHero()), vPosition, 0.0);
command cMove = CommandMoveToLocation(lMoveTo, FALSE, FALSE);
AddCommand(oCreature, cMove);
As for the earlier question, I think that's a bug in the compiler. Try compiling it again, maybe close and re-open the file. I don't think it's anything you're doing wrong.
vector vPosition = Vector(1.0, 2.0, 3.0);
location lMoveTo = Location(GetArea(GetHero()), vPosition, 0.0);
command cMove = CommandMoveToLocation(lMoveTo, FALSE, FALSE);
AddCommand(oCreature, cMove);
As for the earlier question, I think that's a bug in the compiler. Try compiling it again, maybe close and re-open the file. I don't think it's anything you're doing wrong.





Retour en haut







