PDA

View Full Version : talk fight talk script issue


kdsphantom
10-15-2005, 01:20 AM
Hello ---This is for TSL-----
(Last edited 10am WED with script updates)
Some progress:
Stoffe helped me see where i was making my error, I was using the wrong tag for creatures =/ my bad, but thank you Stoffe :)
that explains why before this script "Vampire" wouldnt turn hostile.
but i still have not gotten the conditional to read or to take effect.

So its Talk to him, we fight, the userdefined script kicks in and we talk after fight, but same dialog as first conversation which makes us fight again and into a loop. I am using tk102's great dialog editor (thank you tk102 for even making it ) This script is what then is placed in the 1st condition of the dialog line, at the top of the root dialog, that is the 1st line the creature can say,

int StartingConditional() {
int nResumeTalk = GetLocalBoolean(OBJECT_SELF,0);
return nResumeTalk; }

This is the script used to get us to fight, used in the dialog to fire, after we have talked the first time.

void main()
{object oNPC= GetObjectByTag("Vampire");
ChangeToStandardFaction(oNPC, 1);
SetMinOneHP(oNPC, TRUE);
//SetMaxHP(oNPC, TRUE) dunno syntax to heal guy//
//AdjustAlignment( GetFirstPC(),ALIGNMENT_LIGHT_SIDE,5);
//ChangeToStandardFaction(OBJECT_SELF, STANDARD_FACTION_HOSTILE_1)
CreateObject( OBJECT_TYPE_CREATURE, "n_forcezomb99", Location(Vector(40.727780,-0.758573,0.00), 0.0));
CreateObject( OBJECT_TYPE_CREATURE, "n_forcezomb99", Location(Vector(40.727780,-4.758573,0.00), 0.0));
AddJournalQuestEntry("testzombie1",1); }

Question?
Why did adding ChangeToStandardFaction(OBJECT_SELF, STANDARD_FACTION_HOSTILE_1); make it work when ChangeToStandardFaction(oNPC, 1); didnt ?

and after we beat him up and we fight again how do I heal him up for the 2nd round or does he have to start out near dead? I had to add the line SetMinOneHP due to KT tools not seemingly saving the utc file with that node checked, I check it, save it but when loaded next the box is unchecked =/ or maybe im just not using it right i dunno, and im not sure the script is giving him that, well positive, as in playtesting it I kill him if im not careful.

But I am still having trouble with conditionals, and after talking to him, finally getting hostile with him and fighting him, the dialog is still at the same part it was before we fought,


This is for TSL and i still have not been able to turn the "person" in question from neutral in step one to hostile to step 2, I attached a little give Lightside points in the script file to see if it fired in game and it fires, aka i get the light side points but the "person" does not turn hostile. Im using KT tools as my GFF editor (havent figured out the other one)

I have been trying to run a talk/fight/talk script.
Following the thread posted here. http://www.lucasforums.com/showthread.php?t=126615

Doing my best to follow step by step, and again reading the other threads and trying to learn scripting. tk102 does a wonderful job of step by step explaining and teaching and I have been able to compile the scripts after heh only a few hours a work. well more like few hours of fun but I really hate syntax errors.

My questions is If i want the encounter to be a talk/fight/talk/ Fight again
like after we talked the 2nd time the bad guy didnt come around and has a death wish, the steps I took to set this up ? Can I just use another script just like the "fight" script? that will work right? Have that loaded but i cant get creature to change faction atm.

I would think you could fight again, like in TSL there are times not to spoil anything, when you do. But for the life of me i cant think of a way to script it, and where it would go? <-- I think i solved this issue on placement

and I might have spoken to soon, my scripts compiled but I havent been able to get the talk/fight/talk-(fight) sequence to work right in game yet working on it atm well until the sun comes up...

My scripts didnt fire in my mod, really just copy paste from tk's great lesson, I'm using Kt tools mod editor to place them in the conversation editor, "in this node" box. I think perhaps i just placed them in the wrong spot not knowing the correct spot, but i did that it was right.

Two of the four he said to put into the GFF script boxes, I feel really comfortable those are placed correctly.

So far i have been able to, I think get the scripts into the right places, and the dialog has fired as it should, I have not, however gotten the sequence to work right thou...

Is this script right to change his faction from neutral, to hostile at the end of the dialog tree, after you talk to him the first time and from conversation a fight breaks out?


void main()
{
object oNPC=GetObjectByTag("n_forcezomb01");
ChangeToStandardFaction(oNPC, 1);
// and if there are any thugs to fight...
CreateObject( OBJECT_TYPE_CREATURE, "n_forcezomb99", Location(Vector(40.727780,-0.758573,0.00), 0.0));
CreateObject( OBJECT_TYPE_CREATURE, "n_forcezomb99", Location(Vector(40.727780,-4.758573,0.00), 0.0));
}

it compiles but doesnt change the monster "n_forcezomb01" in this case hostile, in the monsters OnSpawn and OnUserDefine boxes in the GFF area of KT I have the 2 scripts
ONSPAWN is

#include "k_inc_generic"
void main()
{
//This will make our user-defined event fire
GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DAMAGED);
GN_SetDayNightPresence( AMBIENT_PRESENCE_ALWAYS_PRESENT);
GN_SetListeningPatterns(); GN_WalkWayPoints();
}


and OnUserDefine =

#include "k_inc_generic"
#include "k_inc_utility"
void main()
{
int nCurrentHP;
int nUser = GetUserDefinedEventNumber();
if(nUser == 1006) // DAMAGED
{
nCurrentHP=GetCurrentHitPoints();
if (nCurrentHP<10)
{
CancelCombat (OBJECT_SELF);
ClearAllActions();
ChangeToStandardFaction(OBJECT_SELF, 5);
//record that we have fought
SetLocalBoolean(OBJECT_SELF,0,TRUE);
//Turn off the imortality
SetMinOneHP(OBJECT_SELF,FALSE);
object oPC=GetFirstPC();
ActionDoCommand(ActionStartConversation(oPC));
}
}
}


code of the conditional start, this script is right from tk's thread, I dont yet understand alot of these functions to be honest. I have an idea at best atm.


int StartingConditional() {
int nResumeTalk = GetLocalBoolean(OBJECT_SELF,0);
return nResumeTalk; }


So far everything looks good the dialog is nice to work after last night, i put in the mobs spawning to see if the scripts actually fired (at a distance from standing) but atm i cant turn him hostile =/
thank you
a stumped kdsphantom