Jump to content

Home

Attack of the scripts


Darth_Robinson

Recommended Posts

I'm trying to modify a script from KOTOR 1 and I used the script decompiler, modified it and now it won't compile again. I tried decompiling it and then compiling it again without changing anything and it did the same thing. It says that there is a syntax error at 'integer constant', but I'm kind of clueless about what that means. Any help?

Link to comment
Share on other sites

I'm trying to modify a script from KOTOR 1 and I used the script decompiler, modified it and now it won't compile again. I tried decompiling it and then compiling it again without changing anything and it did the same thing. It says that there is a syntax error at 'integer constant', but I'm kind of clueless about what that means. Any help?

 

Hard to say what the problem is without seeing the script. Which script are you trying to modify? Post the source code (within a

 tag) and perhaps someone can spot what is wrong.
Link to comment
Share on other sites

I'm modifying Dia's reward script (k_ptar_diareward) to give the player a custom saber crystal instead of the boring sword upgrade.

 

Original:

00000008 42 0000003F              T 0000003F
0000000D 1E 00 00000008           JSR fn_00000015
00000013 20 00                    RETN
00000015 04 03 00000001           CONSTI 00000001
0000001B 05 00 00EE 00            ACTION GetPCSpeaker(00EE), 00
00000020 04 05 000E str           CONSTS "upgrade009"
00000032 05 00 001F 03            ACTION CreateItemOnObject(001F), 03
00000037 1B 00 FFFFFFFC           MOVSP FFFFFFFC
0000003D 20 00                    RETN

 

The modified script looks like:

00000008 42 0000003F              T 0000003F
0000000D 1E 00 00000008           JSR fn_00000015
00000013 20 00                    RETN
00000015 04 03 00000001           CONSTI 00000001
0000001B 05 00 00EE 00            ACTION GetPCSpeaker(00EE), 00
00000020 04 05 000E str           CONSTS "g_w_sbrcrstl27"
00000032 05 00 001F 03            ACTION CreateItemOnObject(001F), 03
00000037 1B 00 FFFFFFFC           MOVSP FFFFFFFC
0000003D 20 00                    RETN

 

I am undoubtedly missing something simple and stupid, so somebody please point out what I'm doing wrong.

Link to comment
Share on other sites

A KotOR I script? Jd Noa's script decompiler wont work on them - that is why you are stuck with the compiled data - Is it byte code? I don't think you can edit this and that might be the source of your problem. I believe you can translate the code manually into a readable and editable format but it takes forever. What exactly is it you are trying to do? We may be able to help you.

Link to comment
Share on other sites

I'm modifying Dia's reward script (k_ptar_diareward) to give the player a custom saber crystal instead of the boring sword upgrade.

 

(snip)

 

I am undoubtedly missing something simple and stupid, so somebody please point out what I'm doing wrong.

 

You cannot recompile processed bytecode (created with the -d flag from nwnnsscomp.exe). You must have the script source code (NSS file) to be able to compile it. The source code for the script you posted would look something like:

 

void main() {
   CreateItemOnobject("g_i_upgrade009", GetPCSpeaker());
}

 

It should work if you modify and compile that instead.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...