Help with scripting

are you sure, even with xp, because i just tried it with wordpad :D and the dialog box doesn't stay on top
 
the text highlited in red is added by me and should cure your problem


procedure goto3
begin
--op_gsay_reply(0, op_msg_string(320, 106));
--if (op_local_var(6) == 0) then
--begin
---op_giq_option(5, 320, op_msg_string(320, 107), @goto3a, 49);
---op_giq_option(4, 320, op_msg_string(320, 108), @goto11, 50);
---op_giq_option(4, 320, op_msg_string(320, 109), @goto10, 50);-end
--if (op_map_var(22) > 0) then
---op_giq_option(4, 320, op_msg_string(320, 146), @goto154, 50);
--op_giq_option(-3, 320, op_msg_string(320, 110), @goto4, 50);
--else begin
---if (op_map_var(9) > 0) then
----op_giq_option(4, 320, op_msg_string(320, 146), @goto48, 50);
---op_giq_option(-3, 320, op_msg_string(320, 110), @goto4, 50);
--end
end

you cannot just put "else" on a line on it's own..
it needs to either start a new block like above, or have another condition to it like: "else if (condition = true) then do_somehing"
or do something like: "else call map_update;"
 
Got it. Next question :P.

This has perhaps nothing to do with scripting but...

Is it the game engine which gives the power armor the +3 strength, radiation and poison bonus?

I know that the "code values" can be found in the proto files of the combat, power and armors, but if I for example want to give a armor a +5 bonus to strength, which file do I need to edit than? I've asked this question before (about one and a half year ago) but back than no one knew the file(s) which triggered the effects.
 
it's a hard coded perk.. powered armour.. that the engine uses...
so you'd have to hack the .exe to change the value...

you could always edit the dude_obj script so that when you wear the armour it increases your base strength by 2 and then reduces it by 2 when you remove it..
 
yup, but remember that set_critter_stat not rally sets stat but increases it.(it should be named inc_critter_stat) :)
 
Thanks guys, that did it. NEXT :P

procedure Elitebro00
begin
if (op_tile_distance_objs(op_self_obj(), op_dude_obj()) <= 12) then
op_float_msg(op_self_obj(), op_msg_string(962, 107), 0);
end

I want text-line 107 to be displayed by the critter when being 12 or less APs away from it. However yet it hasn't managed to spit it out. Anything else I need to add for getting this working?
 
Well it should be called in procedure_talk, although I've noticed even due the requirements that the critter will just say this float message IF the player is talking to it within 12 APs (so it doesn't do it by itself as it should).

I've checked some other scripts on how float messages like this work and they appearntly used them in "timed events".

Although, when I added a time event procedure event for my critter it didn't work either...

EDIT: Fixed, was supposed to add it in critter_proc
 
Description glitch:

I added a description procedure to the script:

If the player would successfully pass a PE check, he/she would get an more describing description about the critter and local var 4 would be set to 1.

By that happening the critter name would change from "High ranked Brotherhood guard" to "Ancient Brotherhood Guard".

Everything worked a usual good in beginning but when the "You see a Ancient Brotherhood Guard" text appeared, another text appeared directly after saying "You see: High ranked Brotherguard" which apparently is the text used in scrname.msg.

How do I remove this?

And...local vars...are vars only used for the specific script, right? The amount of local vars for each script is given in the Scripts.lst file of Fallout 1, although most of the time I can't agree with the amount being correct....

EDIT: Oh well, got the answers by myself again. I better try for lets say three hours myself before I post for help next time :P
 
About the armor thingie:

I added the +2 strength bonus but is also to add higher poison & radiation resistances?

If yes how would that be written in a Fallout 1 script?
 
to be honest, i'm not entirely sure you can add poison or rad resistance...
armour does it through the perks, drugs do it through the perks also...although you could add a perk i suppose..
 
the problem is that you can only asign one perk on an armor...and that perks are hard-coded
 
I remembered that MacRae (Boneyard) was supposed to higher your damage resistances. Although, it didn't work I thought it might do when it would come to poison and radiation resistances. I wrote a "function" similar to MacRae's and I was able to compile the script (obj_dude). Although, it didn't work either :(....
 
Does the destroy_object function also work for critters? I've tried using it for making Ian disappear after ending a certain dialog. All that happens it that the game freezes....

Although, I did some testing afterwards and managed to let Ian being "destroyed" when using a tool on him. Than it worked (he disappeared) although just IF hadn't talked to him before...
 
Hey, What is wrong in this script? What I wan´t is that after the "max job local var" is 8, the critter would wield his weapon, do the reload animation, then walk to destination tile and do the shoot animation.

#####################################

/* Include Files */
#include "..\headers\define.h"

#define NAME SCRIPT_DCREMAX

#include "..\headers\command.h"


/* Standard Script Procedures */
procedure start;
procedure timed_event_p_proc;
procedure critter_p_proc;
procedure use_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
procedure use_skill_on_p_proc;
procedure use_obj_on_p_proc;
procedure damage_p_proc;
procedure map_enter_p_proc;
procedure map_update_p_proc;
procedure talk_p_proc;

/*****************************************************************
Local Variables which are saved. All Local Variables need to be
prepended by LVAR_
*****************************************************************/

#define LVAR_Herebefore (4)
//#define LVAR_Hostile (5)
//#define LVAR_Personal_Enemy (6)
#define LVAR_Home_Tile (1)
#define LVAR_maxjob_accepted (7)

/*******************************************************************
Imported variables from the Map scripts. These should only be
pointers and variables that need not be saved. If a variable
Needs to be saved, make it a map variable (MVAR_)
*******************************************************************/

/*******************************************************************
Local variables which do not need to be saved between map changes.
*******************************************************************/


/*******************************************************************
******* PROCEDURES *******
*******************************************************************/
procedure Node001;
procedure Node002a;
procedure Node002b;
procedure Node002c;
procedure Node003;
procedure Node004a;
procedure Node004b;
procedure Node004c;
procedure Node005;
procedure Node006a;
procedure Node006b;
procedure Node006c;
procedure Walktofight;
procedure Node998;
procedure Node999;


variable maxweapon;

/*******************************************************************
The start procedure is the first procedure called when the map is
first entered. Any initial information that needs to be set up
should be placed in here.
*******************************************************************/

procedure start begin
end

procedure timed_event_p_proc begin
end

/********************************************************************
********************************************************************/

procedure use_p_proc begin
end

/***************************************************************************
This is cursory glance description that the player will receive should
he just pass the Action Cursor over. Examines which give more information
need to be in the description_p_proc procedure.
***************************************************************************/

procedure look_at_p_proc begin
script_overrides;
if (local_var(LVAR_Herebefore) == 0) then
display_msg(mstr(100));
else
display_msg(mstr(101));
end


procedure description_p_proc begin
script_overrides;
display_msg(mstr(102));
end



procedure use_skill_on_p_proc begin
end


procedure use_obj_on_p_proc begin
end


/******************************************************************************************
IF it gets damaged
******************************************************************************************/

procedure damage_p_proc begin
end

/***************************************************************************************
Whenever the map is first entered, this procedure will be called.
***************************************************************************************/

procedure map_enter_p_proc begin
//if (map_first_run) then begin
//set_local_var(LVAR_Home_Tile, self_tile);
//end
end


/**************************************************************************************
This procedure gets called roughly every 30 seconds of real time.
**************************************************************************************/

procedure map_update_p_proc begin
end

/**************************************************************************************
This is used for any dialogue that may need to occur with the player.
**************************************************************************************/

procedure talk_p_proc begin
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_start;
call Node001;
gSay_end;
end_dialogue;
end

procedure Node001 begin
Reply(200);
GOption(201,Node002a,004);
BOption(202,Node002b,004);
NOption(203,Node999,004);
BOption(204,Node003,004);
end

procedure Node002a begin
Reply(400);
GOption(401,Node999,004);
end

procedure Node002b begin
Reply(300);
BOption(301,Node002c,004);
NOption(302,Node999,004);
end

procedure Node002c begin
Reply(303);
BOption(304,Node998,004);
end

procedure Node003 begin
Reply(500);
NOption(501,Node004a,004);
BOption(502,Node002c,004);
end

procedure Node004a begin
Reply(503);
NOption(504,Node004b,004);
end

procedure Node004b begin
Reply(505);
GOption(506,Node005,004);
NOption(507,Node004c,004);
BOption(508,Node002c,004);
end

procedure Node004c begin
Reply(509);
NOption(510,Node004b,004);
end

procedure Node005 begin
Reply(511);
GOption(512,Node006a,004);
NOption(513,Node006b,004);
NOption(514,Node006c,004);
end

procedure Node006a begin
set_local_var(LVAR_maxjob_accepted, 8);
Reply(515);
NOption(516,Node999,004);
end

procedure Node006b begin
Reply(519);
NOption(520,Node999,004);
end

procedure Node006c begin
Reply(517);
NOption(518,Node999,004);
end

procedure Node998 begin
end

procedure Node999 begin
end

procedure Walktofight begin

maxweapon := create_object(PID_COMBAT_SHOTGUN,0,0);
add_obj_to_inven(self_obj, maxweapon);
wield_obj_critter(self_obj, maxweapon);

if( ( anim_busy( self_obj ) == false )) then begin
reg_anim_clear(self_obj);
reg_anim_begin();
reg_anim_animate( self_obj,ANIM_magic_hands_middle,-1 );
animate_move_to_tile(14884);
reg_anim_animate(self_obj, ANIM_fire_burst, -1);
reg_anim_end();
float_msg(self_obj, mstr(521), FLOAT_MSG_GREEN);
set_local_var(LVAR_maxjob_accepted, 7);
end
end

procedure critter_p_proc
begin
if (local_var(LVAR_maxjob_accepted) == 8) then begin
call Walktofight;
end
end

#######################
 
change: critter_p_proc to:

Code:
procedure critter_p_proc 
begin 
if ( local_var(LVAR_maxjob_accepted) == 8  ) then 
begin 
set_local_var(LVAR_maxjob_accepted,9 );
call Walktofight; 
end 
end
 
you don't say what it is or is not doing.. , only what it SHOULD do..

@jargo.. he already re-sets the LVAR_maxjob_accepted to 7 in the Walktofight proceedure..

Code:
animate_move_to_tile (14884);

sould be..

Code:
animate_move_obj_to_tile(self_obj, 14884, ANIMATE_WALK);

or

Code:
reg_animate_move_obl_to_tile(self_obj, 14884,-1);
 
ups, missed that line.
I think this may be the problem:

Code:
if( ( anim_busy( self_obj ) == false )) then begin
Remove this and if then script work ok then use timed_event.
 
I forgot to say that after the maxjob_accepted var is set, the critter doesn´t perform any of those animations, he´s just standing still.


Ok, Jargo. I´ll try removing that "if( ( anim_busy( self_obj ) == false )) then begin" thing and see if that works.
 
ok this will do what you want:
Code:
/* Include Files */
#include "..\headers\define.h"

#define NAME SCRIPT_DCREMAX

#include "..\headers\command.h"


/* Standard Script Procedures */
procedure start;
procedure timed_event_p_proc;
procedure critter_p_proc;
procedure use_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
procedure use_skill_on_p_proc;
procedure use_obj_on_p_proc;
procedure damage_p_proc;
procedure map_enter_p_proc;
procedure map_update_p_proc;
procedure talk_p_proc;

/*****************************************************************
Local Variables which are saved. All Local Variables need to be
prepended by LVAR_
*****************************************************************/

#define LVAR_Herebefore (4)
//#define LVAR_Hostile (5)
//#define LVAR_Personal_Enemy (6)
#define LVAR_Home_Tile (1)
#define LVAR_maxjob_accepted (7)

/*******************************************************************
Imported variables from the Map scripts. These should only be
pointers and variables that need not be saved. If a variable
Needs to be saved, make it a map variable (MVAR_)
*******************************************************************/

/*******************************************************************
Local variables which do not need to be saved between map changes.
*******************************************************************/


/*******************************************************************
******* PROCEDURES *******
*******************************************************************/
procedure Node001;
procedure Node002a;
procedure Node002b;
procedure Node002c;
procedure Node003;
procedure Node004a;
procedure Node004b;
procedure Node004c;
procedure Node005;
procedure Node006a;
procedure Node006b;
procedure Node006c;
procedure Walktofight;
procedure Node998;
procedure Node999;


variable maxweapon;

/*******************************************************************
The start procedure is the first procedure called when the map is
first entered. Any initial information that needs to be set up
should be placed in here.
*******************************************************************/

procedure start 
begin
end

procedure timed_event_p_proc
begin

   if (fixed_param == 10) then  //Magic hand anim
      begin
         reg_anim_clear(self_obj);
         reg_anim_begin();
         reg_anim_animate(self_obj,ANIM_magic_hands_middle,-1 );
         reg_anim_end();
         add_timer_event(Self_obj,30,20); // call after 3 seconds
       end
       
   if (fixed_param == 20) then
      begin
         reg_anim_clear(self_obj);
         reg_anim_begin();
         animate_move_to_tile(14884);
         reg_anim_end();
         add_timer_event(Self_obj,50,30); // call after 5 seconds (walk time)
       end
       
   if (fixed_param == 30) then
      begin
         reg_anim_clear(self_obj);
         reg_anim_begin();
         reg_anim_animate(self_obj, ANIM_fire_burst, -1);
         reg_anim_end();
       end
       

end

/********************************************************************
********************************************************************/

procedure use_p_proc 
begin
end

/***************************************************************************
This is cursory glance description that the player will receive should
he just pass the Action Cursor over. Examines which give more information
need to be in the description_p_proc procedure.
***************************************************************************/

procedure look_at_p_proc 
begin
   script_overrides;
   if (local_var(LVAR_Herebefore) == 0) then
      display_msg(mstr(100));
   else
      display_msg(mstr(101));
end


procedure description_p_proc 
begin
   script_overrides;
   display_msg(mstr(102));
end



procedure use_skill_on_p_proc 
begin
end


procedure use_obj_on_p_proc 
begin
end


/******************************************************************************************
IF it gets damaged
******************************************************************************************/

procedure damage_p_proc 
begin
end

/***************************************************************************************
Whenever the map is first entered, this procedure will be called.
***************************************************************************************/

procedure map_enter_p_proc 
begin
//if (map_first_run) then 
//set_local_var(LVAR_Home_Tile, self_tile);
//end
end
   
   
/**************************************************************************************
This procedure gets called roughly every 30 seconds of real time.
   **************************************************************************************/
   
procedure map_update_p_proc
begin
end
   
/**************************************************************************************
This is used for any dialogue that may need to occur with the player.
   **************************************************************************************/
   
procedure talk_p_proc
begin
      start_gdialog(NAME,self_obj,4,-1,-1);
      gSay_start;
      call Node001;
      gSay_end;
      end_dialogue;
end
   
procedure Node001
begin
      Reply(200);
      GOption(201,Node002a,004);
      BOption(202,Node002b,004);
      NOption(203,Node999,004);
      BOption(204,Node003,004);
end
   
procedure Node002a
begin
      Reply(400);
      GOption(401,Node999,004);
end
   
procedure Node002b
begin
      Reply(300);
      BOption(301,Node002c,004);
      NOption(302,Node999,004);
end
   
procedure Node002c
begin
      Reply(303);
      BOption(304,Node998,004);
end
   
procedure Node003
begin
      Reply(500);
      NOption(501,Node004a,004);
      BOption(502,Node002c,004);
end
   
procedure Node004a
begin
      Reply(503);
      NOption(504,Node004b,004);
end
   
procedure Node004b
begin
      Reply(505);
      GOption(506,Node005,004);
      NOption(507,Node004c,004);
      BOption(508,Node002c,004);
end
   
procedure Node004c
begin
      Reply(509);
      NOption(510,Node004b,004);
end
   
procedure Node005
begin
      Reply(511);
      GOption(512,Node006a,004);
      NOption(513,Node006b,004);
      NOption(514,Node006c,004);
end
   
procedure Node006a
begin
      set_local_var(LVAR_maxjob_accepted,8) ;
      Reply(515);
      NOption(516,Node999,004);
end
   
procedure Node006b
begin
      Reply(519);
      NOption(520,Node999,004);
end
   
procedure Node006c
begin
      Reply(517);
      NOption(518,Node999,004);
end
   
procedure Node998
begin
end
   
procedure Node999
begin
end
   
procedure Walktofight
begin
      maxweapon := create_object(PID_COMBAT_SHOTGUN,0,0);
      add_obj_to_inven(self_obj, maxweapon);
      wield_obj_critter(self_obj, maxweapon);
      add_timer_event(Self_obj,30,10); // call timed_event_p_proc after 3 seconds
end
   
procedure critter_p_proc
begin
   if (local_var(LVAR_maxjob_accepted) ==8)  then
      begin
         set_local_var(LVAR_maxjob_accepted, 7);
         call Walktofight;
      end
end

1) moved set_local_var(LVAR_maxjob_accepted, 7); to critter_p_proc.
2) used timed_event_p_proc.
and
 
Back
Top