General Scripting

Dakcenturi

First time out of the vault
Hello all. Just digging into some of the scripting for Fallout and had a few questions after going through all the documentation I can find.

First off, where are the functions defined? For example :

Code:
op_start_gdialog(235, op_self_obj(), 4, -1, -1);

Is there anywhere that says what each parameter relates to for the op_start_gdialog function? Also, are there any comments on what exactly that function is for?

Second, I've found the header files from the Fallout Editor, they look like the headers for Fallout 2 are there header files for Fallout for things like get_reaction, etc or are they the same as what is in Fallout 2? I didn't see anything from un-compiling all the .dat files or anything.

Those are my main questions for now. I'm trying to figure out what exactly is going on in the procedures for different characters.

I understand the base concepts, but I want to try and dig a little deeper.
 
I tried to scripting in FO1 a bit, and in my opinion, this is in 95% the same as in FO2.

This:

Code:
op_start_gdialog(235, op_self_obj(), 4, -1, -1);

is like this:

Code:
start_gdialog(SCRIPT_NUMBER,self_obj,4,-1,-1);

Try FSE editor and read Fallout_Editor.doc from mapper for FO2.
 
@ Dude101
Ya I've looked through a lot of that documentation, though thanks for the link! I've also noticed that there isn't much FO1 docs hehe. The FO1 to FO2 conversion. Is there a mod that has done this?

@Cubik2k
I figured it might be similar, looking through the Fallout_Editor.doc did help although there are still some of the script commands I can't seem to link to that doc like all the maybe_*_dialog(), op_script_action, and some others.

Thanks both for the replies and help so far!
 
Another question I had. In the vault13.gam file for the global variable 118 this is what is defined:

Code:
IAN_STATUS                :=0;       //  (118) // Ian from Shady Sands :=0;              //  (Alive/Dead/Where)

So when you are looking at the following code:

Code:
if ((op_global_var(246) == 1) and (op_global_var(118) != 2)) then 
    call Ian14(); 
  else if (op_global_var(118) == 0) then
    call Ian02();
  else if (op_global_var(118) == 2) then
    call Ian15();
  else if (op_global_var(118) == 3) then
    call Ian21();
  else
    call Ian12();

Where is it defined what 0, 2, and 3 are? In the comment for the variable declaration it says (Alive/Dead/Where) does that mean 0 is alive, 2 is dead and 3 is where? That doesn't seem to make sense in context to what is occurring after each if though if that is how it is mapped.
 
That worked, thanks!!

Got it up and running and it definitely makes it a bit easier to sort through being in the FO2 scripts.

My most recent question still stands though, where are the status' defined for an NPC? I can't seem to find that anywhere.

Code:
if ((global_var(GVAR_ENEMY_SHADY_SANDS) == 1) and (global_var(GVAR_IAN_STATUS) != 2)) then begin
		call Ian14;
	end
	else begin
		if (global_var(GVAR_IAN_STATUS) == 0) then begin
			call Ian02;
		end
		else begin
			if (global_var(GVAR_IAN_STATUS) == 2) then begin
				call Ian15;
			end
			else begin
				if (global_var(GVAR_IAN_STATUS) == 3) then begin
					call Ian21;
				end
				else begin
					call Ian12;
				end
			end
		end
	end
 
Dakcenturi

You talk about it?

Code:
procedure join_party
begin
  set_global_var(GVAR_IAN_STATUS, 2);
  party_add(self_obj);
  add_timer_event(self_obj, game_ticks(1), 1);
  critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_TEAM_NUM, 0);
  gsay_message(SCRIPT_IAN, 150, NEUTRAL_REACTION);
end
 
Ok, I see where all of them are defined except for 0. I'm assuming that 0 is when you first meet the NPC based off the dialog that you receive in that if statement.

I guess ctrl+f really is my friend. :P
 
Ok got another one. :)

Code:
roll_vs_skill(dude_obj, 14, 20)

I know this is a roll versus a skill on the player where there is a modifier of 20. What is the 14, it says that it is the skill, but where do I find what skill is = 14?
 
Dakcenturi said:
Ok got another one. :)

Code:
roll_vs_skill(dude_obj, 14, 20)

I know this is a roll versus a skill on the player where there is a modifier of 20. What is the 14, it says that it is the skill, but where do I find what skill is = 14?
It's speech. If you have installed the mapper you can find a list of stats and skills in DEFINE.H in the HEADERS folder. Or you can just count the skills in the order they appear in the game starting with 0, which is small guns.
 
Ok, so just to verify:

Code:
(is_success(roll_vs_skill(dude_obj, 14, 20)))

Means the roll is a success if the roll versus speech skill is >= 20 or am I completely off?

What I originally thought is that it meant it is a success if the roll versus speech skill + 20 is >= something. Just not sure what it is comparing against if that is the case.
 
That 20 is a skill bonus. When using items such as tools or lockpicks you can get a plus bonus boost.
If it's a difficult check, like opening a safe, you might get a -80 or something bonus instead.
As far as I can tell it is (your skill + or - the bonus) out of 100.

For your example, lets say you have 30% speech + 20 bonus = 50% chance.
 
Ok so there isn't any defined check that you are trying to beat it is just a you have a % chance and it randomly determines whether that % is a success or not?
 
Exactly. There is no set, defined number as it depends on the values for your skills. Look at your example above. It is a check against skill 14 (speech). The game takes your skill, let's say 22, then adds 20 to it. The resulting number is 42. The engine chooses a random number. If the resulting number is 42 or less than 42, then you succeed in the task (in this case, maybe it was convincing an NPC of a lie you are telling). If the resulting number is greater than 42, you fail the check.
 
Ok, makes sense and I guess it makes it a lot more random. Is there a range for the random number? 1-100 or is that even known?
 
Back
Top