Page 1 of 1

slow reacting scripts?

Posted: Tue Jun 10, 2003 11:26 pm
by ColJack
i've started to figure this scripting thing out, and have made a script for repairing a generator and gettin the lights back on, as well as the map script for the test map..

everything works, it just works slowly sometimes..

what i mean is, i enter the map from another map ( just to make sure it's set up... ) and it is indeed dark..
then o go and repair the generator ( with the help of the hint book to boost my stats for testing.. ) it say's i've repaired it, but the lights sometimes come on right away, other times they can take up to 20 seconds to come on..

( by "lights come on" i mean changing the light level.. )

i know there is a time jump command in there somewhere ( like when reading books, fades to black, then fades back in, advancing the game timer.. ).. would that help.

i think it's something to do with the map_update proceedure.. it only runs every 30 seconds or so..


is there a way to set up a loop in a script that checks a variable once every second??

Posted: Wed Jun 11, 2003 6:46 am
by Temaperacl
i know there is a time jump command in there somewhere ( like when reading books, fades to black, then fades back in, advancing the game timer.. ).. would that help.

i think it's something to do with the map_update proceedure.. it only runs every 30 seconds or so..
I'd suggest forcing a call to the map_update_p_proc. If you can call it from the script that you fix the generator in, that would probably be best, but I can't think of a command to do that off the top of my head, so if you can't do that, your idea of setting up something to check a variable repeatedly would probably work.
is there a way to set up a loop in a script that checks a variable once every second??
add_timer_event(self_obj, game_ticks(1), identifier) in map_enter_p_proc to start it off and have in the timed_event_p_proc

Code: Select all

if (fixed_param == identifier) then begin 
 if(Variable == 2) then
  call map_update_p_proc;
 else
  add_timer_event(self_obj, game_ticks(1), identifier);
end
where identifier is some identifier for the timer call, Variable is the variable you are checking (I assume it is only 2 if the generator is fixed)
That should do it for you (Although I haven't actually tested this yet)..

Posted: Wed Jun 11, 2003 6:51 am
by Jargo
yes call woul be the best way for you i think :D

Posted: Wed Jun 11, 2003 6:57 am
by requiem_for_a_starfury
Me a humble FOT map maker still trying to learn to read FO2 scripts but have a look at the scripts for the Military Base and see how it's handled there, as that's basically the same senario. You repair the generator and the lights come on.

Posted: Wed Jun 11, 2003 9:21 pm
by ColJack
they had a similar problem with the force fields in fallout 1..
you used the radio, but the fields took 20 or 30 seconds to go off..

i "fixed" it by putting a fade out, advance game timer 1 hour, fade in bit in the script for the generator.. works great now..