lfnetwork.com mark read register faq members calendar

Thread: Disguise Script
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-17-2009, 09:01 PM   #1
Mandalore_The_Great
Rookie
 
Mandalore_The_Great's Avatar
 
Join Date: Nov 2008
Location: Cali, Puerto Rico's homeland
Posts: 228
Current Game: My 360 Games
Disguise Script

I found a script called qa_setanim and it says it's a disguise script

Code:
void main()
{
    int nX = GetRunScriptVar();
    effect eDisguise = EffectDisguise(nX);
    ClearAllEffects();
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDisguise, GetFirstPC());
}
What do I replace to make this into a working disguise script? I'm guessing it would be a line in appearance.2da or the tag, but I'm not sure where to put all the info


I'm back!!! Mua ha ha ha ha... ha
I might be releasing some new mods for K1, so check Filefront for some of my mods, acrazyone1(or acrazy1one, can't remember)

"Mandalorians don't make threats. We make promises." --SithRevan Tribute Armor--
Mandalore_The_Great is offline   you may: quote & reply,
Old 02-17-2009, 11:03 PM   #2
Star Admiral
N7 Commando
 
Star Admiral's Avatar
 
Join Date: Oct 2008
Location: Omega 4 Relay
Posts: 656
Current Game: Mass Effect 2
Folder extraordinaire Helpful! 
This script is designed to change the PC's appearance. As it stands, it should work just fine. Where to put it depends on what you want to do with it. You can attach it to a dialog to change the PC's appearance at the end of the conversation, for example. There's no need to edit the appearance.2da file; I doubt it even has a column for scripts.

- Star Admiral
Star Admiral is offline   you may: quote & reply,
Old 02-18-2009, 08:57 PM   #3
Mandalore_The_Great
Rookie
 
Mandalore_The_Great's Avatar
 
Join Date: Nov 2008
Location: Cali, Puerto Rico's homeland
Posts: 228
Current Game: My 360 Games
when I use it as is my game crashes


I'm back!!! Mua ha ha ha ha... ha
I might be releasing some new mods for K1, so check Filefront for some of my mods, acrazyone1(or acrazy1one, can't remember)

"Mandalorians don't make threats. We make promises." --SithRevan Tribute Armor--
Mandalore_The_Great is offline   you may: quote & reply,
Old 02-18-2009, 09:12 PM   #4
Silveredge9
Retired Modder
 
Silveredge9's Avatar
 
Join Date: Sep 2003
Location: United Kingdom
Posts: 710
Veteran Modder Forum Veteran Hot Topic Starter Contest winner - Modding 
You could try something like this:

Code:
void main()
{
    effect eDisguise = EffectDisguise(APPEARANCE.2DA LINE NUMBER GOES HERE);
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDisguise, GetFirstPC());
}
To clear the effect, you could use the "ClearAllEffects();" function.

Silveredge9 is offline   you may: quote & reply,
Old 02-18-2009, 09:17 PM   #5
Mandalore_The_Great
Rookie
 
Mandalore_The_Great's Avatar
 
Join Date: Nov 2008
Location: Cali, Puerto Rico's homeland
Posts: 228
Current Game: My 360 Games
Oh... I think I understand what some of this stuff actually means. effect eDisguise=... is telling the script what to do when eDisguise is mentioned in another line... then the second line is activating the eDisguise specified in the first line. for some reason I never saw it that way

Edit: well thanks, it works. Kind of odd that script didn't work, though


I'm back!!! Mua ha ha ha ha... ha
I might be releasing some new mods for K1, so check Filefront for some of my mods, acrazyone1(or acrazy1one, can't remember)

"Mandalorians don't make threats. We make promises." --SithRevan Tribute Armor--

Last edited by RedHawke; 02-19-2009 at 02:18 AM. Reason: Combining double post... No more ok?
Mandalore_The_Great is offline   you may: quote & reply,
Old 02-18-2009, 10:09 PM   #6
Star Admiral
N7 Commando
 
Star Admiral's Avatar
 
Join Date: Oct 2008
Location: Omega 4 Relay
Posts: 656
Current Game: Mass Effect 2
Folder extraordinaire Helpful! 
I believe that it didn't work because of the lines:

Code:
int nX = GetRunScriptVar();
effect eDisguise = EffectDisguise(nX);
If you attached the script to a dialog file, but did not pass in any variables from the dialog, the script would not know which appearance to change the main character to. That might have crashed the game.

- Star Admiral
Star Admiral is offline   you may: quote & reply,
Old 02-20-2009, 09:06 PM   #7
Mandalore_The_Great
Rookie
 
Mandalore_The_Great's Avatar
 
Join Date: Nov 2008
Location: Cali, Puerto Rico's homeland
Posts: 228
Current Game: My 360 Games
pass in any variables?


I'm back!!! Mua ha ha ha ha... ha
I might be releasing some new mods for K1, so check Filefront for some of my mods, acrazyone1(or acrazy1one, can't remember)

"Mandalorians don't make threats. We make promises." --SithRevan Tribute Armor--
Mandalore_The_Great is offline   you may: quote & reply,
Old 02-20-2009, 10:16 PM   #8
Star Admiral
N7 Commando
 
Star Admiral's Avatar
 
Join Date: Oct 2008
Location: Omega 4 Relay
Posts: 656
Current Game: Mass Effect 2
Folder extraordinaire Helpful! 
The neat thing about the dialog file in TSL is that it allows you to pass in up to 4 numbers and 1 string when executing a script, allowing the same script to be used multiple times, depending on what was passed in. K1, unfortunately, lacked this ability.

- Star Admiral
Star Admiral is offline   you may: quote & reply,
Old 02-21-2009, 06:16 AM   #9
glovemaster
Now-a-days GroovyCarrot
 
Join Date: Jan 2007
Location: Liverpool, UK
Posts: 697
Current Game: No time for games, sadly
Helpful! 
I had tried using GetRunScriptVar() with little success, it always seemed to return 2001 no matter what. The alternative that I used was a LocalNumber, setting the number in the first script and getting it again in the second.


If you're looking for any of the junk I did a few years ago; you can probably still find it all on filefront
glovemaster is offline   you may: quote & reply,
Old 02-21-2009, 08:40 AM   #10
stoffe
Mostly dormant
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,834
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by glovemaster View Post
I had tried using GetRunScriptVar() with little success, it always seemed to return 2001 no matter what.
The GetRunScriptVar() function is not used to get dialog parameters as was stated above. It's used in conjunction with with ExecuteScript() function. This function takes 3 parameters; the name of the script to run, an object reference to the object that should run the script (OBJECT_SELF inside the script), and an optional numeric parameter. This number you pass as the third parameter to ExecuteScript() can then be retrieved inside that script by using the GetRunScriptVar() function.


(A wild guess as to why you'd get 2001 is that if you call the GetRunScriptVar() function inside a script that you haven't run with the ExecuteScript() function it will return the parameter from the last script that was run via that method, which in your case presumably would be the general AI script, k_ai_master, which will run a party member heartbeat script if passed 2001 as parameter, which happens for each active party member roughly every 3 seconds.)


mt
stoffe is offline   you may: quote & reply,
Old 02-21-2009, 08:51 AM   #11
glovemaster
Now-a-days GroovyCarrot
 
Join Date: Jan 2007
Location: Liverpool, UK
Posts: 697
Current Game: No time for games, sadly
Helpful! 
Sorry that wasn't a very clear post, I was using ExecuteScript() though despite passing numbers like 300 or just 1, in the executed script GetRunScriptVar() just returned 2001. IIRC The NWscript mentions something about it being used for debugging?


If you're looking for any of the junk I did a few years ago; you can probably still find it all on filefront
glovemaster is offline   you may: quote & reply,
Old 02-21-2009, 08:56 AM   #12
stoffe
Mostly dormant
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,834
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by glovemaster View Post
Sorry that wasn't a very clear post, I was using ExecuteScript() though despite passing numbers like 300 or just 1, in the executed script GetRunScriptVar() just returned 2001. IIRC The NWscript mentions something about it being used for debugging?
It works as intended, otherwise the general AI that runs every creature in the game would be utterly broken. All the specific AI scripts set on the event trigger hooks on creatures do little other than ExecuteScript() the k_ai_master script, passing it a numeric parameter to tell it what to do (2001 = run party member heartbeat script, for example, as mentioned above). This applies to both games.

I've used it in several mods I've made as well with the intended results.


mt
stoffe is offline   you may: quote & reply,
Old 02-21-2009, 03:03 PM   #13
Mandalore_The_Great
Rookie
 
Mandalore_The_Great's Avatar
 
Join Date: Nov 2008
Location: Cali, Puerto Rico's homeland
Posts: 228
Current Game: My 360 Games
Wow... I have no idea what you guys are talking about. I like scripting but I'm not good with the lingo
thanks for the help, Silveredge9. Works fine. Is there a resource somewhere that has lists of these sort of things besides NWscript.nss? to me, it doesn't give enough information on how to use the functions and how to write it. scripting is somewhat over my head


I'm back!!! Mua ha ha ha ha... ha
I might be releasing some new mods for K1, so check Filefront for some of my mods, acrazyone1(or acrazy1one, can't remember)

"Mandalorians don't make threats. We make promises." --SithRevan Tribute Armor--
Mandalore_The_Great is offline   you may: quote & reply,
Old 02-21-2009, 04:03 PM   #14
Star Admiral
N7 Commando
 
Star Admiral's Avatar
 
Join Date: Oct 2008
Location: Omega 4 Relay
Posts: 656
Current Game: Mass Effect 2
Folder extraordinaire Helpful! 
Whoops, got the GetRunScriptVar() mixed with GetScriptParameter() . Sorry about that, and thanks for correcting me.

Regarding other sites where you can find some explanations of how to use the script functions, you could try the NWN Lexicon here. Although it was written for NeverWinter Nights, most of it applies to KOTOR as well.

- Star Admiral
Star Admiral is offline   you may: quote & reply,
Old 02-21-2009, 09:26 PM   #15
Mandalore_The_Great
Rookie
 
Mandalore_The_Great's Avatar
 
Join Date: Nov 2008
Location: Cali, Puerto Rico's homeland
Posts: 228
Current Game: My 360 Games
Thanks SA, helps a lot. Now I know what all that mess means....
just a random question, but when using CastFakeSpellAt-whatever, does it use the animation as well as the sparkles and shimmer? Or would I need to specify that before the void main()?


I'm back!!! Mua ha ha ha ha... ha
I might be releasing some new mods for K1, so check Filefront for some of my mods, acrazyone1(or acrazy1one, can't remember)

"Mandalorians don't make threats. We make promises." --SithRevan Tribute Armor--
Mandalore_The_Great is offline   you may: quote & reply,
Old 02-21-2009, 10:30 PM   #16
Star Admiral
N7 Commando
 
Star Admiral's Avatar
 
Join Date: Oct 2008
Location: Omega 4 Relay
Posts: 656
Current Game: Mass Effect 2
Folder extraordinaire Helpful! 
Not 100% sure, as I've never used this function before, but judging from its description, only the casting animations specified for the spell in the spells.2da file will be used. The actual script for the spell will be ignored. So no, you don't need to specify the animations before.

Correct me if I'm wrong.

- Star Admiral
Star Admiral is offline   you may: quote & reply,
Old 02-22-2009, 10:27 PM   #17
Mandalore_The_Great
Rookie
 
Mandalore_The_Great's Avatar
 
Join Date: Nov 2008
Location: Cali, Puerto Rico's homeland
Posts: 228
Current Game: My 360 Games
More scripting woes....
Code:
void main()
{
object oPC=GetPCSpeaker();
ActionPauseConversation();

//Make it seem like I'm casting the
//spell in line 15 of spells.2da
ActionCastFakeSpellAtObject(15, oPC);

//Apply a couple of visual effects to the PC
int nDur=DURATION_TYPE_INSTANT;
effect e1=EffectVisualEffect(3010);
effect e2=EffectVisualEffect(3016);
effect e3=EffectVisualEffect(1018);

ActionDoCommand(ApplyEffectToObject(nDur, e2, oPC));
ActionDoCommand(ApplyEffectToObject(nDur, e1, oPC));
ActionDoCommand(ApplyEffectToObject(nDur, e3, oPC));
ActionResumeConversation();
}
I've tried this script in two different conversations(one with and one without the ActionPause/ResumeConversation() ) and neither worked. Ideas?


I'm back!!! Mua ha ha ha ha... ha
I might be releasing some new mods for K1, so check Filefront for some of my mods, acrazyone1(or acrazy1one, can't remember)

"Mandalorians don't make threats. We make promises." --SithRevan Tribute Armor--

Last edited by Mandalore_The_Great; 02-23-2009 at 10:02 PM.
Mandalore_The_Great is offline   you may: quote & reply,
Old 02-23-2009, 01:05 AM   #18
Star Admiral
N7 Commando
 
Star Admiral's Avatar
 
Join Date: Oct 2008
Location: Omega 4 Relay
Posts: 656
Current Game: Mass Effect 2
Folder extraordinaire Helpful! 
Not sure how needed the ActionPauseConversation() is, as I've never used it before. Do you want your character to fake cast a power at a target, or do you want the target to fake cast a power at your character? The ActionDoCommand() looks suspicious to me.

- Star Admiral
Star Admiral is offline   you may: quote & reply,
Old 02-23-2009, 10:05 PM   #19
Mandalore_The_Great
Rookie
 
Mandalore_The_Great's Avatar
 
Join Date: Nov 2008
Location: Cali, Puerto Rico's homeland
Posts: 228
Current Game: My 360 Games
well, I made it so that whoever's talking to the PC casts it. This was originally an example from the downloadable version of the NWN Lexicon that I edited a little to add in an extra effect.
I used the ActionPauseConversation() to give it a cinematic effect.


I'm back!!! Mua ha ha ha ha... ha
I might be releasing some new mods for K1, so check Filefront for some of my mods, acrazyone1(or acrazy1one, can't remember)

"Mandalorians don't make threats. We make promises." --SithRevan Tribute Armor--
Mandalore_The_Great 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 > Disguise Script

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:15 PM.

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