Lexx said:
Well, it won't work anyway. Adding such a script to every grass item in the game will be overkill.
I don't know of any other solution. Maybe something could be done with Sfall, no idea.
Well scenery items can be scripted without problems, though.
Granted yes if you want all grass on all maps to animate, that is going to be kind of a pain in the ass to implement, but it's doable and I don't foresee it causing crashes. There aren't as many grass items per map as you might think.
But I could be wrong, afterall I've heard about the issue with the scripted piles of shit causing crashes in older versions of F2RP
@Sketch:
First of all, OMG FUCKING LOVE YOU. I'm so glad to see you working on Ms Punk Girl, that's awesome.
Re: animated objects:
in theory you shouldn't have to script it at all. Fallout 1 uses animated FRMs for the Military Base alarms and they have no animation order in script, it just places them on the map. So as far as I know, as long as you use animated FRMs, it should work no problems. I would highly encourage you to try this method before needlessly doing a bunch of scripting. Take a look at MBLIGHT1.FMR and MBLIGHT2.FRM as examples of animating graphics. (Fallout 1)
Here's the Klaxon (MB alarm) script -- so what you might be able to do is add similar code to the script for the map itself and have it randomly select hexes to add the objects to. Or pick specific hexes in the map editor and use those. Or write down the hexes already used in all the maps, and overwrite the current objects with the animated version.
Code:
procedure start;
procedure map_update_p_proc;
procedure start
begin
if (script_action == 23) then begin//map_update_p_proc -- called every dozen seconds or so, & additionally on certain events (exit dialog, end combat, load map, etc)
call map_update_p_proc;
end
end
procedure map_update_p_proc
begin
variable LVar0 := 0;
if (global_var(146) and (local_var(0) == 0)) then begin
set_local_var(0, 1);
if (obj_pid(self_obj) == 33555260) then begin// or 59
LVar0 := create_object_sid(33555340, tile_num(self_obj), elevation(self_obj), -1);
end
else begin
LVar0 := create_object_sid(33555339, tile_num(self_obj), elevation(self_obj), -1);
end
end
end
Notice how it doesn't tell anything to animate at all, it just places the animated object (MBLIGHT in this case) onto the map.
If that doesn't work, you gotta use scripts as Lexx said.
Code:
reg_anim_animate_forever void Anim
what (ObjectPtr)
anim (int)
delay (int)
Adds a single, in-place animation on an object (what) to an animation sequence-list, at a given delay from the previous animation (delay should always be -1)! This animation will animate continuously until something in the system interrupts it. To be used *very* sparingly, for instance Gizmo’s sign and the ‘pray’ signs in the children of the cathedral (which will have to be toned down).
Here's the script I personally use for Gizmo's sign, making sure it animates no matter what:
Code:
procedure start;
procedure map_enter_p_proc;
procedure map_update_p_proc;
procedure start_p_proc;
procedure start
begin
if (script_action == 1) then begin
call start_p_proc;
end
else begin
if (script_action == 23) then begin//map_update_p_proc -- called every dozen seconds or so, & additionally on certain events (exit dialog, end combat, load map, etc)
call map_update_p_proc;
end
else begin
if (script_action == 15) then begin//map_enter_p_proc (or "map_start_p_proc") called when entering from World Map, on green "exit" grids, SOME ladders, doesn't appear to call on elevators or manholes
call map_enter_p_proc;
end
end
end
reg_anim_func(1, 1);
reg_anim_animate_forever(self_obj, 0);
reg_anim_func(3, 0);
end
procedure map_enter_p_proc
begin
reg_anim_func(1, 1);
reg_anim_animate_forever(self_obj, 0);
reg_anim_func(3, 0);
end
procedure map_update_p_proc
begin
if (combat_is_initialized == 0) then begin
reg_anim_func(1, 1);
reg_anim_animate_forever(self_obj, 0);
reg_anim_func(3, 0);
end
end
procedure start_p_proc
begin
reg_anim_func(1, 1);
reg_anim_animate_forever(self_obj, 0);
reg_anim_func(3, 0);
end
How to actually employ it is you must go into the map(s) in the Map Editor, and select each object, and link that object to the script in question.
There is information here on how to get the Map Editor working if you haven't used it before. It can be kind of daunting but actually linking those objects to the scripts is a breeze. Select object, hit keyboard key "E", scroll to select script, click OK, click OK, save map when done doing this to all instances of object.