lfnetwork.com mark read register faq members calendar

Thread: Just a quick check in with the scripters
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 02-23-2015, 10:37 AM   #1
darthtyren
Rookie
 
darthtyren's Avatar
 
Join Date: May 2011
Location: Kotor Tool folder
Posts: 161
DarthTyren's Endless Scripting Problems/Questions

I released my first mod a while back here.

I decided I wanted to update it with a way to get the new items in the game without cheating, so I found the script that assigns the advanced classes and added an ActionGiveItem command to each parameter.

*I added the stuff in red*

Code:
// This makes the PC one of the Jedi classes, depending on parameter.
// Param Count = 1, decides which class to make him or her.
// 0 = Weaponmaster
// 1 = Watchman
// 2 = Jedi Master
// 3 = Marauder
// 4 = Sith Assassin
// 5 = Sith Lord
// CFA 10-6-04

void main()
{
    // Grab the Parameter.
    int nScriptNumber = GetScriptParameter( 1 );

    // If Param = 0, then make him a Jedi Weaponmaster.
    if ( nScriptNumber == 0 ) {
        AddMultiClass (CLASS_TYPE_JEDIWEAPONMASTER, GetFirstPC () );
        ActionGiveItem(object a_robe_43, object GetFirstPC());
    }

    // If Param = 1, then make him a Jedi Watchman.
    if ( nScriptNumber == 1 ) {
        AddMultiClass (CLASS_TYPE_JEDIWATCHMAN, GetFirstPC () );
        ActionGiveItem(object a_robe_44, object GetFirstPC());
    }

    // If Param = 2, then make him a Jedi Master.
    if ( nScriptNumber == 2 ) {
        AddMultiClass (CLASS_TYPE_JEDIMASTER, GetFirstPC () );
        ActionGiveItem(object a_robe_45, object GetFirstPC());
    }

    // If Param = 3, then make him a Sith Marauder.
    if ( nScriptNumber == 3 ) {
        AddMultiClass (CLASS_TYPE_SITHMARAUDER, GetFirstPC () );
        ActionGiveItem(object a_robe_46, object GetFirstPC());
    }

    // If Param = 4, then make him a Sith Assassin.
    if ( nScriptNumber == 4 ) {
        AddMultiClass (CLASS_TYPE_SITHASSASSIN, GetFirstPC () );
        ActionGiveItem(object a_robe_47, object GetFirstPC());
    }

    // If Param = 5, then make him a Sith Lord.
    if ( nScriptNumber == 5 ) {
        AddMultiClass (CLASS_TYPE_SITHLORD, GetFirstPC () );
        ActionGiveItem(object a_robe_48, object GetFirstPC());
    }

}
I'm a total n00b when it comes to scripting, so I ask my fellow modders: Does this look right, or am I doing something wrong?

I haven't tested yet.


Good with dialogues and getting better
Working on Scripting and Module Editing/Re-skinning
Started work on Modeling New Areas

Last edited by darthtyren; 02-27-2015 at 07:01 PM.
darthtyren is online now   you may: quote & reply,
Old 02-23-2015, 01:34 PM   #2
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 651
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by darthtyren View Post
I released my first mod a while back here.

I decided I wanted to update it with a way to get the new items in the game without cheating, so I found the script that assigns the advanced classes and added an ActionGiveItem command to each parameter.

*I added the stuff in red*

Show spoiler


I'm a total n00b when it comes to scripting, so I ask my fellow modders: Does this look right, or am I doing something wrong?

I haven't tested yet.
Your code is mostly right, but the game wouldn't know what the objects were. The code below will work:

Code:
// This makes the PC one of the Jedi classes, depending on parameter.
// Param Count = 1, decides which class to make him or her.
// 0 = Weaponmaster
// 1 = Watchman
// 2 = Jedi Master
// 3 = Marauder
// 4 = Sith Assassin
// 5 = Sith Lord
// CFA 10-6-04

void main()
{
    // Grab the Parameter.
    int nScriptNumber = GetScriptParameter( 1 );
    string sItemtag = "";

    // If Param = 0, then make him a Jedi Weaponmaster.
    if ( nScriptNumber == 0 ) {
        AddMultiClass (CLASS_TYPE_JEDIWEAPONMASTER, GetFirstPC () );
        sItemtag = "a_robe_43";
        CreateItemOnObject(sItemtag, GetFirstPC());
    }

    // If Param = 1, then make him a Jedi Watchman.
    if ( nScriptNumber == 1 ) {
        AddMultiClass (CLASS_TYPE_JEDIWATCHMAN, GetFirstPC () );
        sItemtag = "a_robe_44";
        CreateItemOnObject(sItemtag, GetFirstPC());
    }

    // If Param = 2, then make him a Jedi Master.
    if ( nScriptNumber == 2 ) {
        AddMultiClass (CLASS_TYPE_JEDIMASTER, GetFirstPC () );
        sItemtag = "a_robe_45";
        CreateItemOnObject(sItemtag, GetFirstPC());
    }

    // If Param = 3, then make him a Sith Marauder.
    if ( nScriptNumber == 3 ) {
        AddMultiClass (CLASS_TYPE_SITHMARAUDER, GetFirstPC () );
        sItemtag = "a_robe_46";
        CreateItemOnObject(sItemtag, GetFirstPC());
    }

    // If Param = 4, then make him a Sith Assassin.
    if ( nScriptNumber == 4 ) {
        AddMultiClass (CLASS_TYPE_SITHASSASSIN, GetFirstPC () );
        sItemtag = "a_robe_47";
        CreateItemOnObject(sItemtag, GetFirstPC());
    }

    // If Param = 5, then make him a Sith Lord.
    if ( nScriptNumber == 5 ) {
        AddMultiClass (CLASS_TYPE_SITHLORD, GetFirstPC () );
        sItemtag = "a_robe_48";
        CreateItemOnObject(sItemtag, GetFirstPC());
    }
}
As to where you went wrong with the above script:

You don't need to define the item type when you pass the info to a function. For example, GetFirstPC() is an Object Function and so represents an object when you use it. The game will know it is an object already.

Also, ActionGiveItem is an action and is assigned to an object. For this to work, you would have to assign the command to an object and that object would have to have that item in it's possession. Which brings me to my last point.

"
"object a_robe_43" -- The game has no clue what this is. For an object to have meaning, you would need to assign something to it. This can be done with a lot of functions depending on the situation.

For example:
  • GetObjectByTag -- This is used if the object already exists in the game world, which usually does not count one's inventory...
  • GetFirstPC/GetNextPC -- Cycles through the current party members
  • GetPartyMemberByIndex -- also used to cycle through the current party
  • GetFirstItemInInventory/GetNexItemInInventory -- Cycles through an object's inventory, retruring an object which you can then check the tag against using GetTag.
  • GetItemPossessedBy/GetItemPossessor -- Both of these sees if something has an item, but the first uses the supposed owner and the second uses the item.
  • CreateItemOnObject/CreateItemOnFloor/CreateObject -- The first is for cutscenes, the second will create something in the object's inventory, and the last is used to create any type of item/placeable/creature/door, .etc in general


All of my mods are available on Deadlystream.

Always remember modders: "Quality= Effort*Time"

KSE 3.3.4 is LIVE!!! Check it out here.

Check out WalkSwitch, the Walkmesh-changing tool!
Fair Strides 2 is offline   you may: quote & reply,
Old 02-23-2015, 04:47 PM   #3
darthtyren
Rookie
 
darthtyren's Avatar
 
Join Date: May 2011
Location: Kotor Tool folder
Posts: 161
EDIT: Thanks, Fair Strides, it worked.

Quote:
Originally Posted by Fair Strides 2 View Post
As to where you went wrong with the above script:

You don't need to define the item type when you pass the info to a function. For example, GetFirstPC() is an Object Function and so represents an object when you use it. The game will know it is an object already.
I figured that might be the case, just was checking.

Quote:
Originally Posted by Fair Strides 2 View Post
Also, ActionGiveItem is an action and is assigned to an object. For this to work, you would have to assign the command to an object and that object would have to have that item in it's possession.
Fundamentally, would that mean inside a container, or on another NPC, or in the inventory?

Or all three?

Quote:
Originally Posted by Fair Strides 2 View Post
Which brings me to my last point.

"
"object a_robe_43" -- The game has no clue what this is. For an object to have meaning, you would need to assign something to it. This can be done with a lot of functions depending on the situation.

For example:
  • GetObjectByTag -- This is used if the object already exists in the game world, which usually does not count one's inventory...
  • GetFirstPC/GetNextPC -- Cycles through the current party members
  • GetPartyMemberByIndex -- also used to cycle through the current party
  • GetFirstItemInInventory/GetNexItemInInventory -- Cycles through an object's inventory, retruring an object which you can then check the tag against using GetTag.
  • GetItemPossessedBy/GetItemPossessor -- Both of these sees if something has an item, but the first uses the supposed owner and the second uses the item.
  • CreateItemOnObject/CreateItemOnFloor/CreateObject -- The first is for cutscenes, the second will create something in the object's inventory, and the last is used to create any type of item/placeable/creature/door, .etc in general
So the CreateItemOnObject function would be used to add an item to the inventory using a script? At least, that's what I'm gathering.

I'm sorry if I'm not making sense - I have a long way to go to understanding KOTOR Language.


Good with dialogues and getting better
Working on Scripting and Module Editing/Re-skinning
Started work on Modeling New Areas

Last edited by darthtyren; 02-24-2015 at 10:53 AM.
darthtyren is online now   you may: quote & reply,
Old 02-25-2015, 05:50 PM   #4
darthtyren
Rookie
 
darthtyren's Avatar
 
Join Date: May 2011
Location: Kotor Tool folder
Posts: 161
I know there's a no-double-post rule, but honestly, who would come back to read a re-edited post?

OK, so new script, new problem. In the "new game script", a.k.a. a_bet3m4, there's a function that sets the Player's gender as a Global Boolean, 000_PLAYER_GENDER. It, in regards to the script, is as follows:

*it's in cyan, a little over halfway down*
Code:
// Prototypes
void sub3(object objectParam1, int intParam2);
void sub2();
void sub1();

void sub3(object objectParam1, int intParam2) {
	object oRWeapItem = GetItemInSlot(4, objectParam1);
	AssignCommand(objectParam1, ActionUnequipItem(oRWeapItem, 1));
	if (intParam2) {
		DestroyObject(oRWeapItem, 0.0, 1, 0.0, 1);
	}
}

void sub2() {
	AddAvailableNPCByTemplate(8, "p_t3m4");
	SwitchPlayerCharacter(8);
	sub3(GetObjectByTag("t3m4", 0), 1);
	SetMinOneHP(GetObjectByTag("t3m4", 0), 1);
	AssignCommand(GetObjectByTag("debris", 0), ApplyEffectToObject(0, EffectDamage(25, 8, 0), GetObjectByTag("t3m4", 0), 0.0));
	DisableHealthRegen(1);
	ApplyEffectToObject(2, EffectVisualEffect(2067, 0), GetObjectByTag("t3m4", 0), 0.0);
}

void sub1() {
	if ((GetGlobalNumber("001EBO_Rumble") == 0)) {
		DelayCommand(IntToFloat((Random(10) + 10)), sub1());
		AurPostString("Rumbling", 5, 5, 5.0);
		PlaySound("MetalStrain");
		ApplyEffectToObject(1, EffectVisualEffect(6002, 0), GetFirstPC(), IntToFloat((Random(8) + 1)));
	}
}

void main() {
	if (GetLoadFromSaveGame()) {
		return;
	}
	if (GetIsPC(GetEnteringObject())) {
		if ((!GetLocalBoolean(OBJECT_SELF, 30))) {
			SetLocalBoolean(OBJECT_SELF, 30, 1);
			sub1();
			RevealMap([0.0,0.0,0.0], 0xFFFFFFFF);
		}
		if (GetGlobalNumber("002EBO_Door_Override")) {
			object oStar_dorm = GetObjectByTag("star_dorm", 0);
			AssignCommand(oStar_dorm, ActionOpenDoor(oStar_dorm));
		}
		int nGlobal = GetGlobalNumber("001EBO_BEEN_T3_M4");
		if ((!nGlobal)) {
			if ((0 == GetGender(GetFirstPC()))) {
				SetGlobalBoolean("000_PLAYER_GENDER", 1);
			}
			SetGlobalNumber("001EBO_BEEN_T3_M4", 1);
			DelayCommand(0.2, sub2());
			object oC_medbaypc = GetObjectByTag("MEDBAY_PC", 0);
			if ((!GetIsObjectValid(oC_medbaypc))) {
				object oInvisibleLocationMarker = GetObjectByTag("InvisibleLocationMarker", 0);
				location location1 = GetLocation(oInvisibleLocationMarker);
				oC_medbaypc = CreateObject(1, "c_medbaypc", location1, 0);
				int int9 = GetAppearanceType(GetEnteringObject());
				effect effect1 = EffectDisguise(int9);
				ApplyEffectToObject(2, effect1, oC_medbaypc, 0.0);
				AssignCommand(oC_medbaypc, ActionPlayAnimation(30, 1.0, (-1.0)));
			}
		}
		SetGlobalNumber("GBL_MAIN_SITH_LORD", 0);
		if ((GetGlobalNumber("001EBO_Movie") == 0)) {
			SetGlobalNumber("001EBO_Movie", 1);
			PlayMovie("permov01", 0);
			SetGlobalFadeOut(0.0, 0.0, 0.0, 0.0, 0.0);
			SetFadeUntilScript();
			AssignCommand(GetObjectByTag("Prologue", 0), ActionStartConversation(OBJECT_SELF, "intro", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));
		}
	}
}
I could be wrong, but this is my understanding: What the function does is if the GetGender(GetFirstPC()) returns as 0, then the boolean is set to TRUE, which is what the game checks for if a certain action requires the PC to be a male.

Now comes the problem: I put the same function in a script that is fired the same way - using the .ARE OnEnter field.

Code:
void main(){
  if (GetLoadFromSaveGame()) {
    return;
  }
  if ((0 == GetGender(GetFirstPC()))) {
    SetGlobalBoolean("000_PLAYER_GENDER", 1);
  }
  if ((GetLevelByClass(CLASS_TYPE_JEDISENTINEL, GetFirstPC()) == 1)) {
    SetGlobalNumber("000_PLAYER_CLASS", 1);
  }
  if ((GetLevelByClass(CLASS_TYPE_JEDICONSULAR, GetFirstPC()) == 1)) {
    SetGlobalNumber("000_PLAYER_CLASS", 2);
  }
  PlayMovie("hot01");
  
}
The other functions work, but the Gender one doesn't. I checked the GLOBALVARS.res save file in KotOR Tool, but the Boolean is set to FALSE, or female.

BTW, this script is incomplete. I plan on adding two equip functions, a warp to waypoint, and start conversation, all of which is on hold until preparations can be made for the appearance.2da, as well as the UTCs.


Good with dialogues and getting better
Working on Scripting and Module Editing/Re-skinning
Started work on Modeling New Areas
darthtyren is online now   you may: quote & reply,
Old 02-25-2015, 06:08 PM   #5
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 651
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by darthtyren View Post
I know there's a no-double-post rule, but honestly, who would come back to read a re-edited post?

OK, so new script, new problem. In the "new game script", a.k.a. a_bet3m4, there's a function that sets the Player's gender as a Global Boolean, 000_PLAYER_GENDER. It, in regards to the script, is as follows:

*it's in cyan, a little over halfway down*
Code:
// Prototypes
void sub3(object objectParam1, int intParam2);
void sub2();
void sub1();

void sub3(object objectParam1, int intParam2) {
	object oRWeapItem = GetItemInSlot(4, objectParam1);
	AssignCommand(objectParam1, ActionUnequipItem(oRWeapItem, 1));
	if (intParam2) {
		DestroyObject(oRWeapItem, 0.0, 1, 0.0, 1);
	}
}

void sub2() {
	AddAvailableNPCByTemplate(8, "p_t3m4");
	SwitchPlayerCharacter(8);
	sub3(GetObjectByTag("t3m4", 0), 1);
	SetMinOneHP(GetObjectByTag("t3m4", 0), 1);
	AssignCommand(GetObjectByTag("debris", 0), ApplyEffectToObject(0, EffectDamage(25, 8, 0), GetObjectByTag("t3m4", 0), 0.0));
	DisableHealthRegen(1);
	ApplyEffectToObject(2, EffectVisualEffect(2067, 0), GetObjectByTag("t3m4", 0), 0.0);
}

void sub1() {
	if ((GetGlobalNumber("001EBO_Rumble") == 0)) {
		DelayCommand(IntToFloat((Random(10) + 10)), sub1());
		AurPostString("Rumbling", 5, 5, 5.0);
		PlaySound("MetalStrain");
		ApplyEffectToObject(1, EffectVisualEffect(6002, 0), GetFirstPC(), IntToFloat((Random(8) + 1)));
	}
}

void main() {
	if (GetLoadFromSaveGame()) {
		return;
	}
	if (GetIsPC(GetEnteringObject())) {
		if ((!GetLocalBoolean(OBJECT_SELF, 30))) {
			SetLocalBoolean(OBJECT_SELF, 30, 1);
			sub1();
			RevealMap([0.0,0.0,0.0], 0xFFFFFFFF);
		}
		if (GetGlobalNumber("002EBO_Door_Override")) {
			object oStar_dorm = GetObjectByTag("star_dorm", 0);
			AssignCommand(oStar_dorm, ActionOpenDoor(oStar_dorm));
		}
		int nGlobal = GetGlobalNumber("001EBO_BEEN_T3_M4");
		if ((!nGlobal)) {
			if ((0 == GetGender(GetFirstPC()))) {
				SetGlobalBoolean("000_PLAYER_GENDER", 1);
			}
			SetGlobalNumber("001EBO_BEEN_T3_M4", 1);
			DelayCommand(0.2, sub2());
			object oC_medbaypc = GetObjectByTag("MEDBAY_PC", 0);
			if ((!GetIsObjectValid(oC_medbaypc))) {
				object oInvisibleLocationMarker = GetObjectByTag("InvisibleLocationMarker", 0);
				location location1 = GetLocation(oInvisibleLocationMarker);
				oC_medbaypc = CreateObject(1, "c_medbaypc", location1, 0);
				int int9 = GetAppearanceType(GetEnteringObject());
				effect effect1 = EffectDisguise(int9);
				ApplyEffectToObject(2, effect1, oC_medbaypc, 0.0);
				AssignCommand(oC_medbaypc, ActionPlayAnimation(30, 1.0, (-1.0)));
			}
		}
		SetGlobalNumber("GBL_MAIN_SITH_LORD", 0);
		if ((GetGlobalNumber("001EBO_Movie") == 0)) {
			SetGlobalNumber("001EBO_Movie", 1);
			PlayMovie("permov01", 0);
			SetGlobalFadeOut(0.0, 0.0, 0.0, 0.0, 0.0);
			SetFadeUntilScript();
			AssignCommand(GetObjectByTag("Prologue", 0), ActionStartConversation(OBJECT_SELF, "intro", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));
		}
	}
}
I could be wrong, but this is my understanding: What the function does is if the GetGender(GetFirstPC()) returns as 0, then the boolean is set to TRUE, which is what the game checks for if a certain action requires the PC to be a male.

Now comes the problem: I put the same function in a script that is fired the same way - using the .ARE OnEnter field.

Code:
void main(){
  if (GetLoadFromSaveGame()) {
    return;
  }
  if ((0 == GetGender(GetFirstPC()))) {
    SetGlobalBoolean("000_PLAYER_GENDER", 1);
  }
  if ((GetLevelByClass(CLASS_TYPE_JEDISENTINEL, GetFirstPC()) == 1)) {
    SetGlobalNumber("000_PLAYER_CLASS", 1);
  }
  if ((GetLevelByClass(CLASS_TYPE_JEDICONSULAR, GetFirstPC()) == 1)) {
    SetGlobalNumber("000_PLAYER_CLASS", 2);
  }
  PlayMovie("hot01");
  
}
The other functions work, but the Gender one doesn't. I checked the GLOBALVARS.res save file in KotOR Tool, but the Boolean is set to FALSE, or female.

BTW, this script is incomplete. I plan on adding two equip functions, a warp to waypoint, and start conversation, all of which is on hold until preparations can be made for the appearance.2da, as well as the UTCs.
Seeing as it is the OnEnter script, the players aren't technically loaded up yet.

Assuming the Player's character is the only one in the party, you can do this:

Code:
void main(){
  if (GetLoadFromSaveGame()) {
    return;
  }
  if(GetIsPC(GetEnteringObject()))
  {
      object oPC = GetEnteringObject();
      if ((0 == GetGender(oPC))) {
        SetGlobalBoolean("000_PLAYER_GENDER", 1);
      }
      if ((GetLevelByClass(CLASS_TYPE_JEDISENTINEL, oPC) == 1)) {
        SetGlobalNumber("000_PLAYER_CLASS", 1);
      }
      if ((GetLevelByClass(CLASS_TYPE_JEDICONSULAR, oPC) == 1)) {
        SetGlobalNumber("000_PLAYER_CLASS", 2);
      }
      if ((GetLevelByClass(CLASS_TYPE_JEDIGUARDIAN, oPC) == 1)) {
        SetGlobalNumber("000_PLAYER_CLASS", 3);
      }
  }
  PlayMovie("hot01");
  
}
However, unless it was designed that way, you forgot a check for Jedi Guardian, so I added it in there.


All of my mods are available on Deadlystream.

Always remember modders: "Quality= Effort*Time"

KSE 3.3.4 is LIVE!!! Check it out here.

Check out WalkSwitch, the Walkmesh-changing tool!
Fair Strides 2 is offline   you may: quote & reply,
Old 02-25-2015, 06:47 PM   #6
darthtyren
Rookie
 
darthtyren's Avatar
 
Join Date: May 2011
Location: Kotor Tool folder
Posts: 161
That didn't fix it. The GLOBALVARS still says FALSE. My character is definitely a guy, but the game is telling me it's a girl.

And I decided I was going to leave the Guardian at a value of 0. Kudos to you, sir, for catching on.


Good with dialogues and getting better
Working on Scripting and Module Editing/Re-skinning
Started work on Modeling New Areas
darthtyren is online now   you may: quote & reply,
Old 02-25-2015, 07:11 PM   #7
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 651
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by darthtyren View Post
That didn't fix it. The GLOBALVARS still says FALSE. My character is definitely a guy, but the game is telling me it's a girl.

And I decided I was going to leave the Guardian at a value of 0. Kudos to you, sir, for catching on.
In that case, you might try putting the 0 on the right side of the == sign.

Also, trying adding this just above it:

SendMessageToPC(GetEnteringObject(), "Gender is: " + IntToString(GetGender(GetEnteringObject)));


All of my mods are available on Deadlystream.

Always remember modders: "Quality= Effort*Time"

KSE 3.3.4 is LIVE!!! Check it out here.

Check out WalkSwitch, the Walkmesh-changing tool!
Fair Strides 2 is offline   you may: quote & reply,
Old 02-25-2015, 07:44 PM   #8
darthtyren
Rookie
 
darthtyren's Avatar
 
Join Date: May 2011
Location: Kotor Tool folder
Posts: 161
Added the function, but there was a compiling problem.

Show spoiler


Looks like SendMessageToPC doesn't like GetEnteringObject... I think?


Good with dialogues and getting better
Working on Scripting and Module Editing/Re-skinning
Started work on Modeling New Areas
darthtyren is online now   you may: quote & reply,
Old 02-25-2015, 08:00 PM   #9
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 651
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by darthtyren View Post
Added the function, but there was a compiling problem.

Show spoiler


Looks like SendMessageToPC doesn't like GetEnteringObject... I think?
My mistake. The second GetEnteringObject needs the ()


All of my mods are available on Deadlystream.

Always remember modders: "Quality= Effort*Time"

KSE 3.3.4 is LIVE!!! Check it out here.

Check out WalkSwitch, the Walkmesh-changing tool!
Fair Strides 2 is offline   you may: quote & reply,
Old 02-25-2015, 09:09 PM   #10
darthtyren
Rookie
 
darthtyren's Avatar
 
Join Date: May 2011
Location: Kotor Tool folder
Posts: 161
It compiled correctly that time. And the message showed up in feedback screen: Gender is: 0.

Tried it again with a female: Gender is: 1

Opened Up GLOBALVARS: Still not making a difference.

EDIT: Okay, so this is very strange, but on a hunch I decided to check out the Globals according to KotOR Tool and match them up against the Globals that KSE shows me. As fortune would have it, the GlobalVars file still says that the Boolean is inactive, but KSE says it is active.

Show spoiler


I have yet to try anything out with this information. But now I have another question: Wouldn't it be easier just to tell the game to set the value to "TRUE" rather than "1"? Or are they the same?

Reason I ask is because I will be using the game's global "Gender Check" scripts at certain points. Those scripts look for "TRUE/FALSE" values, not the numeric "0/1".

Again, sorry if I sound like a n00b. I am one.


Good with dialogues and getting better
Working on Scripting and Module Editing/Re-skinning
Started work on Modeling New Areas

Last edited by darthtyren; 02-26-2015 at 08:38 AM.
darthtyren is online now   you may: quote & reply,
Old 02-27-2015, 07:53 AM   #11
darthtyren
Rookie
 
darthtyren's Avatar
 
Join Date: May 2011
Location: Kotor Tool folder
Posts: 161
Guess what! New post + new script = new problem. Need I say more?

Anyway, I was kind of following this tutorial, but rather than destroying the NPC, I wanted the NPC to jump to another waypoint when it reaches the first.

*SYNTAX ERROR in ORANGE
Code:
void main(){
  object oNPC = GetObjectByTag("Imia");
  object oWaypoint1 = GetWaypointByTag("wp_imiaout");
  object oWaypoint2 = GetWaypointByTag("wp_imia");
  int bRun = FALSE
  ActionDoCommand(SetCommandable(TRUE, oNPC));
  AssignCommand(oNPC, ActionForceMoveToObject(oWaypoint1, bRun));
  AssignCommand(oNPC, ActionDoCommand(JumpToObject(oWayPoint2)));
  ActionResumeConversation();
}
Problem is, if I take the command away, then the next line down gets a SYNTAX Error. I don't know what's going on.


Good with dialogues and getting better
Working on Scripting and Module Editing/Re-skinning
Started work on Modeling New Areas
darthtyren is online now   you may: quote & reply,
Old 02-27-2015, 02:27 PM   #12
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,266
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
Missing semicolon int bRun = FALSE;

VarsityPuppet is offline   you may: quote & reply,
Old 02-27-2015, 03:03 PM   #13
darthtyren
Rookie
 
darthtyren's Avatar
 
Join Date: May 2011
Location: Kotor Tool folder
Posts: 161
Ya know, I was able to spot the same problem in the final version of the previous script. I guess I don't have a very good eye. Now I feel foolish.


Good with dialogues and getting better
Working on Scripting and Module Editing/Re-skinning
Started work on Modeling New Areas
darthtyren is online now   you may: quote & reply,
Old 02-27-2015, 03:07 PM   #14
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 651
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by darthtyren View Post
Guess what! New post + new script = new problem. Need I say more?

Anyway, I was kind of following this tutorial, but rather than destroying the NPC, I wanted the NPC to jump to another waypoint when it reaches the first.

*SYNTAX ERROR in ORANGE
Code:
void main(){
  object oNPC = GetObjectByTag("Imia");
  object oWaypoint1 = GetWaypointByTag("wp_imiaout");
  object oWaypoint2 = GetWaypointByTag("wp_imia");
  int bRun = FALSE
  ActionDoCommand(SetCommandable(TRUE, oNPC));
  AssignCommand(oNPC, ActionForceMoveToObject(oWaypoint1, bRun));
  AssignCommand(oNPC, ActionDoCommand(JumpToObject(oWayPoint2)));
  ActionResumeConversation();
}
Problem is, if I take the command away, then the next line down gets a SYNTAX Error. I don't know what's going on.
int bRun = FALSE needs a ; at the end. And SetCommandable doesn't need the ActionDoCommand at all, so that line should read "SetCommandable(TRUE, oNPC);


All of my mods are available on Deadlystream.

Always remember modders: "Quality= Effort*Time"

KSE 3.3.4 is LIVE!!! Check it out here.

Check out WalkSwitch, the Walkmesh-changing tool!
Fair Strides 2 is offline   you may: quote & reply,
Old 02-27-2015, 03:25 PM   #15
darthtyren
Rookie
 
darthtyren's Avatar
 
Join Date: May 2011
Location: Kotor Tool folder
Posts: 161
Alright, thanks VP, FS. And don't go anywhere: I'll very likely have more queries for you.

EDIT:

Yep. Here we go again.

Code:
void main(){
  object oNPC = GetObjectByTag("Imia");
  object oWaypoint1 = GetWaypointByTag("wp_imiaout");
  object oWaypoint2 = GetWaypointByTag("wp_imia");
  int bRun = FALSE;
  SetCommandable(TRUE, oNPC);
  AssignCommand(oNPC, ActionForceMoveToObject(oWaypoint1, bRun));
  AssignCommand(oNPC, ActionDoCommand(JumpToObject(oWayPoint2)));
  ActionResumeConversation();
}
It tells me there's something wrong with every little tidbit of the highlighted line except the oNPC.

Also, any tips on recompiling the k_align_movie.nss so that it doesn't fire?


Good with dialogues and getting better
Working on Scripting and Module Editing/Re-skinning
Started work on Modeling New Areas

Last edited by darthtyren; 02-27-2015 at 04:22 PM.
darthtyren is online now   you may: quote & reply,
Old 02-27-2015, 04:54 PM   #16
Sith Holocron
M4-78
 
Sith Holocron's Avatar
 
Join Date: Mar 2006
Location: Pasadena, MD(Nar Shaddaa East)
Posts: 1,368
Current Game: The Old Republic
Forum Veteran Folder extraordinaire Helpful! Alderaan News Holopics contributor 
Just so you know, Fair Strides is on modding hiatus for one month.




Considering trying out (or returning to) SWTOR? You may as well go through my link and help get me some SWTOR referral points!
Sith Holocron is offline   you may: quote & reply,
Old 02-27-2015, 07:05 PM   #17
darthtyren
Rookie
 
darthtyren's Avatar
 
Join Date: May 2011
Location: Kotor Tool folder
Posts: 161
Quote:
Originally Posted by Sith Holocron View Post
Just so you know, Fair Strides is on modding hiatus for one month.
... Okay.

On another note, due to all my questions regarding scripts, including the stated unanswered ones, and may more to come, I am asking a moderator to rename this thread to something more appropriate (like 'DarthTyren's Endless Scripting Problems/Questions'). It will now be a more permanent place for me to voice my problems and questions regarding scripting.


Good with dialogues and getting better
Working on Scripting and Module Editing/Re-skinning
Started work on Modeling New Areas
darthtyren is online now   you may: quote & reply,
Old 02-27-2015, 08:42 PM   #18
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,266
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
Quote:
Originally Posted by darthtyren View Post
Alright, thanks VP, FS. And don't go anywhere: I'll very likely have more queries for you.

EDIT:

Yep. Here we go again.

Code:
void main(){
  object oNPC = GetObjectByTag("Imia");
  object oWaypoint1 = GetWaypointByTag("wp_imiaout");
  object oWaypoint2 = GetWaypointByTag("wp_imia");
  int bRun = FALSE;
  SetCommandable(TRUE, oNPC);
  AssignCommand(oNPC, ActionForceMoveToObject(oWaypoint1, bRun));
  AssignCommand(oNPC, ActionDoCommand(JumpToObject(oWayPoint2)));
  ActionResumeConversation();
}
It tells me there's something wrong with every little tidbit of the highlighted line except the oNPC.

Also, any tips on recompiling the k_align_movie.nss so that it doesn't fire?
What does the compiler say when you try to compile?

recompiling k_align_movie.nss... not a clue.. I feel like we should have some sort of repo to check these things. I hate having to check the game source for the scripts.

VarsityPuppet is offline   you may: quote & reply,
Old 02-27-2015, 09:25 PM   #19
darthtyren
Rookie
 
darthtyren's Avatar
 
Join Date: May 2011
Location: Kotor Tool folder
Posts: 161
Show spoiler


You know, sometimes I don't like case-sensitivity. oWaypoint2 ≠ oWayPoint2

After fixing that, it compiled correctly.

OK, next on my list: Is there a way to force the Player to level up? Starting out as a Jedi doesn't make much sense if there are no Force Powers, or points.


Good with dialogues and getting better
Working on Scripting and Module Editing/Re-skinning
Started work on Modeling New Areas
darthtyren is online now   you may: quote & reply,
Old Yesterday, 09:05 PM   #20
Qui-Gon Glenn
Royal Nonesuch
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Irune
Posts: 1,469
Current Game: KotOR awww yeah
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
The Endar Spire will not allow you to leave the bridge without leveling. Look there for a source script.


Want to play a game of ME3MP?
Qui-Gon_Glenn
Qui-Gon Glenn is offline   you may: quote & reply,
Old Today, 07:45 PM   #21
darthtyren
Rookie
 
darthtyren's Avatar
 
Join Date: May 2011
Location: Kotor Tool folder
Posts: 161
Quote:
Originally Posted by Qui-Gon Glenn View Post
The Endar Spire will not allow you to leave the bridge without leveling. Look there for a source script.
Actually, I'm looking for something more like leveling up just after you get your Jedi class. The only problem is that it's compiled only. And it's a KotOR script, not TSL, so I can't "decompile" it.


Good with dialogues and getting better
Working on Scripting and Module Editing/Re-skinning
Started work on Modeling New Areas
darthtyren is online now   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Just a quick check in with the scripters

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:50 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.