Can i get some help with this script?

Does someone know how it's done that party members do skill-actions for the player? Like, trying to repair something with Vic in the party will result in Vic trying to repair it.

I am searching the scripts for that stuff since a while now, but I can't find what defines this.
 
Lexx said:
Does someone know how it's done that party members do skill-actions for the player? Like, trying to repair something with Vic in the party will result in Vic trying to repair it.

I am searching the scripts for that stuff since a while now, but I can't find what defines this.
It's handled automatically by the engine. All you have to do is set the NPCs main skill to what you want them to help out with.
The main skill is the same as the critters highest skill so they can only help you with one each (and their skill needs to be higher than your own of course).
If more than one skill is the highest it will set the first one from top to bottom as the main skill.
Also I think only critters that have the "magic hands" animation will work, if they don't they will say they will help but not do anything anyway.
 
Ah, thanks. It works. Is there any way to replace the text and use custom ones? I would like to change text color and textstring, etc.
 
Here again so I've made a script in sll ok but how can I make it in the game I tried FSE registered the script but it only shows up in the script.lst and scrname.msg I get no int files, I remember there was that totally manual way I have read about using the compile.exe in the mapper with watcom but I thought FSE could compile the script... the question is how? Thanks in advance
 
You have to register the script and then compile it to get the *.int file. Then open up the mapper and add the script to the object you want to. I. e. scenery or critter, etc.
 
Lexx said:
Ah, thanks. It works. Is there any way to replace the text and use custom ones? I would like to change text color and textstring, etc.
Uhm, I don't think so. I mean you can always edit the six lines in SKILL.MSG that is for skill usage, but they are random and can't be used individually, all helping NPCs will use those same lines.

If you want it better than that and to use a different text color I'm afraid you need to go to Timeslip.
Well, that's what I think anyway. I didn't look into it very much before, so I may have missed something. :shrug:
 
Back again sorry for bugging everyone with questions... so I registered the script successfully clicked on compile and got this it says compiling is done but I can't find the file that have been created
 
If FSE doesn't tell you that it was a success, then there is some error in the script and it didn't compiled.

Use Timeslips script editor, it shows you some real debugging output and you can fix stuff easier and faster.
 
It worked! (Guess from now on I'm going to use Timeslips script editor)
I now only have one minor thing that when the player choose a dialog option then the critter attacks him/her but I guess I can solve this now. Thanks again Lexx and also for Timeslips for making the editor!
 
Though I said I can solve that the char attacks the player if he says some stuff in the dialog, this part of the script was already in the ssl it made the critter attack on sight so I tried to alter it (I even cropped it out once and putted to procedure Node998 begin which made the dialog freeze...
Code:
/* If the critter is mad at the player for any reason, it will attack and remember to attack
   the player should the game be saved and loaded repeatedly. Additionally, if any special
   actions need to be taken by the critter based on previous combat, the critter will remember
   this as well. */
   if ((local_var(LVAR_Hostile) != 0) and (obj_can_see_obj(self_obj,dude_obj))) then begin
       set_local_var(LVAR_Hostile,1);
       self_attack_dude;
       //Macro made by Tom to keep the critter fleeing.
   end
end
Its really fustrating since I tried to look up other ssl files like ACFIST
I rewritten the above one script part to this
Code:
if ((local_var(LVAR_Hostile) == 2) and (obj_can_see_obj(self_obj,dude_obj))) then begin
       set_local_var(LVAR_Hostile,1);
       attack(dude_obj);
   end
procedure Node998 was the same there so I left that unchanged but still it wouldn't work as needed.
I checked some New Reno script since there were a plenty of chars that attacked if you said something they didn't like but still can't solve it.
Aw in the begining this scripting doesn't looked this hard
 
I don't really understand your problem. If you point a dialog option to Node998, the dialog will always end and start combat. You don't even have to put something in Node998, the empty node is enough.
 
Well I have a plenty of node998 option but if I left the above one script part unchanged the critter attacks me as soon as I go near if I change it then I can get into the dialog but selecting a node998 option just ends the dialog.
I copy pasted here the whole script to save some place I removed the upper notes and some line breaks.
[spoiler:0941e5a8e1]
Code:
//Overrides the pickup p proc.
//#define NPC_REACTION_TYPE       REACTION_TC /* REACTION_TC REACTION_TG REACTION_C REACTION_G */
#define NPC_REACTION_VAR        7 /* same as thief variable */
#include "H:\Fallout moding\Fallout 2 Mapper\scripts\HEADERS\define.h"
//#include "H:\Fallout moding\Fallout 2 Mapper\scripts\HEADERS\<TownName>"
#define NAME                    SCRIPT_LINDA
// NOTE: This is set to 0 by default
#define TOWN_REP_VAR            (0)
#include "H:\Fallout moding\Fallout 2 Mapper\scripts\HEADERS\command.h"
#include "H:\Fallout moding\Fallout 2 Mapper\scripts\HEADERS\ModReact.h"
/* Helper macros */
variable temp;
/* Standard Script Procedures */
procedure start;
procedure critter_p_proc;
procedure pickup_p_proc;
procedure talk_p_proc;
procedure destroy_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
procedure use_skill_on_p_proc;
procedure damage_p_proc;
procedure map_enter_p_proc;
procedure timed_event_p_proc;
/* Script Specific Procedure Calls */
procedure Node998;                                      // This Node is Always Combat
procedure Node999;                                      // This Node is Always Ending
// The next lines are added in by the Designer Tool.
// Do NOT add in any lines here.
//~~~~~~~~~~~~~~~~ DESIGNER TOOL STARTS HERE
procedure Floater001;
procedure Floater002;
procedure Node001;
procedure Node002;
procedure Node003;
procedure Node004;
procedure Node005;
procedure Node006;
procedure Node007;
procedure Node008;
procedure Node009;
procedure Node010;
procedure Node011;
procedure Node012;
procedure Node013;
procedure Node014;
procedure Node015;
procedure Node016;
procedure Node017;
procedure Node018;
procedure Node019;
procedure Node020;
//~~~~~~~~~~~~~~~~ DESIGN TOOL ENDS HERE
// The Following lines are for anything that is not needed to be
// seen by the design Tool
/* 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_Caught_Thief               (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. */
variable Only_Once:=0;
procedure start begin
end
/* This procedure will get called each time that the map is first entered. It will
   set up the Team number and AI packet for this critter. This will override the
   default from the prototype, and needs to be set in scripts. */
procedure map_enter_p_proc begin
   Only_Once:=0;
//   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_);
//   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_);
end
/* Every heartbeat that the critter gets, this procedure will be called. Anything from
   Movement to attacking the player on sight can be placed in here.*/
procedure critter_p_proc begin
/* If the critter is mad at the player for any reason, it will attack and remember to attack
   the player should the game be saved and loaded repeatedly. Additionally, if any special
   actions need to be taken by the critter based on previous combat, the critter will remember
   this as well. */
   if ((local_var(LVAR_Hostile) != 0) and (obj_can_see_obj(self_obj,dude_obj))) then begin
       set_local_var(LVAR_Hostile,1);
       self_attack_dude;
       //Macro made by Tom to keep the critter fleeing.
   end
end
/* Whenever the critter takes damage of any type, this procedure will be called. Things
like setting ENEMY_ and LVAR_Personal_Enemy can be set here. */
procedure damage_p_proc begin
/* If the player causes damage to this critter, then he will instantly consider the player
his personal enemy. In Critter_Proc or through dialog, actions will be taken against
   the player for his evil acts. */
   if (obj_in_party(source_obj)) then begin
       set_local_var(LVAR_Personal_Enemy,1);
   end
end
/* Any time that the player is caught stealing from this critter, Pickup_proc will be called.
   In here, various things can happen. The most common response is instant hostility which
   will be remembered. */
procedure pickup_p_proc begin
   if (source_obj == dude_obj) then begin
       set_local_var(LVAR_Hostile,2);
   end
end
/* The dialog system is setup and prepares the player to talk to this NPC. Where To Go
   written by designers are placed in here. Additionally, Reactions are generated and
   stored which affects player interactions. */
procedure talk_p_proc begin
   Evil_Critter:=0;
   Slavery_Tolerant:=SLAVE_TOLERANT;
   Karma_Perception:=KARMA_PERCEPTION1;
   CheckKarma;
   GetReaction;
       start_gdialog(NAME,self_obj,4,-1,-1);
       gSay_Start;
       call Node001;
       gSay_End;
       end_dialogue;
end
procedure timed_event_p_proc begin
end
/* This procedure gets called only on the death of this NPC. Special things like
   incrementing the death count for reputation purposes and Enemy Counters are placed
   in here. */
procedure destroy_p_proc begin
/* Increment the aligned critter counter*/
   inc_good_critter
/* inc_evil_critter */
/* inc_neutral_critter */
/* Set global_variable for Enemy status*/
end
/* Look_at_p_proc gets called any time that the player passes the cursor over any object.
   This should only hold the most cursory of glances for the player. */
procedure look_at_p_proc begin
   script_overrides;
   if (local_var(LVAR_Herebefore) == 0) then
      display_mstr(100);
   else
      display_mstr(101);
end
/* The player will see more indepth descriptions from this procedure. They are actively
   looking at the critter and want more information. Things like names can be added here
   if the critter is known to the player. */
procedure description_p_proc begin
   script_overrides;
   display_mstr(102);
end
/* Any time a skill is used on a critter this call is made. This can be to give examinations
   for things like Doctor skill or messages for various other skills. */
procedure use_skill_on_p_proc begin
end
/* Should the Player ever cause the NPC too much discomfort that he desires to attack the player,
   this call will be made. Essentially, it stores the Hostile vaule so that the critter remembers
   he was once hostile towards the player.*/
procedure Node998 begin
   set_local_var(LVAR_Hostile,1);
end
/* Anytime that there is a need for an ending to dialog, this node is to be called. It will just
   exit from the dialog system without any reprisals from the NPC. */
procedure Node999 begin
debug_msg("LVAR_Herebefore == "+local_var(LVAR_Herebefore));
if (local_var(LVAR_Herebefore)==0) then
begin
set_local_var(LVAR_Herebefore,1);
end
end
// Skill checks and miscellaneous procedures
// Not lines are allowed to be added below here
// The Following lines are from the Design Tool
//~~~~~~~~~~~~~~~~ DESIGN TOOL STARTS HERE
// Node Floater001
//
// Notes:
//
// Base floating masseges
procedure Floater001
begin
floater_rand(200,207);
end
// Node Floater002
//
// Notes:
//
// About the vault dwellers
procedure Floater002
begin
floater_rand(210,215);
end
procedure Node001
begin
Reply(220);
NOption(221,Node002,-3);
NOption(222,Node005,4);
NOption(223,Node999,4);
end
procedure Node002
begin
Reply(230);
NOption(231,Node003,-3);
BOption(232,Node998,-3);
NOption(233,Node999,-3);
end
procedure Node003
begin
Reply(240);
NOption(241,Node999,4);
BOption(242,Node004,-3);
NOption(243,Node999,4);
end
procedure Node004
begin
Reply(250);
BOption(251,Node998,-3);
NOption(252,Node999,4);
end
procedure Node005
begin
Reply(260);
if (dude_is_female) then 
NOption(261,Node006,4);
if (dude_is_male) then 
NOption(262,Node008,4);
NOption(263,Node016,4);
NOption(264,Node999,4);
end
procedure Node006
begin
Reply(270);
NOption(271,Node007,4);
NOption(272,Node999,4);
end
procedure Node007
begin
Reply(280);
if (has_skill(dude_obj,SKILL_CONVERSANT)>=80) then 
NOption(281,Node017,4);
NOption(282,Node999,4);
end
procedure Node008
begin
Reply(290);
NOption(291,Node009,4);
NOption(292,Node015,4);
end
procedure Node009
begin
Reply(300);
NOption(301,Node010,4);
NOption(302,Node011,4);
NOption(303,Node999,4);
end
procedure Node010
begin
Reply(310);
NOption(311,Node011,4);
BOption(312,Node012,4);
GOption(313,Node013,4);
NOption(314,Node999,4);
end
procedure Node011
begin
Reply(320);
BOption(321,Node998,4);
NOption(322,Node999,4);
end
procedure Node012
begin
Reply(330);
NOption(331,Node998,4);
NOption(322,Node999,4);
end
procedure Node013
begin
Reply(340);
NOption(341,Node014,4);
NOption(314,Node999,4);
end
procedure Node014
begin
Reply(350);
BOption(351,Node998,4);
NOption(322,Node999,4);
end
procedure Node015
begin
Reply(360);
NOption(361,Node013,4);
BOption(362,Node998,4);
NOption(363,Node999,4);
end
procedure Node016
begin
Reply(370);
NOption(371,Node011,4);
NOption(372,Node999,4);
end
procedure Node017
begin
Reply(380);
if (get_critter_stat(dude_obj,STAT_ch)>=5) then 
GOption(381,Node018,4);
NOption(382,Node020,4);
BOption(383,Node019,4);
NOption(384,Node999,4);
end
procedure Node018
begin
Reply(390);
NOption(391,Node999,4);
end
procedure Node019
begin
Reply(400);
NOption(401,Node998,4);
NOption(402,Node999,4);
end
procedure Node020
begin
Reply(410);
NOption(411,Node999,4);
end
//xxxxxxxxxxxxxxxxxxxx
[/spoiler:0941e5a8e1]
as I said I changed this line
if ((local_var(LVAR_Hostile) != 0) and (obj_can_see_obj....
to this otherwise I always get attacked
if ((local_var(LVAR_Hostile) == 2) and (obj_can_see_obj....
I will be trying things for a while but if I can't succeed I will restart from sketch.....
 
Of course, if you say "LVAR_Hostile to != 0 and obj_can_see"... he will attack you, because he will only *not* attack you, if LVAR_Hostile is everything except 0.

I see that you added set_local_var(LVAR_Hostile,1); already in Node998, this would be another thing you could have tried.
 
I take back what I said I'm having problem with the same thing again the strange and irritating thing is that the Node998 call start the combat if I copy my script to the original scripts but when the critter miss the game shows the original name of the critter.
Here I made a Linda.ssl file which can get compiled either at FSE or sfall script editor but call Node998 doesn't initiate combat
to save space I deleted the comments
Code:
#include "..\headers\define.h"
//#include "..\headers\<TownName>"

#define NAME                    SCRIPT_Linda
#define TOWN_REP_VAR            (0)

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

procedure start;

procedure critter_p_proc;
procedure pickup_p_proc;
procedure talk_p_proc;
procedure destroy_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
procedure use_skill_on_p_proc;
procedure damage_p_proc;
procedure map_enter_p_proc;

procedure Node998;                                      // This Node is Always Combat
procedure Node999;                                      // This Node is Always Ending


procedure Node001;


#define LVAR_Herebefore                 (4)
#define LVAR_Hostile                    (5)
#define LVAR_Personal_Enemy             (6)
#define LVAR_Looked_Before              (7)

variable Only_Once:=0;

procedure start begin

end

procedure map_enter_p_proc begin
   Only_Once:=0;
end

procedure critter_p_proc begin

   if ((local_var(LVAR_Hostile) == 2) and (obj_can_see_obj(self_obj,dude_obj))) then begin
       set_local_var(LVAR_Hostile,1);
       attack(dude_obj);
   end
end

procedure damage_p_proc begin

   if (source_obj == dude_obj) then begin
       set_local_var(LVAR_Personal_Enemy,1);
   end
end

procedure pickup_p_proc begin
   if (source_obj == dude_obj) then begin
       set_local_var(LVAR_Hostile,2);
   end
end

procedure talk_p_proc begin
   Evil_Critter:=0;
   Slavery_Tolerant:=SLAVE_TOLERANT;
   Karma_Perception:=KARMA_PERCEPTION1;
   CheckKarma;
   GetReaction;
       start_gdialog(NAME,self_obj,4,-1,-1);
       gSay_Start;
           call Node001;
       gSay_End;
       end_dialogue;
end

procedure destroy_p_proc begin
   inc_good_critter
end

procedure look_at_p_proc begin
   script_overrides;
   if (local_var(LVAR_Looked_Before) == 0) then begin
       set_local_var(LVAR_Looked_Before,1);
       display_msg(mstr(100));
   end
   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 Node998 begin
   set_local_var(LVAR_Hostile,2);
end
procedure Node999 begin
end

procedure Node001
begin
Reply(220);
NOption(221,Node998,-3);
NOption(222,Node998,4);
NOption(223,Node999,4);
end
When I changed the script name to
SCRIPT_ACKLINT and compiled it as ACKLINT.int it was working but when the critter attacked me and missed the console had this "Klint missed"

the msg has these lines
Code:
{100}{}{You see Linda.}
{101}{}{You see Linda.}
{102}{}{You see a woman busily typing and chacking different datas on the computers.}

# Node001
{220}{}{What do you want I'm busy.}
{221}{}{me killl }
{222}{}{Just die ok? }
{223}{}{Wrong place I'm leaving }

I've edited the city and maps text files and added three other script a door and two map scripts they work ok I added an Initial_Inven procedure to the map wanted to test if it would be possible to give the default players some stuff thing go ok
Code:
procedure Initial_Inven begin
variable item;
if(obj_name(dude_obj)=="Narg") then
   item:=create_object(PID_KNIFE,0,0);
   add_mult_objs_to_inven(dude_obj,item,1);
if(obj_name(dude_obj)=="Mingan") then
   item:=create_object(PID_BEER,0,0);
   add_mult_objs_to_inven(dude_obj,item,1);
if(obj_name(dude_obj)=="Chista") then
   item:=create_object(PID_COSMETIC_CASE,0,0);
   add_mult_objs_to_inven(dude_obj,item,1);
if(obj_name(dude_obj))then
   item:=create_object(PID_WATER_FLASK,0,0);
   add_mult_objs_to_inven(dude_obj,item,1);
end
but if I happen to write
Code:
if(obj_name(dude_obj)=="Narg") then
   item:=create_object(PID_KNIFE,0,0);
   add_mult_objs_to_inven(dude_obj,item,1);
   item:=create_object(PID_BEER,0,0);
   add_mult_objs_to_inven(dude_obj,item,1);
then the beer is given to all characters what could be the problem here

Also I have to manually add the script name lines to the script.h files
(don't know if it should be like this since the sfall script editor needed to know where that file is in the setting)
 
Hijacking this thread again.


I am creating a critter via script and place it on the map:
Code:
NewCritter:=create_object_sid(PID_CRITTER,0,0,SCRIPT_SOMETHING);
      
critter_attempt_placement(NewCritter,Pos1,0);

This will create the critter with the PID_CRITTER at hex Pos1 on elevation 0. So far so good. My problem now is that the critter is - obviously - always looking into direction 0. Does someone know how I can define a different direction without having to write batzillions of lines of new code?
 
Now I know nothing about scripting, but isn't the direction of the critter measured like this -

0 - NE
1 - E
2 - SE
3 - SW
4 - W
5 - NW

...that's how the mapper does it anyway.
 
Not realy too hard :

Code:
#define ANIMATE_ROTATION (1000)

needed_rotation := 2;
anim(NewCritter, ANIMATE_ROTATION, needed_rotation);
 
.Pixote. said:
Now I know nothing about scripting, but isn't the direction of the critter measured like this -

Yes, but that doesn't help me with the script. :P


Thanks Rain man, this worked. One problem less, heh.
 
There's an easier, one-line macro for changing rotation. It only works on self_obj though:

Code:
animate_rotation(2);

(just type the desired rotation in the brackets)

for dude_obj, you'll have to use this:

Code:
anim(dude_obj,ANIMATE_ROTATION,2);

I think the only requirement to use these is to include the COMMAND.H file in the script.
 
Back
Top