OSP Code Combat To burn a city...

Users who are viewing this thread

Mirathei

Sergeant Knight
I made the following code which allows fires to spread in a city. Here it is designed to be used in combination with my catapult code, but it could easily be done otherwise.

Code:
     ("spread_fire",
       [(try_for_range,":prop_type","spr_town_house_a","spr_earth_wall_a"),
           (scene_prop_get_num_instances,":number", ":prop_type"),
           (try_for_range,":prop",0,":number"),
               (scene_prop_get_instance,":instance", ":prop_type", ":prop"),
               (agent_get_position,pos2,reg55),
               (prop_instance_get_position,pos1,":instance"),
               (get_distance_between_positions,":dist",pos1,pos2),
               (try_begin),
                  (lt,":dist",1000),
                  (party_set_slot,"p_burning_buildings",":instance",50),
               (end_try),
               (party_get_slot,":burn","p_burning_buildings",":instance"),
               (gt,":burn",40),
               (particle_system_burst,"psys_massive_fire",pos1,100),
               (try_for_range,":prop_type2","spr_town_house_a","spr_earth_wall_a"), #covers most wooden houses and such
                  (scene_prop_get_num_instances,":number2",":prop_type2"),
                  (try_for_range,":prop2",0,":number2"),
                    (scene_prop_get_instance,":instance2",":prop_type2",":prop2"),
                    (prop_instance_get_position,pos2,":instance2"),
                    (get_distance_between_positions,":dist",pos1,pos2),
                    (lt,":dist",1500),
                    (party_get_slot,":burn","p_burning_buildings",":instance2"),
                    (val_add,":burn",1),
                    (party_set_slot,"p_burning_buildings",":instance2",":burn"),
                  (end_try),
               (end_try),
           (end_try),
         (end_try),]),
How it works is that it uses a dummy party as a variable storage mechanism. Thus I can effectively have a set of slots for each prop.

To prove that it works:
(no, that particle system is not in native)


There was no fire on the scene when I loaded it.

If you also cause any agent which comes within a certain radius of a burning building to be killed, this can make fire a very effective weapon.

Your thoughts?
 
Your thoughts?

Very cool feature but I imagine the impact on performance is quite significant?
 
So, what .py do we use that in?

How do we use it in conjunction with the catapult code?

And where can we get that particle system?
 
Jallon said:
So, what .py do we use that in?
scripts

Jallon said:
How do we use it in conjunction with the catapult code?
Until I release pirates, you don't. However, I will tell you that reg55 is the catapult ammunition. If you want to use it without the catapults, assign the originating fire's position differently.

Jallon said:
And where can we get that particle system?
From the source files of Pirates of Calradia, when its released.
 
Back
Top Bottom