lfnetwork.com mark read register faq members calendar

Thread: Qui-Gon's Script Shack
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 10-03-2012, 05:31 PM   #241
Canderis
Mercenary
 
Canderis's Avatar
 
Join Date: Jun 2008
Location: Unknown
Posts: 2,503
Current Game: Skyrim
Veteran Modder Helpful! 
The pause and resume conversation parts don't seem to work right either because i can still skip through the dialog.




Canderis is offline   you may: quote & reply,
Old 10-03-2012, 07:01 PM   #242
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 550
The commandable effects wheter you can "click" an NPC. Very handy for preventing repeat conversations, and thus XP-exploits. Primarily used for during the 'run away and be deleted'

Doors can block NPC movement. I've had a lot of issues with that in the Nar Shaddaa cantina, and in the end just gave up on trying any proper pathing there, since it was a nightmare.

Pause, resume work for cutscenes, not for the VO. So yeah. From what I hear in KOTOR1 you can't partially skip (like KOTOR2 can), which sounds extremely frustrating to me. Sorry I can't really help there either...

EDIT: Looking at the script, ActionWait() doesn't work for that. So it might be that prevents it from working properly.
Maybe use
Code:
DelayCommand(3.0, ExecuteScript("contalk", OBJECT_SELF));
instead, with the new script (contalk.ncs) being the continue dialog (usuable for much more than just this one convo obviously).
Hassat Hunter is offline   you may: quote & reply,
Old 10-03-2012, 09:05 PM   #243
Canderis
Mercenary
 
Canderis's Avatar
 
Join Date: Jun 2008
Location: Unknown
Posts: 2,503
Current Game: Skyrim
Veteran Modder Helpful! 
Still ended up doing the same thing. Didn't stop the dialog and didn't wait.




Canderis is offline   you may: quote & reply,
Old 10-03-2012, 09:06 PM   #244
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Alternatively, instead of using ActionWait() you can just put a DelayCommand on the ActionResumeConversation, and specify that delay for however long you want the node to last.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 10-08-2012, 01:07 PM   #245
Canderis
Mercenary
 
Canderis's Avatar
 
Join Date: Jun 2008
Location: Unknown
Posts: 2,503
Current Game: Skyrim
Veteran Modder Helpful! 
I am still getting the teleportation issue. I got the dialog to not be skippable, but my npc won't move still.
I have 2 codes from 2 different dialog nodes.

Code:
void main()
{

  object oDoor = GetObjectByTag("m55aa_elv01");
  SetLocked(oDoor,FALSE);
  AssignCommand(oDoor, ActionOpenDoor(oDoor));

  object oNPC=GetObjectByTag("n_shol");    

  float x=101.39;                          
  float y=148.00;                        
  float z=36.32;                        

  int bRun=FALSE;                                                   

  vector vExit=Vector(x,y,z);
  location lExit=Location(vExit,0.0f);
  ActionDoCommand(SetCommandable(TRUE,oNPC));
  DelayCommand(3.0, AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun)));

}
Code:
void main() 
{


 object oNPC = GetObjectByTag("nshol");
 
 DelayCommand(3.0, AssignCommand(oNPC, ActionForceMoveToObject(GetFirstPC(), 0, 1.0, 30.0)));



}




Canderis is offline   you may: quote & reply,
Old 10-08-2012, 02:28 PM   #246
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
It could be a pathing issue with the module. Easiest solution would be to add a couple locations in between the end point that you assign the NPC to walk to. Alternatively, you could use bead-v's .pth editor. Found here:

http://deadlystream.com/forum/topic/...748#entry17748


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 10-08-2012, 02:43 PM   #247
Canderis
Mercenary
 
Canderis's Avatar
 
Join Date: Jun 2008
Location: Unknown
Posts: 2,503
Current Game: Skyrim
Veteran Modder Helpful! 
I've done both. The paths look fine, and i have tried multiple locations.

Edit: i got it resolved.





Last edited by Canderis; 10-08-2012 at 06:12 PM.
Canderis is offline   you may: quote & reply,
Old 10-08-2012, 06:29 PM   #248
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Do you mind sharing what you did to fix it? It might help others if they ever have this problem.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 10-08-2012, 06:34 PM   #249
Canderis
Mercenary
 
Canderis's Avatar
 
Join Date: Jun 2008
Location: Unknown
Posts: 2,503
Current Game: Skyrim
Veteran Modder Helpful! 
Quote:
Originally Posted by Fallen Guardian View Post
Do you mind sharing what you did to fix it? It might help others if they ever have this problem.
I found my door was causing the issue. I really just reordered my scripts, split them up into multiple ones, and added a few more delays.




Canderis is offline   you may: quote & reply,
Old 10-10-2012, 02:24 PM   #250
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
I feel a bit silly asking this, but I really haven't done much modding for K1 at all... so my question is: is it not possible to play animations from animations.2da and dialoganimations.2da in K1? I am so used to it in K2 that this seems hard to believe. But all my efforts thus far have been in vain.


JCarter426 is offline   you may: quote & reply,
Old 10-22-2012, 10:37 AM   #251
martixy
Lurker
 
Join Date: Jun 2010
Posts: 2
I wanna mod me an increase in buff durations, cuz it's annoying to have to reactivate them every 30-odd seconds.

Modifying the values is easy.
Getting to something that can be put in the override - not so much.
Tried this: http://www.lucasforums.com/showthrea...hreadid=120785
Says all files are just includes and therefore ignored.

And I have no idea where to find Jawa's NWN toolset kotor thingie.
martixy is offline   you may: quote & reply,
Old 10-22-2012, 09:37 PM   #252
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by JCarter426 View Post
I feel a bit silly asking this, but I really haven't done much modding for K1 at all... so my question is: is it not possible to play animations from animations.2da and dialoganimations.2da in K1? I am so used to it in K2 that this seems hard to believe. But all my efforts thus far have been in vain.
I don't believe so, only NWScript-defined animations can be played via a script in K1.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 10-23-2012, 05:49 PM   #253
Darth Hayze
Rookie
 
Darth Hayze's Avatar
 
Join Date: Oct 2012
Posts: 27
Current Game: Revenge of Revan
Okay, I'm trying to compile this script with a lot of DelayCommand functions, most of them work fine, but the ones that are like this

Code:
DelayCommand(0.4, SpawnAvailableNPC(11, GetLocation(GetWaypointByTag("WP_ebon_atton"))));
i.e. spawning a NPC

return this error when compiling "Error: Type mismatch in parameter 2 in call to Delay Command"

at first I thought it might be becuase the problem commands are within if statements, but moving them outside the statement still gives the error. There are other DelayCommands used in this script, and they aren't giving me this error. What gives?

Show spoiler
Darth Hayze is offline   you may: quote & reply,
Old 10-23-2012, 11:43 PM   #254
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
If I'm not mistaken SpawnAvailableNPC is not an action, therefore DelayCommand cannot be used on it. Easiest way around that that I can think of would be to put all the SpawnAvailableNPC (and any others that are non-action but you need to delay) commands into a separate script(s). Then, where you originally had the spawning done in the script, do something like this:

Code:
DelayCommand(0.5, ExecuteScript(string sScript, object oTarget, int nScriptVar=-1);
oTarget is the object called to run the script and int nScriptVar, to quote the commentary from the developers, "This value will be returned by calls to GetRunScriptVar."


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 10-24-2012, 01:14 AM   #255
Darth Hayze
Rookie
 
Darth Hayze's Avatar
 
Join Date: Oct 2012
Posts: 27
Current Game: Revenge of Revan
Thanks, that helped by getting me figure out a different way to do what I wanted.
Darth Hayze is offline   you may: quote & reply,
Old 10-24-2012, 06:24 AM   #256
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 550
Yeah, you can't delay spawns (of NPC's nor teammates) with DelayCommand.
Which do require Fallen Guardians solution.

I used it for example on the Telos cantina. One dancer got destroyed, the other spawned, but doing that at the same time like OE's script did would move the dancer away at spawn since the original was still there. Adding a small 2 seconds delay would allow her to remain on the proper location. However, yeah, doesn't seemed a way to do so unless with an executed other script.
Hassat Hunter is offline   you may: quote & reply,
Old 10-26-2012, 07:18 PM   #257
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
Quote:
Originally Posted by Fallen Guardian View Post
I don't believe so, only NWScript-defined animations can be played via a script in K1.
That's unfortunate... but expected. Oh well.
Quote:
Originally Posted by Darth Hayze View Post
Okay, I'm trying to compile this script with a lot of DelayCommand functions, most of them work fine, but the ones that are like this

Code:
DelayCommand(0.4, SpawnAvailableNPC(11, GetLocation(GetWaypointByTag("WP_ebon_atton"))));
i.e. spawning a NPC

return this error when compiling "Error: Type mismatch in parameter 2 in call to Delay Command"
Another thing you can do is create a subroutine. The benefit of this is you can keep everything in one script, though in certain cases ExecuteScript works better. So, for example:
Code:
void SpawnNPC(int iNPC, location lLocation) {

SpawnAvailableNPC(iNPC, lLocation);

}



void main() {

DelayCommand(0.4, SpawnNPC(11, GetLocation(GetWaypointByTag("WP_ebon_atton"))));

}
Haven't tested it, but it should work. Theoretically.


JCarter426 is offline   you may: quote & reply,
Old 11-17-2012, 08:27 AM   #258
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 550
Not really a request, more a vent...

So spend over an hour getting an "dreact" to appear properly after blowing up a droid. Nothing seemed to work.
Until I made a script for the sole purpose of triggering another script, and nothing else.

It had a 5 sec delay, but never worked properly after the droid got blown. Apparently the 5 sec had to be when the droid was still alive.

So using the other script, it immediately fired the other script and no longer required a living droid after 5 seconds. Fixing everything.

KOTOR Logic... it takes me an hour or 2 to grasp :/
Hassat Hunter is offline   you may: quote & reply,
Old 11-19-2012, 11:14 PM   #259
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 537
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by Hassat Hunter View Post
KOTOR Logic... it takes me an hour or 2 to grasp :/
Took me six months and the NWN Lexicon to make me learn it!
Fair Strides 2 is offline   you may: quote & reply,
Old 11-28-2012, 05:12 PM   #260
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
All righty, basically I'm trying to make a node available if you have one of 4 party members in your party, and I didn't want to copy the node to use each companion's individual inparty check, so I did this:

Code:
#include "k_inc_debug"



int StartingConditional()
{

   return( (IsNPCPartyMember(NPC_JOLEE) == TRUE || IsNPCPartyMember(NPC_T3_M4) == TRUE || IsNPCPartyMember(NPC_CANDEROUS) == TRUE || IsNPCPartyMember(NPC_HK_47) == TRUE));


}
Now it won't compile, saying that I'm missing a required argument in IsNPCPartyMember and NPC_JOLEE is an undeclared identifier. I copied this mostly from the BioWare written companion check script, I just added in all the || symbols in between each one.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 11-28-2012, 06:01 PM   #261
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 537
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by Fallen Guardian View Post
All righty, basically I'm trying to make a node available if you have one of 4 party members in your party, and I didn't want to copy the node to use each companion's individual inparty check, so I did this:

Code:
#include "k_inc_debug"



int StartingConditional()
{

   return( (IsNPCPartyMember(NPC_JOLEE) == TRUE || IsNPCPartyMember(NPC_T3_M4) == TRUE || IsNPCPartyMember(NPC_CANDEROUS) == TRUE || IsNPCPartyMember(NPC_HK_47) == TRUE));


}
Now it won't compile, saying that I'm missing a required argument in IsNPCPartyMember and NPC_JOLEE is an undeclared identifier. I copied this mostly from the BioWare written companion check script, I just added in all the || symbols in between each one.
You might substitute the numbers for the text, and/or split the check into four.
Fair Strides 2 is offline   you may: quote & reply,
Old 11-28-2012, 09:58 PM   #262
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Thanks, I changed the names to their respective integers and it compiled.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 11-29-2012, 07:45 PM   #263
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 537
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by Fallen Guardian View Post
Thanks, I changed the names to their respective integers and it compiled.
This for Dantooine Tension or some other project?
Fair Strides 2 is offline   you may: quote & reply,
Old 12-06-2012, 08:03 PM   #264
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by Fair Strides 2 View Post
This for Dantooine Tension or some other project?
You'll just have to wait and see.

And now I have a new problem. Okay, so I've been trying to unequip Carth and Bastila's armor and put clothing on them, however when I try to run this it crashes to desktop. Any idea what's going on?

Code:
void main()
{

object oPM1 = GetObjectByTag("Carth");
object oPM2 = GetObjectByTag("Bastila");

object oPC = GetFirstPC();
object oArmor = GetItemInSlot(INVENTORY_SLOT_BODY, oPM1);
object oArmorB = GetItemInSlot(INVENTORY_SLOT_BODY, oPM2);
object oArm = CreateItemOnObject("g_a_clothes01", oPM1);
object oArmB = CreateItemOnObject("g_a_clothes01", oPM2);

AssignCommand(oPM1, ClearAllActions());
    AssignCommand (oPM1, ActionUnequipItem(oArmor, INVENTORY_SLOT_BODY));
    AssignCommand (oPM1, ActionEquipItem(oArm, INVENTORY_SLOT_BODY));
    AssignCommand(oPM2, ClearAllActions());
    AssignCommand (oPM2, ActionUnequipItem(oArmorB, INVENTORY_SLOT_BODY));
    AssignCommand (oPM2, ActionEquipItem(oArmB, INVENTORY_SLOT_BODY));

}


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 12-06-2012, 08:32 PM   #265
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
Hmm. I've had similar problems... not crashing but it refusing to equip. All I had to do was add a delay between everything.


JCarter426 is offline   you may: quote & reply,
Old 12-07-2012, 04:59 PM   #266
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 537
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by Fallen Guardian View Post
You'll just have to wait and see.

And now I have a new problem. Okay, so I've been trying to unequip Carth and Bastila's armor and put clothing on them, however when I try to run this it crashes to desktop. Any idea what's going on?

Code:
void main()
{

object oPM1 = GetObjectByTag("Carth");
object oPM2 = GetObjectByTag("Bastila");

object oPC = GetFirstPC();
object oArmor = GetItemInSlot(INVENTORY_SLOT_BODY, oPM1);
object oArmorB = GetItemInSlot(INVENTORY_SLOT_BODY, oPM2);
object oArm = CreateItemOnObject("g_a_clothes01", oPM1);
object oArmB = CreateItemOnObject("g_a_clothes01", oPM2);

AssignCommand(oPM1, ClearAllActions());
    AssignCommand (oPM1, ActionUnequipItem(oArmor, INVENTORY_SLOT_BODY));
    AssignCommand (oPM1, ActionEquipItem(oArm, INVENTORY_SLOT_BODY));
    AssignCommand(oPM2, ClearAllActions());
    AssignCommand (oPM2, ActionUnequipItem(oArmorB, INVENTORY_SLOT_BODY));
    AssignCommand (oPM2, ActionEquipItem(oArmB, INVENTORY_SLOT_BODY));

}
I'm fairly certain that the Equip/Unequip Item functions require the first parameter, in this case oArmor, to be a person. I myself have yet to get an Equip or Unequip function to actually work. For me, they've just done nothing.

Also, I recall the NWN Lexicon saying that you don't need to use the Unequip function at all if you use the Equip. You might try the script without that, though you might run into my problem with nothing happening in-game.
Fair Strides 2 is offline   you may: quote & reply,
Old 12-07-2012, 05:06 PM   #267
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
No, equip and unequip are actions assigned to characters:
Code:
// 32: Equip oItem into nInventorySlot.
// - nInventorySlot: INVENTORY_SLOT_*
// * No return value, but if an error occurs the log file will contain
//   "ActionEquipItem failed."
void ActionEquipItem(object oItem, int nInventorySlot, int bInstant=FALSE);

// 33: Unequip oItem from whatever slot it is currently in.
void ActionUnequipItem( object oItem, int bInstant = FALSE );
Unequip might be unnccessary as you say, but you can never be too safe with this game.


JCarter426 is offline   you may: quote & reply,
Old 12-07-2012, 06:51 PM   #268
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 537
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by JCarter426 View Post
No, equip and unequip are actions assigned to characters:
Code:
// 32: Equip oItem into nInventorySlot.
// - nInventorySlot: INVENTORY_SLOT_*
// * No return value, but if an error occurs the log file will contain
//   "ActionEquipItem failed."
void ActionEquipItem(object oItem, int nInventorySlot, int bInstant=FALSE);

// 33: Unequip oItem from whatever slot it is currently in.
void ActionUnequipItem( object oItem, int bInstant = FALSE );
Unequip might be unnccessary as you say, but you can never be too safe with this game.
Well, could you explain where the mistake is in the item not showing up on my PC? I tried the dancer outfit as a test item and usually had the script like this:

Code:
AssignCommand(GetFirstPC(), ActionEquipItem(GetObjectByTag("g_danceroutfit"), INVENTORY_SLOT_BODY); //Though I usually inputted "1" in place of the Slot
Was I not using the right slot?
Fair Strides 2 is offline   you may: quote & reply,
Old 12-07-2012, 06:55 PM   #269
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
The tag for the dancer outfit is "DancersOutfit". It's one of the few items for which the tag and template ResRef don't match.


JCarter426 is offline   you may: quote & reply,
Old 12-19-2012, 08:38 PM   #270
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 537
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by JCarter426 View Post
The tag for the dancer outfit is "DancersOutfit". It's one of the few items for which the tag and template ResRef don't match.
Just now got around to this, and I beg you to feel free to slap me! Now I feel like finding a corner and having a little "Duh moment".
Fair Strides 2 is offline   you may: quote & reply,
Old 01-18-2013, 04:30 AM   #271
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
Eh, I don't blame you.

I have a problem of my own. Well, not so much a problem, really. I'm trying to see if the global string K_STUNT_MODULE is used at all in either game, so I don't have to add my own. Has anyone worked with this before?


JCarter426 is offline   you may: quote & reply,
Old 01-18-2013, 11:56 AM   #272
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 537
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by JCarter426 View Post
Eh, I don't blame you.

I have a problem of my own. Well, not so much a problem, really. I'm trying to see if the global string K_STUNT_MODULE is used at all in either game, so I don't have to add my own. Has anyone worked with this before?
If I had to guess, I'd say it's used by the game code to load the proper stunt module, given a series of conditions, such as a point in the game. I don't think there are that many stunt modules in TSL, so I would try printing the K_STUNT_MODULE as a string to your info screen in-game in K1. You might use the save game archives from deadlystream and test the script after various points in the game. Let us know if it works?


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 01-18-2013, 01:40 PM   #273
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
I've looked through several saves, and it always seems to be blank... though I don't have a complete set of actual saves, just me messing around in the game. I can't think of why it would be needed, though. There are already globals for the complete planets and player choices... why would a string be needed, specifically? K_LAST_MODULE is used in K1 to record the module name you're in before you use the return to hideout/Ebon Hawk function. In that case, a string is specifically needed; numbers would be possible but it would require a lot more coding and you would have to edit it every time a new module is added to the game. But in the case of loading the correct stunt module... well, the progression is mostly linear, so there wouldn't be any point of contention.

I might have to make my own anyway, though. I realized I might want more than one.


JCarter426 is offline   you may: quote & reply,
Old 01-18-2013, 01:53 PM   #274
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
It would seem like you wouldn't really need K_STUNT_MODULE. From my understanding the only unique thing about stunt modules is the fact they use cutscenes models for all the animations in the cutscene. (That and they use semi-unique variants of the area they're supposed to take place in. i.e. in one of them the Ebon Hawk ends at the garage area, and in its stead there is a void of unwalkable blackness) Of course this could all be worthless info, I haven't looked at global strings that much.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 02-07-2013, 09:57 PM   #275
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
So, I have a strange problem. The script compiles fine. The beginning of it executes fine. But then at some point it just stops recognizing two of my variables, causing all other parts of the script to fail to execute. What's stranger still is the script is almost identical to one I wrote for K2 with no such problems.
Code:
#include "jc_inc_clone"

void main() {

object oTarget = OBJECT_SELF;
int iFaction = 2;

if( oTarget == OBJECT_INVALID ) {
	JC_DLG("jc_clo1");
	}

else {

	string sTemp = JC_Template(oTarget);

	object oClone = CreateObject(OBJECT_TYPE_CREATURE, sTemp, GetLocation(OBJECT_SELF), FALSE);

	int iI;

// Copy ALIGNMENT
AdjustAlignment(oClone, GetAlignmentGoodEvil(oTarget), abs(GetGoodEvilValue(oTarget) - GetGoodEvilValue(oClone)), FALSE);

// Clear INVENTORY
  for( iI = 0; iI <= 17; iI++ ) {
	ActionUnequipItem(GetItemInSlot(iI, oClone), TRUE);
	}

// Copy INVENTORY

  for( iI = 0; iI <= 17; iI++ ) {
	if( GetIsObjectValid(GetItemInSlot(iI, oTarget)) ){
		DelayCommand(0.1, AssignCommand(oClone, ActionEquipItem(CreateItemOnObject(GetStringLowerCase(GetTag(GetItemInSlot(iI, oTarget))), oClone, 1, 1), iI, TRUE)));
		}
	}

// Copy APPEARANCE
ApplyEffectToObject(2, EffectDisguise(GetAppearanceType(oTarget)), oClone, 0.0);

// Set FACTION
ChangeToStandardFaction(oClone, iFaction);

// Heal up the clone (just in case)
ApplyEffectToObject(0, EffectHeal(GetMaxHitPoints(oClone) - GetCurrentHitPoints(oClone)), oClone, 0.0);
ApplyEffectToObject(0, EffectHealForcePoints(GetMaxForcePoints(oClone) - GetCurrentForcePoints(oClone)), oClone, 0.0);

  }

}
It works consistently up to and including the creation of oClone. After that, it seems like oTarget and oClone work once each, and after that they never work again. I'm able to shift parts of the code around to get that part to work, but at the expense of all the others. It's rather frustrating.

Any ideas?


JCarter426 is offline   you may: quote & reply,
Old 02-08-2013, 09:17 AM   #276
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 550
Try adding oClone at the top but blank, so

Code:
void main() {

object oTarget = OBJECT_SELF;
object oClone = "";
int iFaction = 2;

if(
Not sure if it'll fix it, but it might help...
Hassat Hunter is offline   you may: quote & reply,
Old 02-08-2013, 09:50 AM   #277
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 537
Current Game: Master of Orion 2
Helpful! 
Show spoiler


I don't know. Could you post the contents of jc_inc_clone? That might help us out a bit.


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-08-2013, 01:58 PM   #278
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
Quote:
Originally Posted by Hassat Hunter View Post
Try adding oClone at the top but blank, so

Code:
void main() {

object oTarget = OBJECT_SELF;
object oClone = "";
int iFaction = 2;

if(
Not sure if it'll fix it, but it might help...
I tried defining everything outside of the if... no luck.
Quote:
Originally Posted by Fair Strides 2 View Post
I don't know. Could you post the contents of jc_inc_clone? That might help us out a bit.
Ah, well, I knew that part is working, but I've updated the code so jc_inc_clone takes up the bulk of it anyway, so here's the entire updated code:
Code:
void JC_DLG(string sDLG) {

SetPartyLeader(-1);
DelayCommand(0.2, AssignCommand(OBJECT_SELF, ActionStartConversation(GetFirstPC(), sDLG, 0, 0, 1, "", "", "", "", "", "", 0, -1, -1, 1)));

}


int JC_Get_Class(object oObject) {

	int iClass1 = GetClassByPosition(1, oObject);
	int iClass2 = GetClassByPosition(2, oObject);
	int iClass3 = GetClassByPosition(3, oObject);

if( iClass3 != 255 ) return iClass3;
if( iClass2 != 255 ) return iClass2;
return iClass1;

}


string JC_Class_To_String(int iClass) {

if( iClass == 0 ) return "soldier";
if( iClass == 1 ) return "scout";
if( iClass == 2 ) return "scoundrel";
if( iClass == 3 ) return "guardian";
if( iClass == 4 ) return "consular";
if( iClass == 5 ) return "sentinel";
if( iClass == 6 ) return "combat";
if( iClass == 7 ) return "expert";
if( iClass == 8 ) return "minion";
return "minion";

}


string JC_Class_To_Letter(int iClass) {

if( iClass == 0 ) return "r";
if( iClass == 1 ) return "t";
if( iClass == 2 ) return "l";
if( iClass == 3 ) return "g";
if( iClass == 4 ) return "c";
if( iClass == 5 ) return "s";
return "";

}


string JC_Gender_To_String(object oObject) {

if( GetGender(oObject) == 1 ) return "f";
return "";

}


int JC_Get_Level(object oObject) {

	int iLevel = (	GetLevelByPosition(1, oObject) +
			GetLevelByPosition(2, oObject) +
			GetLevelByPosition(3, oObject) );
return iLevel;

}


string JC_Level_To_String(object oObject) {

return IntToString(JC_Get_Level(oObject));

}


string JC_Object_To_JC_Temp(object oObject) {

if( oObject == GetFirstPC() ) return JC_Class_To_Letter(JC_Get_Class(oObject)) + "pc" + JC_Gender_To_String(oObject);
if( GetTag(oObject) == "Bastila" ) return "bastila";
if( GetTag(oObject) == "Cand" ) return "canderous";
if( GetTag(oObject) == "Carth" ) return "carth";
if( GetTag(oObject) == "HK47" ) return "hk47";
if( GetTag(oObject) == "Jolee" ) return "jolee";
if( GetTag(oObject) == "Juhani" ) return "juhani";
if( GetTag(oObject) == "Mission" ) return "mission";
if( GetTag(oObject) == "T3M4" ) return "t3m4";
if( GetTag(oObject) == "Zaalbar" ) return "zaalbar";
return JC_Class_To_String(JC_Get_Class(oObject)) + JC_Gender_To_String(oObject);

}


string JC_Template(object oObject) {

return "jc_" + JC_Object_To_JC_Temp(oObject) + JC_Level_To_String(oObject);

}


void JC_CLONE(object oTarget, int iFaction) {

object oClone;
string sTemp;
int iI;

if( oTarget == OBJECT_INVALID ) {
	JC_DLG("jc_clo1");
	}

else {

	string sTemp = JC_Template(oTarget);

	object oClone = CreateObject(OBJECT_TYPE_CREATURE, sTemp, GetLocation(OBJECT_SELF), FALSE);

// Copy ALIGNMENT
AdjustAlignment(oClone, GetAlignmentGoodEvil(oTarget), abs(GetGoodEvilValue(oTarget) - GetGoodEvilValue(oClone)), FALSE);

// Clear INVENTORY
  for( iI = 0; iI <= 17; iI++ ) {
	ActionUnequipItem(GetItemInSlot(iI, oClone), TRUE);
	}

// Copy INVENTORY

  for( iI = 0; iI <= 17; iI++ ) {
	if( GetIsObjectValid(GetItemInSlot(iI, oTarget)) ){
		DelayCommand(0.1, AssignCommand(oClone, ActionEquipItem(CreateItemOnObject(GetStringLowerCase(GetTag(GetItemInSlot(iI, oTarget))), oClone, 1, 1), iI, TRUE)));
		}
	}

// Copy APPEARANCE
ApplyEffectToObject(2, EffectDisguise(GetAppearanceType(oTarget)), oClone, 0.0);

// Set FACTION
ChangeToStandardFaction(oClone, iFaction);

// Heal up the clone (just in case)
ApplyEffectToObject(0, EffectHeal(GetMaxHitPoints(oClone) - GetCurrentHitPoints(oClone)), oClone, 0.0);
ApplyEffectToObject(0, EffectHealForcePoints(GetMaxForcePoints(oClone) - GetCurrentForcePoints(oClone)), oClone, 0.0);

  }

}


void main() {

}
And then this is executed through either:
Code:
#include "jc_inc_clone"

void main() {

JC_CLONE(OBJECT_SELF, 2);

}
or:
Code:
#include "jc_inc_clone"

void main() {

JC_CLONE(GetNearestObject(OBJECT_TYPE_CREATURE, OBJECT_SELF, 1), 2);

}
EDIT: I have someone breathing down my neck, waiting impatiently for me to finish this, so to prove that it's not my fault I took the scripts and all the support files and moved them into K2, not changing a damn thing. AND IT WORKS. So what's up? I'm officially lost at this point.



Last edited by JCarter426; 02-08-2013 at 02:29 PM.
JCarter426 is offline   you may: quote & reply,
Old 04-02-2013, 09:56 PM   #279
Thrak Farelle
Lurker
 
Join Date: Mar 2008
Posts: 3
Apologies if I could have found this somewhere else, but I'm rather new to modding, and can't seem to find a particular piece of script code anywhere. I'm trying to write a conditional script to check class in K1 before a specific dialogue option becomes available, but I've searched and searched and can't find the specific code I need.
Thrak Farelle is offline   you may: quote & reply,
Old 04-02-2013, 10:05 PM   #280
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
Code:
// 341: A creature can have up to three classes.  This function determines the
// creature's class (CLASS_TYPE_*) based on nClassPosition.
// - nClassPosition: 1, 2 or 3
// - oCreature
// * Returns CLASS_TYPE_INVALID if the oCreature does not have a class in
//   nClassPosition (i.e. a single-class creature will only have a value in
//   nClassLocation=1) or if oCreature is not a valid creature.
int GetClassByPosition(int nClassPosition, object oCreature=OBJECT_SELF);
So, if you want to check if a creature has any particular class:
Code:
int StartingConditional(){

	object oCreature = [whatever];
	int iClass = [whatever];
	int iC1 = GetClassByPosition(1, oCreature);
	int iC2 = GetClassByPosition(2, oCreature);
	int iC3 = GetClassByPosition(3, oCreature);

if(	iC1 == iClass ||
	iC2 == iClass ||
	iC3 == iClass ){
	return TRUE;
	}
return FALSE;

}
I'm not sure how the class positions get assigned, so depending on what you need it could be trickier than just that.


JCarter426 is offline   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 > Qui-Gon's Script Shack

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 01:23 PM.

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