My First Script Help

Zaius238

Art by Phoenix-Private
Hello guys, I've readed much tutorials, then finally i decided modify an script. (with help of F.S.E)

I want Klint to move the obelisk in a dialog option, then i opened "acklint.ssl" in F.S.E, and make this:

Code:
/*
	Copyright 1998-2003 Interplay Entertainment Corp.  All rights reserved.
*/

/*
        Name:
        Location:
        Description:

        Log:
           Please note any changes that have been made to the file in Updated. Then comment
           the code which you have changed/altered/commented out. Please, do not delete any
           code which was written.

           Created:

           Updated:
*/

/* Include Files */

/* Note, the Following Lines need to be in this order so that
   the script will be compilable. The define Name is referenced
   in a module from define.h and used in command.h. Please do
   not change the ordering.
        -rwh2   11/13/97
*/
#include "..\headers\define.h"
//#include "..\headers\<TownName>"

#define NAME                    SCRIPT_ACKLINT
#define TOWN_REP_VAR            (GVAR_TOWN_REP_ARROYO)

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


/* Standard Script Procedures */
procedure start;
procedure combat_p_proc;
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;

/* 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 Node001;
procedure Node002;
procedure Node003;
procedure Node004;
procedure Node005;
procedure Node006;
procedure Node007;
procedure Node008;
procedure Node009;
procedure Node009a;

//~~~~~~~~~~~~~~~~ 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_Looked_Before              (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;
variable Move_Obelisk := 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
   variable pole;

   Only_Once:=0;
   Move_Obelisk := 0;
   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_ARROYO);
   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_ARROYO_WARRIOR);

   if ((tile_contains_obj_pid(21303,0,PID_TEMPLE_SKULL_POLE)) and (global_var(GVAR_START_ARROYO_TRIAL) != 0)) then begin
       pole:=tile_contains_pid_obj(21303,0,PID_TEMPLE_SKULL_POLE);
       move_to(pole,19698,0);
   end
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) == 2) and (obj_can_see_obj(self_obj,dude_obj))) then begin
       set_local_var(LVAR_Hostile,1);
       attack(dude_obj);
   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 (source_obj == dude_obj) then begin
       set_local_var(LVAR_Personal_Enemy,1);
       set_global_var(GVAR_ENEMY_ARROYO,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
   variable pole;

   Evil_Critter:=0;
   Slavery_Tolerant:=SLAVE_TOLERANT;
   Karma_Perception:=KARMA_PERCEPTION1;

   CheckKarma;

   GetReaction;
   
   Move_Obelisk := 0;

   if ((obj_art_fid(dude_obj) == FID_HMWARR) or (obj_art_fid(dude_obj) == FID_HFPRIM)) then begin
       start_gdialog(NAME,self_obj,4,-1,-1);
       gSay_Start;
           call Node001;
       gSay_End;
       end_dialogue;
   end

   else begin
       start_gdialog(NAME,self_obj,4,-1,-1);
       gSay_Start;
           call Node006;
       gSay_End;
       end_dialogue;
   end

   if( Move_Obelisk == 1 ) then begin
      Move_Obelisk := 0;
      gfade_out( 600 );
      pole:=tile_contains_pid_obj(21303,0,PID_TEMPLE_SKULL_POLE);
      move_to(pole,19698,0);
      gfade_in( 600 );
   end
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

/* 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_Looked_Before) == 0) then begin
       set_local_var(LVAR_Looked_Before,1);
// *** Msg file reference: {100}{}{You see Klint, a fellow tribesman.} ***
       display_msg(mstr(100));
   end
   else
// *** Msg file reference: {101}{}{You see Klint.} ***
       display_msg(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;
// *** Msg file reference: {102}{}{You see a young man with bulging muscles and a very confident air about him.} ***
   display_msg(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,2);
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
end


// Not lines are allowed to be added below here
// The Following lines are from the Design Tool
//~~~~~~~~~~~~~~~~ DESIGN TOOL STARTS HERE

procedure Node001 begin
// *** Msg file reference: {103}{}{Good day to you, } ***
// *** Msg file reference: {104}{}{. You have not completed the trial of the Elder and may not pass.} ***
   Reply(mstr(103)+obj_name(dude_obj)+mstr(104));

// *** Msg file reference: {105}{}{Uh...} ***
   NLowOption(105,Node002);
// *** Msg file reference: {106}{}{I need to go back to the village.} ***
   NOption(106,Node003,004);
// *** Msg file reference: {107}{}{I have some questions for you.} ***
   NOption(107,Node004,004);
// *** Msg file reference: {108}{}{All right, I'm off to take the test.} ***
   NOption(108,Node999,004);
end

procedure Node002 begin
// *** Msg file reference: {109}{}{(sigh) } ***
// *** Msg file reference: {110}{}{. You go temple. You take test. You not come back here until take test. Obey Elder. Go!} ***
   Reply(mstr(109)+obj_name(dude_obj)+mstr(110));

// *** Msg file reference: {111}{}{Me go.} ***
   NLowOption(111,Node999);
end

procedure Node003 begin
// *** Msg file reference: {112}{}{Forgive me, } ***
// *** Msg file reference: {113}{}{, but I can not allow you to pass. If you wish to return to the village you may do so only by passing the trial set before you.} ***
   Reply(mstr(112)+obj_name(dude_obj)+mstr(113));

// *** Msg file reference: {114}{}{Move the obelisk or i kill you.} ***
   NOption(114,Node009,004);
// *** Msg file reference: {115}{}{Can I ask you some questions then?} ***
   NOption(115,Node004,004);
// *** Msg file reference: {116}{}{I could kick your ass and just walk out of here.} ***
   NOption(116,Node005,004);
end

procedure Node004 begin
// *** Msg file reference: {117}{}{Forgive me, but I have no answers to your questions. Take the trial set before you by the Elder and prove yourself worthy to lead our people.} ***
   Reply(117);

// *** Msg file reference: {118}{}{Very well.} ***
   NOption(118,Node999,004);
end

procedure Node005 begin
// *** Msg file reference: {119}{}{Two people working together can move the obelisk that blocks the path. Alone, you would fail. I have no intention of helping you until you pass the trial of the Elder.} ***
   Reply(119);

// *** Msg file reference: {120}{}{Uh-huh. I get the picture.} ***
   NOption(120,Node999,004);
end

procedure Node006 begin
// *** Msg file reference: {121}{}{Greetings, Chosen One! It is good to see you. How may I serve you?} ***
   Reply(121);

// *** Msg file reference: {122}{}{Me say hi. That all.} ***
   NLowOption(122,Node007);
// *** Msg file reference: {123}{}{Just thought I'd say hello. I'll be leaving on my quest soon.} ***
   NOption(123,Node007,004);
end

procedure Node007 begin
// *** Msg file reference: {124}{}{May the spirits of our ancestors protect you, Chosen One. I wish you well on your journey.} ***
   NMessage(124);
end

procedure Node008 begin
end

procedure Node009 begin
// *** Msg file reference: {125}{}{Ok, ok! But i need your help to move the obelisk.} ***
   Reply(125);

// *** Msg file reference: {126}{}{Ok, lets go...} ***
   NOption(126, Node009a, 004);
// *** Msg file reference: {127}{}{I changed of idea, i gona kill you!} ***
   BOption(127, Node998, 004);
end

procedure Node009a begin
// *** Msg file reference: {129}{}{You forced Klint to move the obelisk.} ***
   display_msg( mstr(129) );
   Move_Obelisk := 1;
end


//xxxxxxxxxxxxxxxxxxxx

And i compiled the script, but the problem are: when i start the game and chose the option "Move the obelisk or i kill you." the dialog ends and Klint make NOTHING! What is wrong? :scratch:
Pls someone tell me.
 
Back
Top