Im trying to fix the problem where they never stock leather armor mk2, the scripts that come with the mapper2 program are easy enough to understand, but they dont bear any resemblance to the ones that the RP uses. Original script : Code: procedure map_enter_p_proc begin /* Set up the door state when the player first enters the map */ modoc_balthas_box_obj := self_obj; if (is_loading_game == false) then begin if (local_var(LVAR_Restock_Time) < game_time) then begin check_restock_item(PID_BOTTLE_CAPS, 475, 525, 100) check_restock_item(PID_LEATHER_ARMOR, 1, 1, 100) check_restock_item(PID_LEATHER_JACKET, 1, 1, 100) check_restock_item(PID_LEATHER_ARMOR_MK_II, 1, 1, 100) set_local_var(LVAR_Restock_Time, (random(5,10) * ONE_GAME_DAY) + game_time); end end end The mibalbox.int script that the RP uses looks completely different however. Part of the script : Code: procedure map_enter_p_proc begin variable LVar0 := 0; variable LVar1 := 0; modoc_balthas_box_obj := self_obj; if (metarule(22, 0) == 0) then begin if ((game_time < 0) and (local_var(1) == 0)) then begin set_local_var(0, game_time - 1); set_local_var(1, 1); end if (local_var(0) < game_time) then begin LVar0 := create_object_sid(128, 5, 0, -1); if (obj_is_carrying_obj_pid(self_obj, 479) > 0) then begin LVar1 := obj_carrying_pid_obj(self_obj, 479); rm_obj_from_inven(self_obj, LVar1); add_obj_to_inven(LVar0, LVar1); end if (obj_is_carrying_obj_pid(self_obj, 479) > 0) then begin LVar1 := obj_carrying_pid_obj(self_obj, 479); rm_obj_from_inven(self_obj, LVar1); add_obj_to_inven(LVar0, LVar1); end I dont get how this works. The PIDs dont even make sense, PID 479 are the navcomm parts according to the weapon editor, why does the balthas restocking script have them?
It's for preventing player from accidentally selling key/quest items to traders and those items would be lost forever when traders restock. And killap has already released script source for both UP and RP, why not checking them instead of the decompiled ones that variables are vague?
Ah, okay. I think I see the bits that affect restocking, but it seems unnecessarily complex. Are the script sources installed with the RP? I dont see any folders for them. I dont see them listed as a seperate download on his site either.
Oh, got the script sources now. OK, these ones make more sense. But for some reason the sfall compiler keeps throwing tons of errors everytime I try to compile them. For example, "condition.h line 107 expecting top-level statement". Am i supposed to do something else to the source scripts to get them to compile?
That is what the code really looks like. Anyway I don't use Headers myself so I haven't seen that error, but I would guess the sfall editor is having trouble finding them. Check if the Headers are located where the script is pointing to.
Code: /* Include Files */ #include "..\headers\define.h" #define NAME SCRIPT_MIBALBOX #include "..\headers\command.h" The headers are in Fallout 2\RP scripts\headers, I moved the mibalbox script to Fallout 2\RP scripts\ and most of the errors are now gone, but now i have two errors : it complains that it cannot open defines.h and command.h, even though the scripts are in the headers subfolder...
I dont see any trailing white spaces though... Am i supposed to put the files in some sort of special folder arrangement? This is what happens when i try to compile hioutbox.ssl : http://i.imgur.com/dwrb2tC.jpg This is when HITOUTBOX is in D:\Fallout 2\RP scripts and define.h is in both D:\Fallout 2\RP scripts and D:\Fallout 2\RP scripts\headers. I get different errors if HIOUTBOX is in D:\Fallout 2\RP scripts\BROKHILL : http://i.imgur.com/fj8OcQV.jpg No clue what those errors are talking about, i didn't modify line 345 or the other scripts, how was killap able to get them to compile without those errors? Edit : Okay I found a trailing white space but it wasnt at line 107, it was at line 98. The new line errors seem to be that you have to press enter after the last entry in the script. The macro undefined error is confusing, in EXPPOINT.H : #define EXP_CURED_FANNIE (500) Whats wrong with this? Same for the macro is redefined error : #define FID_MACYBR (16777291) // Added Cyber Dog I dont get how killap managed to get those scripts to compile with those errors...
You're not supposed to put Define.h in multiple folders. Are you at all familiar with Windows file path syntax? The line "../headers/define.h" means "go back one folder, then find the Headers folder, then find define.h in that folder. So obviously if your .ssl is in RP Scripts that will fail, you need to put it in a subfolder. Basically, leave the folder structure as it is in the RP sources download, and don't move files around. The errors you get when you have correct folder structure (top-level statement etc) are due to trailing white-space. As for the macro redefinition, are you including multiple define.h's in your script? Are you forgetting an #ifndef block somewhere?
These are the default RP source scripts. All im doing is editing the items that a merchant stocks, so unless killap included those errors in his scripts, they shouldnt have them. I dont see multiple define.hs in the merchant scripts. You dont get any of those macro errors with the RP source scripts?
The macro redefinition is only a warning. You can comment out "#define EXP_CURED_FANNIE (500)" line and ignore the FID_MACYBR part.
What I'm wondering is, why is OP getting errors for a Redding macro when he's trying to compile a script for a Vault City merchant box? Are you trying to compile all scripts or just the one for the box?
Oh good lord, you're right. Every time I get back into Fallout 2 scripting it takes a while before I realize how spaghetti it is.
Thanks, commenting out those lines work, im just confused why they need to be commented out if these are the source scripts.