Again, yes. Just a series of statements checking to see which armor is worn, then play x effect. Once you know exactly what you want to do, I can send you a script or code for it.
procedure timed_event_p_proc
begin
if(combat_is_initialized == false) then
begin
if(dude_is_walking)then
begin
play_sfx("ILCNTNRB");
end
if(dude_is_running)then
begin
play_sfx("ILCNTNRB");
end
end
add_timer_event(Self_obj,game_ticks(1),0);
end
procedure critter_p_proc
begin
if(dude_is_walking)then
begin
play_sfx("ILCNTNRB");
end
if(dude_is_running)then
begin
play_sfx("ILCNTNRB");
end
end
Would playing every second be good? if so, you can do this:Josan12 said:So the problem is that final result is a rather jumbled, echoing sound mess because the sound is called too often. So MIB88 came up with the good idea that i could add a basic variable that increases by 1 every time the critter_proc gets called. When it reaches a certain number, it calls the sound. Again - simple. So simple that i can't figure out how to do it. So i'm not looking for anything complicated here: could someone write me an example of the code above that does what i want pleeeeeeze? In case anyone doesn't already know, i'm just a noob scripter (hence why i'm asking for help)
variable time;
if ( (time+1) == GAME_TIME_IN_SECONDS ) then begin
//display_msg("hello per second: " + time);
//put your code here
time := GAME_TIME_IN_SECONDS;
end
time:= GAME_TIME_IN_SECONDS;
procedure start;
procedure critter_p_proc;
procedure map_enter_p_proc;
procedure combat_p_proc;
procedure map_update_p_proc;
procedure is_dropping_p_proc;
variable time;
procedure critter_p_proc begin
if ( (time+1) == GAME_TIME_IN_SECONDS ) then begin
display_msg("hello per second: " + time);
play_sfx("maxflr");
time := GAME_TIME_IN_SECONDS;
end
procedure map_enter_p_proc
begin
time:= GAME_TIME_IN_SECONDS;
end
killap said:Oh, for some reason it seems that even though you start the game, enter_map_p_proc for obj_dude is not run until you renter the map (I swear it is run for other scripts). Try exiting and entering a map - it should work then.
procedure critter_p_proc begin
if ( (time+1) == GAME_TIME_IN_SECONDS ) and (dude_is_walking) then begin
display_msg("hello per second: " + time);
play_sfx("maxflr");
time := GAME_TIME_IN_SECONDS;
end
procedure critter_p_proc begin
if (dude_is_walking) then begin
set_local_var (LVAR_steps, + 1);
end
if (LVAR_steps == 5) and (dude_is_walking)and (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_LEATHER_JACKET) then begin
play_sfx("maxflr");
end
Sure, just throwing that idea out thereJosan12 said:I'm not sure linking it to game_time_in_seconds will help me do that....
Syntax errors.Josan12 said:So going back to MIB88's idea of adding a variable that is increased every time the critter_proc is called, here's what i was thinking (but i can't get it to compile):
#define LVAR_myvar (2)
set_local_var(LVAR_myvar,5);
set_local_var(LVAR_myvar,local_var(LVAR_myvar)+1);
if (local_var(LVAR_myvar) == some_value) then begin
//your fun code
end
variable foo;
foo := 5;
foo := foo + 1;
if (foo == some_value) then begin
//your fun code here
end
procedure critter_p_proc begin
variable step;
step := 0;
if (dude_is_walking) then begin
step := step + 1;
//display_msg("hello per second: ");
end
if (dude_is_walking) and (step == 2) then begin
play_sfx("maxflr");
end
end
The problem is you have the variable "step" being declared in critter_p_proc. This means that every time critter p_proc is called step is reset to 0. This is a problem.Josan12 said:As you can see it doesn't do what i want it to do because the variable can never get above 1!!! (but at least it compiles!)
variable step;
step := 0
Judaeus Apella said:I think you can get that leather creaking noise from... what was that game. I know theres a game I have that uses it. Counter Strike Source? Thief? Splinter Cell? One of those I think.... I'm not sure which. Sorry...
Josan12 said:The problem is how to script them... i just can't seem to find a way to accurately 'time' the playing of a sound.
procedure start;
procedure start begin
if (game_loaded) then begin
set_global_script_repeat(2);
end
else begin
if (dude_is_walking) then begin
// play_sfx("maxflr");
display_msg("walk");
end
end
if (dude_is_walking) then begin
procedure start begin
if (game_loaded) then begin
set_global_script_repeat(2);
end
else begin
if (dude_is_walking) then begin
// play_sfx("maxflr");
display_msg("walk");
end
end
end
procedure start begin
if (game_loaded) then begin
set_global_script_repeat(2);
end
else if (dude_is_walking) then begin
// play_sfx("maxflr");
display_msg("walk");
end
end