Jump to content

Home

A script


noname35

Recommended Posts

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
(hidden content - requires Javascript to show)

00000008 42 0000017F T 0000017F

0000000D 1E 00 00000008 JSR fn_00000015

00000013 20 00 RETN

00000015 02 06 RSADDO

00000017 04 03 00000000 CONSTI 00000000

0000001D 04 05 0009 str CONSTS "AttonCage"

0000002A 05 00 00C8 02 ACTION GetObjectByTag(00C8), 02

0000002F 01 01 FFFFFFF8 0004 CPDOWNSP FFFFFFF8, 0004

00000037 1B 00 FFFFFFFC MOVSP FFFFFFFC

0000003D 02 06 RSADDO

0000003F 04 03 00000000 CONSTI 00000000

00000045 04 05 0010 str CONSTS "AttonCageBlocker"

00000059 05 00 00C8 02 ACTION GetObjectByTag(00C8), 02

0000005E 01 01 FFFFFFF8 0004 CPDOWNSP FFFFFFF8, 0004

00000066 1B 00 FFFFFFFC MOVSP FFFFFFFC

0000006C 04 03 00000000 CONSTI 00000000

00000072 04 04 00000000 CONSTF 0.000000

00000078 04 03 00000000 CONSTI 00000000

0000007E 04 04 00000000 CONSTF 0.000000

00000084 03 01 FFFFFFEC 0004 CPTOPSP FFFFFFEC, 0004

0000008C 05 00 00F1 05 ACTION DestroyObject(00F1), 05

00000091 2C 10 00000000 00000008 STORE_STATE 10, 00000000, 00000008

0000009B 1D 00 0000003E JMP off_000000D9

000000A1 2C 10 00000000 00000008 STORE_STATE 10, 00000000, 00000008

000000AB 1D 00 0000001F JMP off_000000CA

000000B1 04 04 00000000 CONSTF 0.000000

000000B7 04 04 3F800000 CONSTF 1.000000

000000BD 04 03 000000CA CONSTI 000000CA

000000C3 05 00 0028 03 ACTION ActionPlayAnimation(0028), 03

000000C8 20 00 RETN

000000CA 03 01 FFFFFFF8 0004 CPTOPSP FFFFFFF8, 0004

000000D2 05 00 0006 02 ACTION AssignCommand(0006), 02

000000D7 20 00 RETN

000000D9 04 04 3F000000 CONSTF 0.500000

000000DF 05 00 0007 02 ACTION DelayCommand(0007), 02

000000E4 02 06 RSADDO

000000E6 04 05 000D str CONSTS "WP_ATTON_FREE"

000000F7 05 00 00C5 01 ACTION GetWaypointByTag(00C5), 01

000000FC 01 01 FFFFFFF8 0004 CPDOWNSP FFFFFFF8, 0004

00000104 1B 00 FFFFFFFC MOVSP FFFFFFFC

0000010A 2C 10 00000000 0000000C STORE_STATE 10, 00000000, 0000000C

00000114 1D 00 00000038 JMP off_0000014C

0000011A 2C 10 00000000 0000000C STORE_STATE 10, 00000000, 0000000C

00000124 1D 00 0000001B JMP off_0000013F

0000012A 04 03 00000001 CONSTI 00000001

00000130 03 01 FFFFFFF8 0004 CPTOPSP FFFFFFF8, 0004

00000138 05 00 00C4 02 ACTION ActionJumpToObject(00C4), 02

0000013D 20 00 RETN

0000013F 04 06 00000000 CONSTO 00000000

00000145 05 00 0006 02 ACTION AssignCommand(0006), 02

0000014A 20 00 RETN

0000014C 04 04 40400000 CONSTF 3.000000

00000152 05 00 0007 02 ACTION DelayCommand(0007), 02

00000157 04 03 00000001 CONSTI 00000001

0000015D 04 05 0011 str CONSTS "101PER_Talk_Atton"

00000172 05 00 0245 02 ACTION SetGlobalNumber(0245), 02

00000177 1B 00 FFFFFFF4 MOVSP FFFFFFF4

0000017D 20 00 RETN

 

Fastmaniac

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

The force cages use model animations. This is the script I use for these, though it will only work in K2:

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...