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 04-03-2013, 07:11 AM   #281
Thrak Farelle
Lurker
 
Join Date: Mar 2008
Posts: 3
Quote:
Originally Posted by JCarter426 View Post
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.
Thanks very much, combining some of that with code from another script that had another bit of what I needed allowed me to write the necessary script, and I've tested it ingame, so I know it works

Thanks again
Thrak Farelle is offline   you may: quote & reply,
Old 04-08-2013, 08:25 PM   #282
supreme kotor
Junior Member
 
supreme kotor's Avatar
 
Join Date: Mar 2013
Location: I'm lost.
Posts: 326
Current Game: Modding.. Wait is that a game?
I know this probably seems like a really wierd question but I assure you there is good reason for it. Now to the question: would it be possible to make a force power (buff) never go away after you cast it? And if that is possible would it be possible to remove the blue arrow it makes?

Thanks in advance


Current WIP: Learning to mod Kotor
supreme kotor is offline   you may: quote & reply,
Old 04-09-2013, 01:05 AM   #283
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 628
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by supreme kotor View Post
I know this probably seems like a really wierd question but I assure you there is good reason for it. Now to the question: would it be possible to make a force power (buff) never go away after you cast it? And if that is possible would it be possible to remove the blue arrow it makes?

Thanks in advance
You might experiment with the "DURATION_TYPE_PERMANENT" option in the ApplyEffect function. Though I would have to assume that it is gone when dispelled and/or you change areas. Still, experimentation may prove me wrong. Hope you have a good run and remember:

Show spoiler


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 04-09-2013, 02:42 AM   #284
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,256
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
Quote:
Originally Posted by Fair Strides 2 View Post
"Scripting is fun!"~~ said some random modder as others attacked him for his insanity.

Well it would be easier if one could program such things in one contiguous file. Kinda stinks having so many separate files to go through. Sure, you could include a lot of scripts that define functions.

Actually that sounds like it would be a lot of fun!

VarsityPuppet is offline   you may: quote & reply,
Old 04-09-2013, 01:05 PM   #285
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 628
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by VarsityPuppet View Post
Well it would be easier if one could program such things in one contiguous file. Kinda stinks having so many separate files to go through. Sure, you could include a lot of scripts that define functions.

Actually that sounds like it would be a lot of fun!
"Ahhh! He's insane! Aaatttttaaaccckkkk!!!"~~the mob continues to assault programmers everywhere...


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 04-09-2013, 02:50 PM   #286
Darth InSidious
A handful of dust.
 
Darth InSidious's Avatar
 
Join Date: Feb 2005
Location: The Eleven-Day Empire
Posts: 5,782
Current Game: KotOR II
You could include a check in the creature's OnHeartbeat script to reapply the script. It wouldnt quite be permanent - there'd be a few seconds at the start of each module where it wouldn't be active - but it would be close.



Works-In-Progress
~
Mods Released
~
Quid existis in desertum videre?
Darth InSidious is offline   you may: quote & reply,
Old 04-09-2013, 07:34 PM   #287
supreme kotor
Junior Member
 
supreme kotor's Avatar
 
Join Date: Mar 2013
Location: I'm lost.
Posts: 326
Current Game: Modding.. Wait is that a game?
Thanks a lot I will try the permanent and if dosent work I'll just use the on heart beat.


Current WIP: Learning to mod Kotor
supreme kotor is offline   you may: quote & reply,
Old 04-25-2013, 03:58 PM   #288
Taunger
Rookie
 
Taunger's Avatar
 
Join Date: Oct 2010
Location: Mos Eisley
Posts: 46
Current Game: KotOR
Dialog Battles [K1]

Hello there! Hope it's alright to post this here:

I’m looking to create dialogs with fight sequences for K1 like these:

Jedi vs Sith on Endar Spire
Vulkars vs Beks
Bastila vs Revan
Jolee vs Katarns

The CutsceneAttack function is often mentioned and works, but I run into the problem that was also discussed here without a solution coming up, which is that it works for only one attack. For that reason, I don’t think this function is used in the scenes above; I can clearly see an NPC attack more than once in a single dialog node.

So, my question is, what other method is there to create these fight sequences? I’d like them to be identical every time. Should I use the ActionPlayAnimation or PlayAnimation functions? In that case, would I have to “manually” call the attacker’s and defender’s animation, plus any effects like sparks or lasers from blasters?
Taunger is offline   you may: quote & reply,
Old 04-25-2013, 05:41 PM   #289
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 628
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by Taunger View Post
Hello there! Hope it's alright to post this here:

I’m looking to create dialogs with fight sequences for K1 like these:

Jedi vs Sith on Endar Spire
Vulkars vs Beks
Bastila vs Revan
Jolee vs Katarns

The CutsceneAttack function is often mentioned and works, but I run into the problem that was also discussed here without a solution coming up, which is that it works for only one attack. For that reason, I don’t think this function is used in the scenes above; I can clearly see an NPC attack more than once in a single dialog node.

So, my question is, what other method is there to create these fight sequences? I’d like them to be identical every time. Should I use the ActionPlayAnimation or PlayAnimation functions? In that case, would I have to “manually” call the attacker’s and defender’s animation, plus any effects like sparks or lasers from blasters?
Have you tried putting the CutsceneAttack function in a for loop? Like this:

Show spoiler


Don't forget to insert the arguments for the CutsceneAttack function.


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 04-25-2013, 08:46 PM   #290
Taunger
Rookie
 
Taunger's Avatar
 
Join Date: Oct 2010
Location: Mos Eisley
Posts: 46
Current Game: KotOR
No, that doesn't seem to work either. It attacks once, then does nothing...

Thanks for trying to help, though!
Taunger is offline   you may: quote & reply,
Old 04-26-2013, 09:41 AM   #291
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,288
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
You could probably just call CutsceneAttack over and over again, sort of like this:

Code:
void main()
{

object oOne = GetObjectByTag("one");
object oTwo = GetObjectByTag("two");

AssignCommand(oOne, CutsceneAttack();
AssignCommand(oTwo, CutsceneAttack();
AssignCommand(oOne, CutsceneAttack();
AssignCommand(oTwo, CutsceneAttack();
AssignCommand(oOne, CutsceneAttack();
AssignCommand(oTwo, CutsceneAttack();

}
(I'm pretty sure this script won't compile, it's just an example of what you could do.)

I remember when I made a cutscene I just used the attack function, made two NPC's attack each other and then let them have it for a few seconds. Then I would end it did with the use talent feat function. I don't know if these function names are correct, I'm on my phone at the moment. I'll check back later when I'm on my computer.


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 04-26-2013, 05:09 PM   #292
Taunger
Rookie
 
Taunger's Avatar
 
Join Date: Oct 2010
Location: Mos Eisley
Posts: 46
Current Game: KotOR
Fallen Guardian, your code makes calls for one attacker, then the other, then the first one again and so on. This is how fighting in-game works as well; it's turn based. I think that's why making a call for the attacker to repeatedly attack doesn't work (which is what I was trying to do), it's waiting for the victim to fight back, which it doesn't, because I've not programmed it to do so.

After some more tinkering I think I've found the solution, which is to use:

Code:
ChangeToStandardFaction(oVictim, STANDARD_FACTION_PREY);
ChangeToStandardFaction(oAttacker, STANDARD_FACTION_PREDATOR);
This, apparently, makes the attacker ignore the turn-taking rules.

There's one weird caveat with this, however. If I use something like this:

Code:
AssignCommand(oAttacker, CutsceneAttack(oVictim, 197, ATTACK_RESULT_MISS, 0));
AssignCommand(oAttacker, CutsceneAttack(oVictim, 197, ATTACK_RESULT_CRITICAL_HIT, 1000));
The animation of the first attack will play, but not the second time. The attack does succeed, because the victim dies. The animation for any attacks after the first one will only play if the CutsceneAttack call is made after the previous attack has already finished. So, it needs to be something like this:

Code:
AssignCommand(oAttacker, CutsceneAttack(oVictim, 197, ATTACK_RESULT_MISS, 0));
DelayCommand(3.5, AssignCommand(oAttacker, CutsceneAttack(oVictim, 197, ATTACK_RESULT_CRITICAL_HIT, 1000)));
I just tested this myself and it works!
Still, it seems rather... curious.
Taunger is offline   you may: quote & reply,
Old 04-26-2013, 05:32 PM   #293
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 628
Current Game: Master of Orion 2
Helpful! 
Show spoiler


Could someone put that into a tutorial for cutscene combat, please?


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 04-26-2013, 06:54 PM   #294
supreme kotor
Junior Member
 
supreme kotor's Avatar
 
Join Date: Mar 2013
Location: I'm lost.
Posts: 326
Current Game: Modding.. Wait is that a game?
Quote:
Originally Posted by Fair Strides 2 View Post

Could someone put that into a tutorial for cutscene combat, please?
Seconding this.

-Supreme Kotor


Current WIP: Learning to mod Kotor
supreme kotor is offline   you may: quote & reply,
Old 04-27-2013, 07:49 AM   #295
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 572
Here is an example how TSLRCM does it;

Code:
 //{[Handmaiden attacks, Kreia barely moves, deftly avoiding every blow, then gets bored, and grabs the Handmaiden by the throat, or in a Force Crush.]}
                     case 5:
                           {
                           SetMinOneHP(oHandmaiden, TRUE);
                           SetMinOneHP(oKreia, TRUE);
                           AssignCommand(oHandmaiden , ActionAttack(oKreia));
                           DelayCommand(3.0, AssignCommand(oHandmaiden , ActionAttack(oKreia)));
                           DelayCommand(6.0, AssignCommand(oHandmaiden , ActionAttack(oKreia)));
                           DelayCommand(8.0, AssignCommand(oHandmaiden , ActionAttack(oKreia)));
                           DelayCommand(10.0, SetMinOneHP(oKreia, FALSE));
                           DelayCommand(10.0, SetMinOneHP(oHandmaiden , FALSE));
                           DelayCommand(10.0, AssignCommand(oKreia, ActionPlayAnimation(10063, 1.0, 3.5)));
                           DelayCommand(10.1, AssignCommand(oHandmaiden , ClearAllActions()));
                           DelayCommand(10.2, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectChoke(), oHandmaiden, 3.0));
                           DelayCommand(13.3, AssignCommand(oHandmaiden , ClearAllActions()));
                           DelayCommand(13.5, AssignCommand(oHandmaiden, SetIsDestroyable(0, 1, 0)));
                           effect efDeath = EffectDeath(0, 0, 1);
                           DelayCommand(13.5, ApplyEffectToObject(2, efDeath, oHandmaiden, 0.0));
                           }
                           break;
Hassat Hunter is offline   you may: quote & reply,
Old 04-28-2013, 07:28 PM   #296
Taunger
Rookie
 
Taunger's Avatar
 
Join Date: Oct 2010
Location: Mos Eisley
Posts: 46
Current Game: KotOR
Show spoiler


Did you also have to set them to specific factions?
Taunger is offline   you may: quote & reply,
Old 04-29-2013, 03:19 PM   #297
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 572
No.
She's neutral by default though.

When not, yeah, it has to be done. Here for example Kreia vs. Hanharr in the Jekk Jekk Tar. One solution actually has him attack, the other version uses animations to 'fake' it. Had to be done that way considering it works differently if he's a teammate, and damage will break the cutscene.

Code:
	if ((nParam1 == 5)) {
		object oKreia = GetObjectByTag("Kreia", 0);
		object oHanharr = GetObjectByTag("Hanharr", 0);
		ChangeToStandardFaction(oHanharr, STANDARD_FACTION_GIZKA_1);
		ChangeToStandardFaction(oKreia, STANDARD_FACTION_GIZKA_2);
        DelayCommand(0.2, AssignCommand(oHanharr, ActionAttack(oKreia)));
		DelayCommand(1.0, ChangeToStandardFaction(oHanharr, STANDARD_FACTION_FRIENDLY_1));
		DelayCommand(1.0, ChangeToStandardFaction(oKreia, STANDARD_FACTION_FRIENDLY_1));
		DelayCommand(2.2, AssignCommand(oKreia, ActionPlayAnimation(10063, 1.0, 3.5)));
        DelayCommand(2.3, AssignCommand(oHanharr, ClearAllActions()));
        DelayCommand(2.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectChoke(), oHanharr, 2.3));
        DelayCommand(4.9, AssignCommand(oHanharr, ClearAllActions()));
	}
	if ((nParam1 == 6)) {
		object oKreia = GetObjectByTag("Kreia", 0);
		object oHanharr = GetObjectByTag("Hanharr", 0);
        DelayCommand(0.2, AssignCommand(oHanharr, ActionPlayAnimation(10098, 1.0, 3.5)));
		DelayCommand(2.2, AssignCommand(oKreia, ActionPlayAnimation(10063, 1.0, 3.5)));
        DelayCommand(2.3, AssignCommand(oHanharr, ClearAllActions()));
        DelayCommand(2.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectChoke(), oHanharr, 2.3));
		SetFakeCombatState(oHanharr, 0);
		SetFakeCombatState(oKreia, 0);
        DelayCommand(4.9, AssignCommand(oHanharr, ClearAllActions()));
	}
Hassat Hunter is offline   you may: quote & reply,
Old 05-10-2013, 06:49 AM   #298
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 572
Need some help. Here's a script to make Atton and the PC get Pazaak cards in their hand. All good, and it works... but the PC's cards are invisible. Atton works fine, just not the PC.
If the convo ends I find the cards in my hand, still invisible. Swapping with other weapon and back makes visible, so tried unequipping and re-equipping... didn't work. Tried adding a specific "render" to the pazaak cards, didn't work. Not quite sure what more to try.
I'd rather use the real player than a fake dummy, as that complicates things down the road for what I want... so, anyone got a clue what to do?
Code:
void main () {
	object oPC = GetFirstPC();
	object oAtton = GetObjectByTag("Atton");
	int nParam1 = GetScriptParameter(1);
	if ((nParam1 == 0)) {
		SetGlobalFadeOut(0.0, 0.0, 0.0, 0.0, 0.0);
		SetGlobalFadeIn(1.0, 1.0, 0.0, 0.0, 0.0);
		GiveItem(GetItemInSlot(4, oPC), oPC);
		GiveItem(GetItemInSlot(5, oPC), oPC);
		GiveItem(GetItemInSlot(4, oAtton), oPC);
		GiveItem(GetItemInSlot(5, oAtton), oPC);
		CreateItemOnObject("w_pazaak_01", oPC, 1, 1);
		CreateItemOnObject("w_pazaak_01", oAtton, 1, 1);
		DelayCommand(0.5, AssignCommand(oPC, ActionEquipItem(GetObjectByTag("w_pazaak_01"), 4, TRUE)));
		DelayCommand(0.5, AssignCommand(oAtton, ActionEquipItem(GetObjectByTag("w_pazaak_01"), 4, TRUE)));
		AssignCommand(oPC, ActionJumpToLocation(Location(Vector(54.15430,45.80115,1.80000),260.0f)));
		AssignCommand(oAtton, ActionJumpToLocation(Location(Vector(54.26917,43.75487,1.80000),60.0f)));
		DelayCommand(0.8, AssignCommand(oPC, ActionPlayAnimation(38, 1.0, (-1.0))));
		DelayCommand(0.8, AssignCommand(oAtton, ActionPlayAnimation(38, 1.0, (-1.0))));
	}
}
Hassat Hunter is offline   you may: quote & reply,
Old 05-10-2013, 09:25 AM   #299
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,640
Hmm... I just executed it and I didn't end up with invisible cards. Tried it with various weapons in hand, always seemed to do what it's meant to do. Sorry, I got nothing more than that, other than I did it outside of a conversation.


JCarter426 is offline   you may: quote & reply,
Old 05-10-2013, 10:19 AM   #300
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 572
Hmmm, yes, once I dropped the cutscene I got the pazaak cards in hand. Annoying is Atton immediately does his Ebon Hawk routine though, which makes him not getting his cards.

Going to try dropping out real fast then rebooting the convo and have Atton get his cards then... hope that works.

EDIT: After all that effort, nope. Once the action comes back on the PC loses his hand :/.

Last edited by Hassat Hunter; 05-10-2013 at 10:39 AM.
Hassat Hunter is offline   you may: quote & reply,
Old 05-10-2013, 10:49 AM   #301
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,640
You sure UnequipItems is not selected in the DLG properties?


JCarter426 is offline   you may: quote & reply,
Old 05-10-2013, 10:53 AM   #302
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 572
Yup. And if I don't swap items a very active lightsaber proves that (or pazaak playing with sabers, which is funny, but not really good)...
Hassat Hunter is offline   you may: quote & reply,
Old 05-10-2013, 10:59 AM   #303
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 572
Aaaaaaaand... fixed it. It was stupidly simple to boot.
Even with each getting their own pazaak cards, they both tried to equip the same one pair from the inventory (somehow). Which bugged out the game.

So instead of giving them cards and letting them equip them, spawned them straight into their hands, and this time they didn't try to share the same one item and it worked!
Hassat Hunter is offline   you may: quote & reply,
Old 05-10-2013, 11:00 AM   #304
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,640
Aaaaaaaaaaah... good to hear it.


JCarter426 is offline   you may: quote & reply,
Old 05-16-2013, 10:06 AM   #305
supreme kotor
Junior Member
 
supreme kotor's Avatar
 
Join Date: Mar 2013
Location: I'm lost.
Posts: 326
Current Game: Modding.. Wait is that a game?
Hey guys well I'm looking for a script that would be something along the lines of this:

1)checks if person A is dead
2checks if person B is dead
3)checks if person C is alive.

Just so your fully aware this script will be placed onto person B's on death script.


Current WIP: Learning to mod Kotor
supreme kotor is offline   you may: quote & reply,
Old 05-16-2013, 01:10 PM   #306
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 628
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by supreme kotor View Post
Hey guys well I'm looking for a script that would be something along the lines of this:

1)checks if person A is dead
2checks if person B is dead
3)checks if person C is alive.

Just so your fully aware this script will be placed onto person B's on death script.
First off, I'm assuming Person A is the party leader, and Person C is the third member in the party.

Something like this should get you started(though I can't compile it to test it):

Show spoiler


Of course, that assumes that you don't want anything to happen if either Person A or B is also alive when the script activates. If you do want something to happen, then I can work that in too.


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 05-16-2013, 04:07 PM   #307
supreme kotor
Junior Member
 
supreme kotor's Avatar
 
Join Date: Mar 2013
Location: I'm lost.
Posts: 326
Current Game: Modding.. Wait is that a game?
Well I might be about to make your life harder but what I was wondering is if you can make a certian dialog only fire if person B is Alive otherwise just a generic dialog will fire.


Current WIP: Learning to mod Kotor
supreme kotor is offline   you may: quote & reply,
Old 05-16-2013, 05:44 PM   #308
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 628
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by supreme kotor View Post
Well I might be about to make your life harder but what I was wondering is if you can make a certian dialog only fire if person B is Alive otherwise just a generic dialog will fire.
Assuming what I've already assumed... It'd be a tad tricky.

You see, for two party members to be down(automatically making Person B the party leader), you'd have to be in combat or just out of it. Also you want this in the OnDeath Script, so the game might just yank the plug on the game when the script fires...

However, if you wanted it tested on people who aren't in your party, then this is entirely possible, you'll just have to specify who person B is with GetObjectByTag.

Any help so far?


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 05-16-2013, 05:58 PM   #309
supreme kotor
Junior Member
 
supreme kotor's Avatar
 
Join Date: Mar 2013
Location: I'm lost.
Posts: 326
Current Game: Modding.. Wait is that a game?
Thanks Fair Strides 2 you have been helping a lot thanks for that. Now I have a theory; thereticly I could make both of the party members henchmen in the dialog right before the fight and then use the same script with person A=Henchman 1(Party member 1) B=Henchman 2 (Part member 2) and C=the guy were fighting. And then use that to fire unique dialog based on who's still alive?


Current WIP: Learning to mod Kotor
supreme kotor is offline   you may: quote & reply,
Old 05-16-2013, 06:12 PM   #310
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 628
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by supreme kotor View Post
Thanks Fair Strides 2 you have been helping a lot thanks for that. Now I have a theory; thereticly I could make both of the party members henchmen in the dialog right before the fight and then use the same script with person A=Henchman 1(Party member 1) B=Henchman 2 (Part member 2) and C=the guy were fighting. And then use that to fire unique dialog based on who's still alive?
You might experiment with ChangeStandardFaction and setting it to Friendly 2(Friendly 1 I believe is what party members already are. Could you perhaps discuss by PM what happens before, during, and after the fight?

Aarrggghhh!!! My laptop's been getting "fixed" for almost 3 weeks, and I can't actually fire up K1 or TSl until it is. Maybe not even then, it depends on the graphics card...

Then I could actually help you.


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 05-16-2013, 07:08 PM   #311
supreme kotor
Junior Member
 
supreme kotor's Avatar
 
Join Date: Mar 2013
Location: I'm lost.
Posts: 326
Current Game: Modding.. Wait is that a game?
Quote:
Originally Posted by Fair Strides 2 View Post
You might experiment with ChangeStandardFaction and setting it to Friendly 2(Friendly 1 I believe is what party members already are. Could you perhaps discuss by PM what happens before, during, and after the fight?

Aarrggghhh!!! My laptop's been getting "fixed" for almost 3 weeks, and I can't actually fire up K1 or TSl until it is. Maybe not even then, it depends on the graphics card...

Then I could actually help you.
PM'ed you explained everything in DETAIL.

Thanks-Supreme Kotor


Current WIP: Learning to mod Kotor
supreme kotor is offline   you may: quote & reply,
Old 05-23-2013, 10:19 PM   #312
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,288
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Problems with a Function in KotOR 2

So I've been attempting to use the DisplayMessageBox function in KotOR 2, yet once I click okay on the message box that pops up the menu doesn't return. I can't move and none of the buttons work. Is this just because Obsidian never actually made this a working function?


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 06-01-2013, 04:22 PM   #313
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,467
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Quote:
Originally Posted by Fallen Guardian View Post
So I've been attempting to use the DisplayMessageBox function in KotOR 2, yet once I click okay on the message box that pops up the menu doesn't return. I can't move and none of the buttons work. Is this just because Obsidian never actually made this a working function?
Hello all! I have been away too long, and I am so happy to find most of you still right here, plugging away!

I am not familiar with this function, but I would say that if you can find it in Kotor2's nwscript.nss, then it should work the same way. If it is not in there, you know that is the issue.

Should be simple to "fix" but it would require you shipping your "new" version of the nwscript.nss be shipped with your mod, and then of course there would be the problem of making sure everything is getting compiled with the new version. Maybe not such a simple fix.

Perhaps easier is to make a new function that works the same way, and use that. Do you have the source for the DisplayMessageBox function code?


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 06-01-2013, 06:10 PM   #314
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 572
AFAIK you can't modify nwscript.nss in any way for use in the game.
Hassat Hunter is offline   you may: quote & reply,
Old 06-02-2013, 03:35 PM   #315
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,467
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Quote:
Originally Posted by Hassat Hunter View Post
AFAIK you can't modify nwscript.nss in any way for use in the game.
The problem is not in modifying the nwscript.nss. It is that the game may not use nwscript.nss to compile the files... Of course we use it when we compile with KTool or something else, but we are using the nss portion. I suspect that the engine has its own version of a compiled nwscript that is exactly a match for the .nss that we can access. It is a problem of universality... modifying it is a Pandora's box.


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 06-10-2013, 01:42 AM   #316
bunjeeman
Rookie
 
bunjeeman's Avatar
 
Join Date: Oct 2011
Location: Australia
Posts: 60
Hey, what's the effect that increases FP cost in KotOR I?
Also, what is AC, in terms of AC increase or decrease?


It is better to have it and not need it than to need it and not have it.
bunjeeman is offline   you may: quote & reply,
Old 10-25-2013, 09:41 PM   #317
Taunger
Rookie
 
Taunger's Avatar
 
Join Date: Oct 2010
Location: Mos Eisley
Posts: 46
Current Game: KotOR
ActionDoCommand vs AssignCommand

Say, can anyone enlighten me on the exact difference between the ActionDoCommand and AssignCommand functions (in K1)?

I found someone saying that ActionDoCommand works for assigning actions, and AssignCommand for non-actions. If that is true, then what exactly is an action and what is a non-action (that is still assignable)?
Taunger is offline   you may: quote & reply,
Old 10-25-2013, 10:22 PM   #318
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,288
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by Taunger View Post
Say, can anyone enlighten me on the exact difference between the ActionDoCommand and AssignCommand functions (in K1)?

I found someone saying that ActionDoCommand works for assigning actions, and AssignCommand for non-actions. If that is true, then what exactly is an action and what is a non-action (that is still assignable)?
I'm pretty certain you have to always use AssignCommand whenever you're making an object do something. However, ActionDoCommand is used to add commands to the object's action queue that would not be added just by using an AssignCommand. For example, in a script like this:

Code:
void main()
{


   AssignCommand(GetObjectByTag("Carth"), ActionForceMoveToObject(GetObjectByTag("Bastila")));
   AssignCommand(GetObjectByTag("Carth"), SetFacing(325.5));

}
SetFacing is not a command that is inherently added to the action queue, thus Carth's walking command would most likely be messed up by his trying to face 325.5 degrees.

However, if you set it up like this:

Code:
void main()
{


   AssignCommand(GetObjectByTag("Carth"), ActionForceMoveToObject(GetObjectByTag("Bastila")));
   AssignCommand(GetObjectByTag("Carth"), ActionDoCommand(SetFacing(325.5)));

}
It adds SetFacing to the action queue, so Carth will finish walking to Bastila before he turns to face 325.5 degrees.

You can read up on ActionDoCommand, and all things scripting, here.


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-25-2013, 10:42 PM   #319
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 628
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by Taunger View Post
Say, can anyone enlighten me on the exact difference between the ActionDoCommand and AssignCommand functions (in K1)?

I found someone saying that ActionDoCommand works for assigning actions, and AssignCommand for non-actions. If that is true, then what exactly is an action and what is a non-action (that is still assignable)?
Well, the documentation for both are:
Code:
// 294: Do aActionToDo.

void ActionDoCommand(action aActionToDo);
and
Code:
// 6: Assign aActionToAssign to oActionSubject.
// * No return value, but if an error occurs, the log file will contain
//   "AssignCommand failed."
//   (If the object doesn't exist, nothing happens.)

void AssignCommand(object oActionSubject,action aActionToAssign);
In my experience, one should/would use the first function at times where the target is one's self, ie: in the On***(Fill in with: Spawn, Heartbeat, Attacked, and the other events), or in a cutscene.

What happens with each? Well...

ActionDoCommand adds the action to the front(top?) of the action queue, making it happen immediately.

AssignCommand, however, adds the action to the end(bottom?) of the action queue, allowing for one to "chain" actions together.


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 10-26-2013, 09:34 PM   #320
Taunger
Rookie
 
Taunger's Avatar
 
Join Date: Oct 2010
Location: Mos Eisley
Posts: 46
Current Game: KotOR
Thanks for the help guys! (or gals, I don’t know )

So, if I understand correctly, AssignCommand is used for assigning a subject to do some function starting with “Action” (e.g. “ActionMoveToLocation”), while ActionDoCommand is used to “convert” a function that does not start with “Action” (e.g. SetFacing) to one that does, i.e. to something that can be added to some object’s action queue (otherwise it’s not added to the action queue but executed immediately). You can then use AssignCommand to assign this action to an object, unless the action is meant to be executed (immediately) by the caller of the script (e.g. in an “OnAttacked” script).

Code:
SetFacing(); // Makes script caller immediately do something.

ActionMoveToLocation(); // Adds action to script caller’s action cue.

ActionDoCommand(SetFacing()); // Adds non-action to script caller’s action cue.

AssignCommand(oObject, ActionMoveToLocation()); // Adds action to oObject’s action cue.

AssignCommand(oObject, ActionDoCommand(SetFacing())); // Adds non-action to oObject’s action cue.
Again, an action is a function that starts with “Action” and a non-action is one that doesn’t.
Of course, I’m leaving out parameters and stuff, but you know what I mean.

Anyway, if I explain it this way, is it correct?

Last edited by Taunger; 10-26-2013 at 11:20 PM.
Taunger 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 02:57 PM.

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