I've made this script for Meat Jerky.
The healing and radiation works, but the Jerky stays in my inventory. I'd like it to disappear once I've used it, like a drug/book, etc. The Cat's Paw #5 magazine disappears when used, which is why I tried sc_return, but it seems to have no effect. I've tried destroy_object(self_obj) too, but that just crashes the game.
Also, this only works in the mapper, when I run the game I get the default message when I try to use Jerky. Do I have to do something special in order to get the script working in-game?[/code]
Code:
#include "..\headers\define.h"
#define NAME SCRIPT_ZIJERKY
#include "..\headers\command.h"
procedure start;
procedure use_p_proc;
procedure start begin
end
procedure use_p_proc begin
script_overrides;
critter_heal(source_obj, random(1,4));
if (source_obj == dude_obj) then begin
radiation_inc(dude_obj, 2);
display_msg("You gained 2 Current Radiation Level.");
end
rm_obj_from_inven(source_obj, self_obj); // does not happen
scr_return(1); // no effect
end
The healing and radiation works, but the Jerky stays in my inventory. I'd like it to disappear once I've used it, like a drug/book, etc. The Cat's Paw #5 magazine disappears when used, which is why I tried sc_return, but it seems to have no effect. I've tried destroy_object(self_obj) too, but that just crashes the game.
Also, this only works in the mapper, when I run the game I get the default message when I try to use Jerky. Do I have to do something special in order to get the script working in-game?[/code]