lfnetwork.com mark read register faq members calendar

Thread: A 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 03-12-2012, 05:24 PM   #1
noname35
Rookie
 
noname35's Avatar
 
Join Date: Feb 2012
Location: Nar Shadaa
Posts: 123
Current Game: KotOR 1 and 2
A script

Is there a script for everything? Like a script that opens a force cage?


Holowan's neediest modder
noname35 is offline   you may: quote & reply,
Old 03-12-2012, 07:03 PM   #2
Fastmaniac
Rookie
 
Fastmaniac's Avatar
 
Join Date: Aug 2009
Location: Germany
Posts: 164
I think you mean energy cages, do you? For example the cages when you are held 'hostage' by the TSF? I tried decompiling a few scripts, but they all failed. Reading from the Bytecode of the compiled script I'd say the 'energy' around the cage is an object that is destroyed with a fade. Maybe someone with a little more knowledge could look at that:

Show spoiler


Fastmaniac
Fastmaniac is offline   you may: quote & reply,
Old 03-12-2012, 07:13 PM   #3
noname35
Rookie
 
noname35's Avatar
 
Join Date: Feb 2012
Location: Nar Shadaa
Posts: 123
Current Game: KotOR 1 and 2
Quote:
Originally Posted by Fastmaniac View Post
I think you mean energy cages, do you? For example the cages when you are held 'hostage' by the TSF? I tried decompiling a few scripts, but they all failed. Reading from the Bytecode of the compiled script I'd say the 'energy' around the cage is an object that is destroyed with a fade. Maybe someone with a little more knowledge could look at that:
Yep, that's the one. Do you know anyone who might know more about it?


Holowan's neediest modder
noname35 is offline   you may: quote & reply,
Old 03-12-2012, 07:36 PM   #4
Fastmaniac
Rookie
 
Fastmaniac's Avatar
 
Join Date: Aug 2009
Location: Germany
Posts: 164
I posted the code above for anyone who might be able to help. I know stoffe knows how to convert the code. Can't think of anyone else right now. If you want to figure it out by yourself, take a look at this: Link
Fastmaniac is offline   you may: quote & reply,
Old 03-12-2012, 08:52 PM   #5
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
The force cages use model animations. This is the script I use for these, though it will only work in K2:
Code:
void main() {

string sTag = GetScriptStringParameter();

int iAnim = GetScriptParameter(1);
int iSpeed = GetScriptParameter(2);
int iLength = GetScriptParameter(3);
int iDelay = GetScriptParameter(4);
int iNearest = GetScriptParameter(5);


	if (iSpeed == 0) iSpeed = 1;


	if (iNearest == 0) iNearest = 1;


	if (sTag == "") {
		object oTarget = GetNearestObject(OBJECT_TYPE_PLACEABLE, OBJECT_SELF, iNearest);
		DelayCommand(IntToFloat(iDelay), AssignCommand(oTarget, ActionPlayAnimation(iAnim, IntToFloat(iSpeed), IntToFloat(iLength))));

		}

	else {
		object oTarget = GetNearestObjectByTag(sTag, OBJECT_SELF, iNearest);
		DelayCommand(IntToFloat(iDelay), AssignCommand(oTarget, ActionPlayAnimation(iAnim, IntToFloat(iSpeed), IntToFloat(iLength))));

		}

}
The only parameter that is absolutely required is #1. For off, input 202 and for on, 204. If you need it for K1, you'll have to break it up into separate scripts and replace the variables with what you need.


JCarter426 is offline   you may: quote & reply,
Old 03-12-2012, 09:38 PM   #6
Scorge
Jedi Master
 
Scorge's Avatar
 
Join Date: Oct 2011
Location: Next door.
Posts: 566
Current Game: SWTOR
Alderaan News Holopics contributor 
Quote:
Originally Posted by noname35 View Post
Is there a script for everything?
What do you mean by everything?


Formally MrObiWan

If you need help with textures on any KotOR/TSL mod, feel free to contact me.



Scorge is offline   you may: quote & reply,
Old 03-15-2012, 07:03 PM   #7
noname35
Rookie
 
noname35's Avatar
 
Join Date: Feb 2012
Location: Nar Shadaa
Posts: 123
Current Game: KotOR 1 and 2
Quote:
Originally Posted by MrObiWan View Post
What do you mean by everything?
Well not literally everything, but everything possible by game standards. For example, making random commoners attack you or making enemys do damage to themselves?


Holowan's neediest modder
noname35 is offline   you may: quote & reply,
Old 03-15-2012, 07:55 PM   #8
newbiemodder
Gentleman Modder
 
newbiemodder's Avatar
 
Join Date: Feb 2009
Location: Chicago
Posts: 703
Veteran Modder 
Basically, every action you see is done via script whether it's people walking, fighting, doors opening/closing, etc is done via scripts


Who's more foolish, the fool or the fool that follows?

Just exactly what is a head-piece to the Staff of Ra?

http://www.lucasforums.com/showthread.php?t=206819

http://www.lucasforums.com/showthread.php?t=206541

http://www.lucasforums.com/showthrea...t=newbiemodder
newbiemodder is offline   you may: quote & reply,
Old 03-15-2012, 08:08 PM   #9
Scorge
Jedi Master
 
Scorge's Avatar
 
Join Date: Oct 2011
Location: Next door.
Posts: 566
Current Game: SWTOR
Alderaan News Holopics contributor 
I don't think you can control everything with one script though. If thats what your asking.......Its done via a few scripts.


Formally MrObiWan

If you need help with textures on any KotOR/TSL mod, feel free to contact me.



Scorge is offline   you may: quote & reply,
Old 03-15-2012, 09:42 PM   #10
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 550
And you don't even need to make scripts for that, just use prefab like spawndead, or a_atkonend. Though groups need a custom script...
Hassat Hunter is offline   you may: quote & reply,
Old 03-16-2012, 10:54 PM   #11
noname35
Rookie
 
noname35's Avatar
 
Join Date: Feb 2012
Location: Nar Shadaa
Posts: 123
Current Game: KotOR 1 and 2
So all scripts are loaded into the game, but placing new scripts in the override folder tells the game to do new things? (I'm new at scripting)


Holowan's neediest modder
noname35 is offline   you may: quote & reply,
Old 03-17-2012, 06:14 PM   #12
Fastmaniac
Rookie
 
Fastmaniac's Avatar
 
Join Date: Aug 2009
Location: Germany
Posts: 164
Every file you put in the override folder is added to the game's 'inventory'. If a script with the same name already exists in the 'inventory' is it overwritten by your custom script. Now, the script is only executed when the game wants it to be executed (ie triggered via conversation, trigger, etc.). The script is not executed just by putting it in the override, if that's what you're asking.
Fastmaniac is offline   you may: quote & reply,
Old 03-17-2012, 08:12 PM   #13
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
Quote:
Originally Posted by noname35 View Post
So all scripts are loaded into the game, but placing new scripts in the override folder tells the game to do new things? (I'm new at scripting)
Not new things, no. The game only has a certain number of functions, defined in NWScript. All the other individual scripts use these functions in different combinations. NWScript is like the dictionary, and the other scripts are sentences. So yes, new as in not done in that exact manner already, but not completely new, since there are certain limitations. There are certain game engines with which you could do that, but this is not one of them; actually, this one is very restrictive, at least in my experience - I'm by no means an expert, but I have modded for a handful of games, most with much greater ease than these.


JCarter426 is offline   you may: quote & reply,
Old 03-17-2012, 09:02 PM   #14
noname35
Rookie
 
noname35's Avatar
 
Join Date: Feb 2012
Location: Nar Shadaa
Posts: 123
Current Game: KotOR 1 and 2
Ok, that really makes sense. Thanks for your help.


Holowan's neediest modder
noname35 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 > Modding requests > A 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 12:01 AM.

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