metarule3(107)

Nirran

Vault Senior Citizen
Modder
any way of checking if the item already has the appearance?or using the metarule to set art to the main items art?such as item 455 to art 455?
 
Was that about art_change_fid_num(x,y) ? If so then you can just check via obj_art_fid(x)?

Example:
Code:
if (obj_art_fid(self_obj) == FID_HMLTHR) then begin
     ....
end
 
figured a way of doing it,but it is messy,wondering if any obvious problems with this code on map_update

Code:
      if (global_var(1644) == 0) then begin
         metarule3(107, Scenery_Creation, 33556447, 0);
      end
is what I want,but not seeing a way fo doing it,sodid this

Code:
      if (global_var(1644) == 1) then begin
         if (tile_contains_pid_obj(Get_Car_Hex, elevation(dude_obj), 33555441) != 0) then begin
           destroy_object(tile_contains_pid_obj(Get_Car_Hex, elevation(dude_obj), 33555441));
         end
         Scenery_Creation := create_object_sid(33555441, Get_Car_Hex, elevation(dude_obj), 304);
         //metarule3(107, Scenery_Creation, 33555441, 0);
      end

forces it to load car art w/o metarule

Nirran

edit : nvm crashes on elvation change
 
Last edited:
What exactly are you trying to do? Also, why don't you use macros? I always find it hard to read these raw numbers, etc. (which is why the macros exist).
 
set_proto_data(int pid, int offset, int value)
You can still use this to change the FID (change before creating the object)
 
trying to run car update on map update,foudn away to do it thoi,thnx fpr replys

edit : ya apparently game does not like update car in map_update procedure,but to clarify I was trying to set art to the items self art,it caused the item to disappear when doing it and item was already self art
 
Last edited:
Code:
procedure map_update_p_proc begin
   variable obj := tile_contains_pid_obj(global_var(GVAR_CAR_PLACED_TILE), self_elevation, PID_DRIVABLE_CAR);
   if (obj) then
      art_change_fid_num(obj, 33556655);
end
This code does not cause any problems.
you are doing something wrong, show your code.
 
ok here it is

Code:
   if not(in_world_map) then begin
      if (tile_contains_pid_obj(Get_Car_Hex, global_var(1646), 33555441) != 1) then begin
         Scenery_Creation := create_object_sid(33555441, Get_Car_Hex, global_var(1646), 304);
      end else begin
         Scenery_Creation := tile_contains_pid_obj(Get_Car_Hex, global_var(1646), 33555441);
      end 
      if (global_var(1644) == 0) then begin
         metarule3(107, Scenery_Creation, 33556447, 0);
      end

pretty simple
 
Last edited:
xm, it is not understandably whether this script is global or normal?

if (tile_contains_pid_obj(Get_Car_Hex, global_var(1646), 33555441) != 1)
Here you have an error, the value will be greater than 1, or 0.

did optimization:
Code:
Scenery_Creation := tile_contains_pid_obj(Get_Car_Hex, global_var(1646), 33555441);
if (Scenery_Creation == 0) then begin
   Scenery_Creation := create_object_sid(33555441, Get_Car_Hex, global_var(1646), 304);
end
if (global_var(1644) == 0) then begin
   metarule3(107, Scenery_Creation, 33556447, 0);
end
 
ok thnx,doesnt solve the problem tho,problem is that if the art is already desired art,it causes the item to be invisible,when using m107
 
set_proto_data(int pid, int offset, int value)
You can still use this to change the FID (change before creating the object)

tried this but no finding an easy reference to the offset needed,at least it doesn't crash the gametho

edit : ran get proto from 1-500,what would the art fid number be?33555441 isn't listed
 
Last edited:
33555441 this not Fid, это номер прототипа car scenery!
usually at offset 8, write the FID number.
 
Last edited:
I don't speak Russian,what is the offset number?

edit thnx,tried 8,nogo

edit 2: is the art fid for scenery just the scenery number?
 
Last edited:
I don't speak Russian - use google translate :)

#define PROTO_FID (8)
set_proto_data(PID_DRIVABLE_CAR, PROTO_FID, 0x2000000 + NumberYourArtFromScenery.Lst);
 
I don't speak Russian - use google translate :)

#define PROTO_FID (8)
set_proto_data(PID_DRIVABLE_CAR, PROTO_FID, 0x2000000 + NumberYourArtFromScenery.Lst);
thnx

edit : ok I'm done,it works without the on_map_update anyway,thxn for trying

edit 2 : fyi I tried this and it did nothing
Code:
set_proto_data(33555441, 8, (0x2000000 + 1021));

edit 3 :
Also, why don't you use macros?

I don't use macros cause I got used to looking at the raw code working with megamod years ago,now it is habit

edit 4 :
xm, it is not understandably whether this script is global or normal?

global,putting all car code into one script
 
Last edited:
Back
Top