Flare (and other exploration equipment) TUTORIALS

Discussion in 'Fallout General Modding' started by Lich, Dec 30, 2006.

  1. Lich

    Lich Water Chip? Been There, Done That

    829
    Dec 23, 2004
    This script will make some interesting effect: when you hold in hand "burning" fare, light level on area will increase, when you hide flare to backpack light level will again decrease. Its very simple and look great. Usualy light level is activated by map script in map_update procedure, but its very slow so make it other way: place somewhere behind cave wall critter with script. Critter is check by game engine much faster than map, thats why its better way to do this. He will just quick change light levels depend on items you have in hands like burning torch, flare, lighter, matches, candle or any item which is light source. Hide this critter behind cave wall because if you kill him, all effect will not work longer. Now caves and dark places will be much realistic.

    FLARE
    If you have in left or right hand light source then light level is increase, else: decrease light level. Everything you need to change is put different light level and different pid_light_source. This script could be upgraded to check more than just flare light sources. For example matches will set light 20%, candle, lighter 30%, flare 40%, torch 50%, flashlight 50-60%


    Code:
    procedure start;
    procedure critter_p_proc;
    
    procedure start begin
    end
    
    procedure critter_p_proc begin
    if ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_ACTIVE_FLARE) or 
    (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_ACTIVE_FLARE)) then begin
    
    set_light_level(40) ;
    
    end else begin 
    set_light_level(10) ;
    
    end
    end
     
  2. Chris Parks

    Chris Parks Vault Senior Citizen

    Jun 10, 2006
    Superb idea! Now we just need a use for it in the game.
     
  3. jargo

    jargo Where'd That 6th Toe Come From?

    492
    May 25, 2003
    interesting idea Lich. I think the best way to add this to every map in game is to add this code to obj_dude script.
    Using obj_set_light_level instead of set_light_level can be also interesting.
    Great idea.
     
  4. MIB88

    MIB88 So Old I'm Losing Radiation Signs
    Modder

    Feb 22, 2005
    I was just thinking that same thing. :) Looks like there is a use for that flashlight he created for Black Steel. Definitely a help to those characters with low perception in combat at night.
     
  5. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    Did this a year ago for a new Item in my modification. :) But I think, there where a problem while fighting. If you carry the flare (in my mod it was a new lamp) in the Hand and put it off in a fight, the light don´t change back to normal.
     
  6. Lich

    Lich Water Chip? Been There, Done That

    829
    Dec 23, 2004
    Tricks for the light:
    -place "light critter" in different map level, instead of hide behind wall (it work for every 3 map levels)
    -light 40% is good for flare because got little red colour, 45% is more white and fit to flashlight, 50% seem to be too much
    -set light for proto item (range 8, intense 100%) so it look like real light come from that item when you hold it
    -in map_enter procedure set darkness code: set_light_level(10); otherwise you may encounter quick flash when you enter dark area

    I use it for very dark abandoned places, flare is one from many exploration equipment (flare, rope, crowbar, gasmask, dynamite)

    How it works: (another tutorials)

    DYNAMITE
    Very short script. If domage come from explosion object disappear. Just add this to rocks in corridor. But you may also use the same script for every walls from building! so big explosion will make some demolish effect. I dont test this way but should work.

    Code:
    procedure start begin
    end
    
    procedure damage_p_proc begin
    if (weapon_dmg_type(target_obj) == DMG_explosion) then begin
    give_xp(50);
    destroy_object(self_obj);
    end
    end
    ROPE
    It work similar to dynamite. But use some scenery trick: place broken shaft picture with rope and in the same place broken shaft without rope with that script. To place one scenery on second: press M in mapper and hold mouse button on scenery, then move it to place where already is something. When you place one picture to other, visible will be only this second. So script just remove one picture and appear second picture which is behind. In practice: if you use rope on broken elevator shaft it will disappear and you will see second picture: shaft with rope. This second shaft must be stairs (make new scenery proto) when you use it, you will climb level down.

    Code:
    procedure start;
    procedure use_obj_on_p_proc;
    
    procedure start begin
    end
    
    procedure use_obj_on_p_proc begin
    variable tool;
    tool := obj_pid(obj_being_used_with);
    if (tool == PID_ROPE) then begin
    script_overrides;
    give_xp(50);
    remove_pid_qty(dude_obj, PID_ROPE, 1) 
    destroy_object(self_obj);
    end else begin
    end      
    end


    CROWBAR
    You need use tool=crowbar to open rusty lockers and doors. It work like some kind of key, you may open these lockers/doors only using crowbar (make new misc item with crowbar picture) Add this script to rusty doors, tool=540 is proto number for item you use.

    Code:
    procedure start;
    procedure use_obj_on_p_proc;
    procedure map_enter_p_proc;
    procedure key_unlock_door;
    
    #define LVAR_Locked                     (0)
    
    procedure start begin
    end
    
    procedure use_obj_on_p_proc begin
    variable Tool;
    Tool:=obj_pid(obj_being_used_with);
    if (Tool == 540) then begin
     if (local_var(LVAR_Locked) == 0) then begin
     call key_unlock_door;
    end else begin
    end
    end
    end
    
    procedure key_unlock_door begin
       set_local_var(LVAR_Locked, 1);            
       obj_unlock(self_obj);                                
       script_overrides;
    display_msg(mstr(99));
    give_xp(20);
    end
    
    procedure map_enter_p_proc begin
    if (local_var(LVAR_Locked) == 0) then begin
    obj_lock(self_obj);
    end else begin
    obj_unlock(self_obj);
    end
    end

    GASMASK
    This one i made long ago and its my favourite. Its spatial script of toxic cloud which check how item you got in hands. If you have gasmask then do nothing, otherwise poison you. (its code from old tutorial, later i upgraded it, but obviously should work)

    Code:
    procedure spatial_p_proc;
    procedure start;
    
    procedure start begin
    end
    
    procedure spatial_p_proc begin
    if ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_MASKA) or 
    (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_MASKA)) then begin
    
    if (source_obj == dude_obj) then
    // display_msg(mstr(100));
    end
    
    else
    poison(source_obj,10);
    end 

    WORLDMAP
    I removed exit grids and made worldmap item which look like this:

    To enter worldmap screen you need just use that item so travell is much easy than before. I used it in BSM2 interesting way: you remove it from crashed vertibird cockpit "navigation system". This item just load map000, very easy code:

    Code:
    procedure start;
    procedure use_p_proc;
    
    procedure start begin
    end
    
    procedure use_p_proc begin
    script_overrides;
    load_map(000,0);
    end
     
  7. mad_eye

    mad_eye First time out of the vault

    19
    Jul 17, 2006
    These are some handy scripts. Well done. But about the worldmap item. Add check if dude_obj is not in battle.
     
  8. jargo

    jargo Where'd That 6th Toe Come From?

    492
    May 25, 2003
    Uhm it seems we need to add this code to combat_proc too
     
  9. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    Could be possible. Maybe someone should test it. :)
     
  10. Dorian Grave

    Dorian Grave First time out of the vault

    14
    Jan 1, 2007
    Lich, you're a genius. I'm almost absolutely positive that I will use some of your scripts in my upcoming mods (which are still only in my head, for now), good work!
     
  11. Lich

    Lich Water Chip? Been There, Done That

    829
    Dec 23, 2004
    Idea for another usefull item, especially in postnuclear world: Geiger Counter

    This one from game is stupid because only check rad value you already gained! It should warning you and allow to avoid danger. Counter may work similar to gasmask, but use two scripts.

    Spatial script of Rad-Trap and Rad-Warning
    It may work on two spatial scripts: one with small area "rad trap" which increase your radiation level. Second is spatial with large area (around trap) which is warning. So when you hold Geiger counter then is view message "rad hazard: 08" value depend on how strongh is rad trap. So counter warning you than somewhere near is radiation source, an you may avoid stepig on it!

    Already its only concept, but it should work.
     
  12. DarkstarTheeSlaymaker

    DarkstarTheeSlaymaker First time out of the vault

    11
    Nov 9, 2006
    hey Lich, you should make sure you can still have the motion sensor equiped in one hand and the geigercounter in the other and still get both the benefits when traversing the world map. its feasable cus you have two hands right? :D im looking forward to your vault 14 mod to be included in the next edition of MIB88's megamod! 8)
     
  13. Dude101

    Dude101 Vault Fossil
    Modder

    Aug 3, 2005

    Vault 5 is Lich's, Vault 14 is a Russian mod we just translated.
     
  14. Robert Czarwolski

    Robert Czarwolski It Wandered In From the Wastes

    131
    Feb 5, 2007
    idea.....

    Well, i was thinking and- Hey! Why not create a gravity gun for fallout!
    With little scripts in VARIOUS itens and adding TONS of itens, misc pro`s and having much patience, you can make a kinda-off gravgun.
    I thinked in that- When you fire the grav gun agains a scenary, you destroy the scenary and destroy your weapon, replacin the iten grav gun by grav gun + scenary... Adding a series of scripts, when you drop the weapon, actualy you will destroy the iten grav gun + scenary and create scenary at obj_dude rotation but 1 hex forward... Then, it`s needed to add a misc file to each scenary that can be picked up, and when you fire grav gun + scenary you will do x dam to a enemy and the scenary will be placed in 1 hex front of target rotation. The grav gun must be able to pick up itens too ( imagine you pick a spear in a 7 hex distance and shot it against a raider.... It would be cool)....
    It will require like i said little scripts, but LOTS of litle scripts....
    Altrouth, it will give a completly new perspective to the game and could be used to exploration\ survival\ ass kick tool.... I don`t have specified everything and showed the scripts because-
    1- I know simply NOTHING about scripting.
    2-It`s only a idea.
    3-I aren`t asking anyone to do it, but if anybody can send me a example scripts, i will be happy. :lol:
     
  15. Oracle

    Oracle Vault Senior Citizen

    May 19, 2003
    I believe cpt corpse cheating tool hand an option to destroy scenary ingame. So it has was script your inerrested in.
     
  16. Lich

    Lich Water Chip? Been There, Done That

    829
    Dec 23, 2004
    This gravity gun you mentioned reminds me idea from HalfLife2, do you inspired by this game to create it?

    Ofcourse exist script procedures to place or delete on map whatever you want (items, scenery, critters) but am not sure how do that.

    I have some different idea about weird guns, its... "PANIC GUN" When you fire it then every critters around will lost morale and escape! Not typical gun using ammo but just misc item with script, which look like gun. Script will affect critter procedures.

    fragment of this procedure:

    Code:
    animate_run_to_tile(tile_num_in_direction(tile_num(self_obj),random(0,5),random(3,7)));
    float_msg(self_obj,"PANIC!",2);
    critter run in random direction from dude obj and shown red message over head "panic!"
     
  17. Robert Czarwolski

    Robert Czarwolski It Wandered In From the Wastes

    131
    Feb 5, 2007
    Ideas

    half-life 2! exactly that!
    (sorry for the 1 year delay... i spent grat time modding other games to gain some experience...)
    i thinked too in a "anti-survival" item:
    Antrax\neuro-toxin\FEV virus pot, it will check if player has power (enviromental too) armor or gas mask and will give a kinda of 999 dam in x seconds (tics) example, antrax 2 days\ FEV 30 mins and neuro toxin 20 secs... it kills anyone in the difined map lv
    - someone can incorporate the previously showed srcipts in the proper files, because i don't have a idea where to put them or what use to "incorporate" the scipts to the game or item....
    EDIT- Also some shock paddles would be cool (reviving the dead critter if done in less than 1min after death without any medical product aplyed.).
     
  18. Robert Czarwolski

    Robert Czarwolski It Wandered In From the Wastes

    131
    Feb 5, 2007
    JSE

    well, i tried to compile the scripts but with no sucess....... I've used JSE but it give some weird problems. Is something wrong with the scripts or the program.......................................................................
    it says a thing like: critical error:
    do not recognized the comand inven_type_left_hand.......
    Any idea of what it could be

    SORRY! double post!!!