metarule3(107)

Discussion in 'Fallout General Modding' started by Nirran, May 7, 2018.

  1. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    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?
     
  2. Lexx

    Lexx Background Radiant
    Moderator Modder

    Apr 24, 2005
    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
     
  3. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    thxn lex
     
  4. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    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: May 8, 2018
  5. Lexx

    Lexx Background Radiant
    Moderator Modder

    Apr 24, 2005
    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).
     
    • [Like] [Like] x 1
  6. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    281
    Oct 29, 2015
    set_proto_data(int pid, int offset, int value)
    You can still use this to change the FID (change before creating the object)
     
  7. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    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: May 8, 2018
  8. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    281
    Oct 29, 2015
    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.
     
  9. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    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: May 8, 2018
  10. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    281
    Oct 29, 2015
    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
    
     
  11. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    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
     
  12. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    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: May 8, 2018
  13. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    281
    Oct 29, 2015
    33555441 this not Fid, это номер прототипа car scenery!
    usually at offset 8, write the FID number.
     
    Last edited: May 9, 2018
  14. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    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: May 9, 2018
  15. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    281
    Oct 29, 2015
    I don't speak Russian - use google translate :)

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

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    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 :
    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 :
    global,putting all car code into one script
     
    Last edited: May 9, 2018