Floaters problem

Sirren67

Look, Ma! Two Heads!
I made this simple script and I have two problems:
a) minor one, push_p_proc worked, now does not work anymore :shock:
b) no matter what I try, floaters are not shown. What am I doing wrong? The simple dialogue works though.

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

#define NAME SCRIPT_SPCHECK
#define TOWN_REP_VAR (GVAR_TOWN_REP_FLORENCE)

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

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

/* Script Specific Procedure Calls */

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


//~~~~~~~~~~~~~~~~ DESIGNER TOOL STARTS HERE

procedure Node001;
procedure Node002;
procedure Node003;

//~~~~~~~~~~~~~~~~ DESIGN TOOL ENDS HERE

/*****************************************************************
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)


/*******************************************************************
Local variables which do not need to be saved between map changes.
*******************************************************************/
variable Only_Once:=0;

/*******************************************************************
******* PROCEDURES *******
*****************************************************/

procedure start begin
end

procedure map_enter_p_proc begin
Only_Once:=0;
critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_ARROYO);
critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_COWARD);
end



procedure use_p_proc begin
end


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 p_push_proc begin
script_overrides; /also tried without this part/
end



procedure use_skill_on_p_proc begin
end


procedure use_obj_on_p_proc begin
end

procedure Node998 begin
set_local_var(LVAR_Hostile,2);
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);
set_global_var(GVAR_ENEMY_ARROYO,1);
end

end



procedure map_update_p_proc begin
end

procedure Node003 begin
float_msg(self_obj, mstr(random(109, 112)), FLOAT_MSG_NORMAL);
end

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


procedure Node999 begin
end

procedure Node001 begin
Reply(104);

NOption(105,Node002,004);
NOption(106,Node999,004);
end

procedure Node002 begin
Reply(107);

NOption(108,Node999,004);
end
 
Sirren67 said:
a) minor one, push_p_proc worked, now does not work anymore

Your script seems to implement p_push_proc instead of push_p_proc. Why is that? Also, if there is nothing you want to override in the push_p_proc you don't need to have it in your script. Its kind of like OO inheritance: your script automatically supports the combat_p_proc, push_p_proc etc, you only add them to your script to override their default behavior. Default behavior for push_p_proc is to move. Include it in your script only if you want something else to happen.

Sirren67 said:
b) no matter what I try, floaters are not shown.

You have the floating message commands in Node0003 but nothing ever calls that procedure.
 
Default behavior for push_p_proc is to move. Include it in your script only if you want something else to happen.
Push_p_proc is special one if you include it in your script then script owner will have push icon in his menu, if you don't then there will be no PUSH icon at all.
 
Thanks for your reply, Dude_O.
I fixed the push_p_proc part, but I couldn't do anything about floaters. After several attempts
I couldn't call Node003 (I was not able to make a generic call to have the node always triggered no matter the circumstances), so I got ridd of it and added this thingie:

procedure start begin
float_msg(self_obj, mstr(random(109, 112)), FLOAT_MSG_NORMAL);
add_timer_event(self_obj, game_ticks(15), 3);
end

procedure timed_event_p_proc begin
if (fixed_param == 3) then
begin
float_msg(Self_obj, mstr(random(109, 112)), FLOAT_MSG_NORMAL);
end
end

Still, I am not sure this is the right way: I need the critter to continuously "speak". When I test the thingie in the mapper I only get a couple of floaters and then nothing. I also changed the first number (game seconds) to try to get faster floater display, but it did not work. Any leads?
 
Sirren67 said:
add_timer_event(self_obj, game_ticks(15), 3);

15 games ticks is only 1.5 seconds. See these from define.h

#define ONE_GAME_SECOND (10)
#define ONE_GAME_MINUTE (60*ONE_GAME_SECOND)
#define ONE_GAME_HOUR (60*ONE_GAME_MINUTE)
#define ONE_GAME_DAY (24*ONE_GAME_HOUR)
#define ONE_GAME_WEEK (7*ONE_GAME_DAY)
#define ONE_GAME_MONTH (30*ONE_GAME_DAY)

I suspect that the timer is launching before the prior event finishes processing. Try increasing the number of game ticks.

Another way to do repetitive things: critter_p_proc is a "hearbeat" proc that runs several times per second.
 
Thanks Dude_Object, I'll try that out.

One more thing, wich is completely off-topic but I feel it's better to ask first; this is addressed to anyone who cares, and expecially the moderators. I am going to officially announce my mod, and I am going to do it with a post that will contain: A general description of the story/game content; 4/6 screenshots showing important characters and places; a fairly huge amount of text to explain the screens. This will make a heavy page to download, I see that screens are usually "released" through other means. May I do such a thing? ( if so, how do I put screens in a post? ) Or should I find another way? Please let me know something.
 
You'll need to put the images on a FTP or image hosting servie (imageshack, paintedover etc.) and put it between bbcode tags to look something like this:
Code:
[img]http://www.adomainname/images/image.jpg[/img]

Posting images should be OK, just don't overdo it,a and make it apparent in the thread title that you're posting pics.

Also, maybe you could ask Odin to put the images in the NMA GAllery, if he finds them uber-cool :D
 
All right, I'm getting this topic back on track.

floaters1dc.png
 
Back
Top