Script mistake or proto not read?

Sirren67

Look, Ma! Two Heads!
I'm implementing a limited crafting ability. This is an excerpt from a script attached to a workbench:

procedure Node006a begin//10 mm pen pistol.
variable item;
variable skill;
if ( (obj_is_carrying_obj_pid(dude_obj, PID_ALLOY_PIPE) > 1) and (has_skill(dude_obj, SKILL_REPAIR) > 9) ) then begin
gfade_out(ONE_GAME_MINUTE);
game_time_advance(ONE_GAME_HOUR);
remove_pid_qty(dude_obj, PID_ALLOY_PIPE, 1)
give_pid_qty(dude_obj, PID_10MM_PEN_PISTOL, 1)
gfade_in(ONE_GAME_MINUTE);
call Node016;//you did it
end
else begin
call Node017;//you did not did it
end
end

The point is I always get Node017 even if the Pc has both the item and the required skill. I have a merchant selling my new protos, and I checked that the rigt objects are spowned: I'm positive I have the right object in my inventory. Script mistake? Any tips?
 
Code:
if ( (obj_is_carrying_obj_pid(dude_obj, PID_ALLOY_PIPE) > 1) and (has_skill(dude_obj, SKILL_REPAIR) > 9) ) then begin
In this code you need to have 2 (two) PID_ALLOY_PIPE objects and repair skill on 10 or more.
I think you want to be like this:
Code:
if ( (obj_is_carrying_obj_pid(dude_obj, PID_ALLOY_PIPE) > 0) and (has_skill(dude_obj, SKILL_REPAIR) > 9) ) then begin
 
Just checked it and works fine for me. Code is good.
Only thing that i changed was proto PID_FLARE instead of PID_ALLOY_PIPE.
Only thing that comes to my mind is that you got something wrong when you added this PID_ALLOY_PIPE entry in items.h.
 
I made the same experiment and it worked. I also checked with another om my new protos and it didn't work...
Here's a piece of my ITEMPID.H

#define PID_WAKIZASHI_BLADE (522)
#define PID_SURVEY_MAP (523)
#define PID_BRIDGEKEEPERS_ROBE (524)
#define PID_TYRE (543)
#define PID_ELECTRIC_COIL (546)
#define PID_ASSORTED_PIPES (550)
#define PID_ALLOY_PIPE (551)

What's wrong?
 
Well declaration in itempid.h is ok, but check your pid numbers in mapper, remember that you added PID_ALLOY_PIPE as pid 551.
BTW Since last original Fallout 2 item is 531 you must added a lot of new protos. :o
 
Actually I had several protos (8 or so) which I ditched/lost and I erased them from items.lst in my proto/item folder... Thus leaving "empty spaces" in the file... I start to wonder if my two latest problems are related in any way.
Anyway, let's make a summary:
A): Some of my items are weapons, so I edited command.h. This means that I have scripts using at least two different versions of this header. Could this be an issue?
B): There are empty spaces in a .lst file. Is this a problem? Should I rebuild my new protos?
C): Should my new protos be registered in other headers than itempid.h and command.h? There's a lot of stuff registered in define.h and condition.h, even if most of the items registered there are Fo1 related...

Wait, I checked the regular items in Fo2 mapper: the last original item (boss weapon plasma) is shown as item number 524, while the ALLOY_PIPE is number 532... And still it's the proto number 551... I'm positive about this... I used to have patch 1.04, but it seems to me there weren't new items. I also checked my "recipe" again, the "output weapon" is the correct one and it's a new proto.
Uhm :scratch: .

EDIT 2\2\06

:ok: I DID IT!! I got rid of all my new item protos, got fresh items.lst and headers, then I rebuilt my protos and registered them. I made a crafting experiment and it went silk-smooth :D
This also fixed my map problem... I knew the game is sensitive, but not THIS sensitive.
Thank you very much for your assistence, Jargo. Bye!
 
Glad that you worked it out.
Should my new protos be registered in other headers than itempid.h and command.h? There's a lot of stuff registered in define.h and condition.h, even if most of the items registered there are Fo1 related..
It is not important in what header file you put your new defines, just don't forget where all this ;).
There are empty spaces in a .lst file. Is this a problem? Should I rebuild my new protos?
This was the main problem here i think, there can not be any empty lines in lst files.
 
Back
Top