Is this scripts right?

Discuss the creation and scripting of new fan-made games and mods for the Fallout series of games.
Post Reply
User avatar
burgermeister01
SDF!
SDF!
Posts: 20
Joined: Wed Apr 23, 2003 10:46 pm
Location: Rockford, IL

Is this scripts right?

Post by burgermeister01 »

Okay, I'm taking my first real stab at trying to make my own script, but aside from the fact that I still don't know how to acutally use stuff that I make, I'm really not sure if these codes will work. Soooo......I was hoping that someone having experience could help me out, and tell me if I got all of this right. Basically this is the script for a really really stupid (Torr stupid) guard in some slavers' basement.

Her is the map script so far:

#ifndef SLAVERS_H
#define SLAVERS_H

// Map vars for Slavers House

// Comments

//MAP_GLOBAL_VARS:

//GLOBAL NUMBER

// All Map Vars need to start w/ MVAR_

#define MVAR_Slavers_hostile (0)


#endif // SLAVERS_H




Okay, next here is the .msg file for this guy:

{100}{}{You see a slaver.}
{101}{}{You see Jerkey, the slaver.}
{102}{}{You see a man holding a club, and rambling with the other man next to him. You think he's a slaver, and he doesn't look to bright.}

{200}{}{Ugg...}
{201}{}{Unng? Narlf.}
{202}{}{flarg.}
{203}{}{G'nung}

{300}{}{Ugg...}
{301}{}{What?}
{302}{}{I agree.}
{303}{}{Uh, yea. Nevermind.}

{400}{}{Unga}
{401}{}{Hrng. Mrff.}
{402}{}{Sharlf.}
{403}{}{Twart.}

{500}{}{Ooka!}
{501}{}{*Sigh* Maybe your friend will be more helpful...}



{600}{}{Krej.}
{601}{}{*Sigh* Maybe your friend will be more helpful...}


And finally here is the actual script file:



/*
Name: Jerkey the Slaver
Location: Slaver Basement
Description:

*/

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

#define NAME SCRIPT_SCJERKEY
#define TOWN_REP_VAR GVAR_TOWN_REP_SLAVERS

#include "..\headers\command.h"
#include "..\headers\ModReact.h"
/*#include "..\headers\DenRes1.h"(not sure what to replace this with, since I'm using another script as a pallete.*/

/* Standard Script Procedures */
procedure start;
procedure critter_p_proc;
/*procedure pickup_p_proc;(what is this one for?All the other functions are pretty intuitive*/
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;


// dialog nodes
procedure Node000;
procedure Node001;
procedure Node002;
procedure Node003;
procedure Node004;
procedure Node005;
procedure Node006;


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



//import variable jerkey_obj;

procedure start begin
end


procedure map_enter_p_proc begin
if (is_loading_game == false) then begin
if (map_first_run) then begin
critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_TEAM_NUM, TEAM_SLAVERS);
critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_AI_PACKET, AI_SLAVER;
end
end
jerkey_obj := self_obj;
end

procedure critter_p_proc begin
if (self_can_see_dude) then begin
if ((hostile) or (slavers_hostile)) then begin
self_attack_dude;
end
end
end

procedure damage_p_proc begin
if (source_obj == dude_obj) then begin
call Node998;
set_slavers_hostile:=1;
end
end

procedure pickup_p_proc begin
/*if (source_obj == dude_obj) then begin
call Node998;
end*/
end

procedure talk_p_proc begin
check_forced_dialog
else begin
GetReaction;
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
if(dude_is_stupid==true)
call Node002;
end else call Node 003;
end
gSay_End;
end_dialogue;
script_overrides;
end
end

procedure destroy_p_proc begin
jerkey_obj := 0;
set_jerkey_dead;
end

procedure look_at_p_proc begin
script_overrides;
display_mstr(100)
end

procedure description_p_proc begin
script_overrides;
display_mstr(102);
end

procedure use_skill_on_p_proc begin
end

procedure Node999 begin
// to exit dialogs
end
procedure Node998 begin
// sets up combat
set_slavers_hostile;
set_hostile;
end

procedure Node002 begin
Reply(200);
begin
NOption(201,Node004,001);
NOption(202,Node004,001);
NOption(203,Node004,001);
end

procedure Node003 begin
Reply(300);
NOption(301,Node005,004);
NOption(302,Node006,004);
NOption(303,Node999,004);
end
procedure Node004 begin
Reply(400);
NOption(401, Node999, 001);
NOption(402, Node999, 001);
NOption(403, Node999, 001);
end

procedure Node005 begin
debug_msg("Node005");
Reply(500);
NOption(501,Node999,004);
end
procedure Node006 begin
debug_msg("Node006");
Reply(600);
NOption(601,Node999,004);
end


So yea, syntax errors, logic errors, help me find them! I'm really set on making my own fallout, so I would give like 50000 karma points to anyone who would be nice enough to help me = D
My mantra: "Please for the love of God, just work..."
Jargo
Respected
Respected
Posts: 85
Joined: Fri Dec 27, 2002 6:17 pm
Location: FMC (Poland)
Contact:

Post by Jargo »

well first if you use compiler or p.bat file from its standart location
..Fallout 2 Mapper\scripts then erase this dots in include lines like his:

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

#define NAME SCRIPT_SCJERKEY
#define TOWN_REP_VAR GVAR_TOWN_REP_SLAVERS

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

procedure pickup_p_proc is used when somone steals item from your critter or (if it is in item script) when you take this item
Our Host!
Post Reply