Scenery spawned via script

Sirren67

Look, Ma! Two Heads!
I'm using this piece of code to spawn "flaming" barrels (the first scenery obj in the mapper):

create_object(33554433,17903,0);

It does work, but some of the barrels spawn without flames, and don't emit much light, if any.... Is there anybody else spawning scenery via script? Did this happen to you too?
 
Random spawning of flaming barrels.

I don't think any good can come out of this.
 
Silencer wrote.
*casts 'Summon Jargo'*
:notworthy:

Ashmo wrote:
Random spawning of flaming barrels.

My barrels are carefully picked and placed one by one. I first meet them, talk to them to know their flaws and strong points, then HANDPICK the best of them... After that they fail me like so... life bites...
 
Sirren67 said:
I'm using this piece of code to spawn "flaming" barrels (the first scenery obj in the mapper):

create_object(33554433,17903,0);

It does work, but some of the barrels spawn without flames, and don't emit much light, if any.... Is there anybody else spawning scenery via script? Did this happen to you too?

Thats weird, fire animation is done in FRM by using PAL special colors.
I just tested that and all worked fine for me.
Can you post your script?


*casts 'Summon Jargo'*
Next time i will have "dispell Silencer" ready at hand ;).
 
I can't see troubles in the my script, except for the sheer amount of objects destroyed and created.

in map_enter and map_update:
Code:
if ( game_time > ONE_GAME_HOUR *48 ) then begin
   if (map_var(MVAR_Barrels_Made) == 0) then begin
      set_map_var(MVAR_Barrels_Made,1);
      call Make_Barrels;
   end
end

then, in a separate procedure:

procedure Make_Barrels begin
    create_object(33554433,18262,0);
    create_object(33554433,16479,0);
    create_object(33554433,17888,0);
    create_object(33554433,18271,0);
    create_object(33554433,17274,0);
    create_object(33554433,23110,0);
    create_object(33554433,22702,0);
    create_object(33554433,22492,0);
    create_object(33554433,23279,0);
    create_object(33554433,23667,0);
    create_object(33554433,17903,0);
end
Before this the same script destroys some 25 light sources.
Code:
if ( game_time > ONE_GAME_HOUR *39 ) then begin
      set_global_var(GVAR_ARMY_CUT_POWER,1);
      destroy_object(tile_contains_pid_obj( 19512, 0, PID_LIGHT_SOURCE));
end

I didn't want to clutter the map script with such a huge amount of stuff, so the script is a generic item script attached to a scenery object in the related map. The flaw in barrels spawning fits my goal (a bug which is enough complex and widespread can become a game feature). I was just curious about the reasons why...
Bye.
 
The only thing is that i used your code and it worked perfectly fine, barrels were created, animation and light was all ok.
Probably one of those ghost bugs with maps.
Check if this happen on another map.
 
Back
Top