Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Zhilkin

Pages: [1] 2 3 ... 8
1
It has `fear_paralyze` special attack.

Code: [Select]
bool mattack::fear_paralyze(monster *z)
{
    if( z->friendly ) {
        return false; // TODO: handle friendly monsters
    }
    if ( g->u.sees( *z ) && !g->u.has_effect( effect_fearparalyze ) ) {
        if (g->u.has_artifact_with(AEP_PSYSHIELD) || (g->u.is_wearing("tinfoil_hat") && one_in(4))) {
            add_msg(_("The %s probes your mind, but is rebuffed!"), z->name().c_str());
        ///\EFFECT_INT decreases chance of being paralyzed by fear attack
        } else if ( rng(0, 20) > g->u.get_int() ) {
            add_msg( m_bad, _("The terrifying visage of the %s paralyzes you."), z->name().c_str() );
            g->u.add_effect( effect_fearparalyze, 5 );
            g->u.moves -= 400;
        } else
            add_msg( _("You manage to avoid staring at the horrendous %s."), z->name().c_str() );
    }

    return true;
}

***

Code: [Select]
"death_drops": "angelic_drops", "//": "Assumed to be important part of the cult, so good loot"

Code: [Select]
    {
        "type" : "item_group",
        "subtype": "collection",
        "comment": "contains cloth for an average zombie, also essence and a high chance of magical loot",
        "id": "angelic_drops",
        "entries":
        [
            { "item": "essence", "prob": 100 },
            { "group": "magic_items", "prob": 25 },
            { "group": "magic_consumables", "prob": 25 },
            { "group": "magic_books", "prob": 50 },
            { "group": "magic_tools", "prob": 75 },
            { "group": "pants", "damage-min": 1, "damage-max": 4 },
            { "group": "shirts", "damage-min": 1, "damage-max": 4 },
            { "group": "shoes", "damage-min": 1, "damage-max": 4 },
            { "group": "jackets", "damage-min": 1, "damage-max": 4, "prob": 20 },
            { "group": "bags", "damage-min": 1, "damage-max": 4, "prob": 6 }
        ]
    },

Code: [Select]
[
  {
    "type" : "item_group",
    "id" : "magic_items",
    "items":[
      ["thunder_sigil", 5],
      ["bloodscourge", 5],
      ["bloodaxe", 15],
      ["spear_pestilence", 10],
      ["sun_sword", 10],
      ["ethereal_crossbow", 5],
      ["gilded_aegis", 10],
      ["armor_wyrm", 10],
      ["robe_shadow", 5],
      ["somen_clairvoyance", 5],
      ["revenant_crown", 10],
      ["gauntlets_necro", 15]
    ]
  },{
    "type" : "item_group",
    "id" : "magic_consumables",
    "items":[
      ["numbness_potion", 25],
      ["strength_potion", 20],
      ["speed_potion", 15],
      ["healing_potion", 10],
      ["scroll_sun", 5],
      ["scroll_moon", 5],
      ["scroll_artiface", 5],
      ["scroll_nature", 5],
      ["scroll_destruction", 5],
      ["scroll_subversion", 5],
      ["summon_kreck", 4],
      ["summon_blank", 4],
      ["summon_flaming_eye", 3],
      ["summon_hunting_horror", 3],
      ["summon_flying_polyp", 2],
      ["summon_mi_go", 2],
      ["summon_yugg", 1],
      ["summon_shoggoth", 1]
    ]
  },{
    "type" : "item_group",
    "id" : "magic_tools",
    "items":[
      ["offering_chalice", 25],
      ["offering_chalice_used", 30],
      ["blood_athame", 20],
      ["hexenhammer", 10],
      ["silver_glyph", 5],
      ["essence_dull", 5],
      ["essence_blood", 10]
    ]
  },{
    "type" : "item_group",
    "id" : "magic_books",
    "items":[
      ["book_magicfordummies", 5],
      ["book_potioncraft", 10],
      ["book_scrollcraft", 10],
      ["book_hexenhammer", 5],
      ["book_sacrifice", 10],
      ["book_bloodmagic", 10],
      ["book_summoning", 5]
    ]
  }

2
Tha licks ARE annoying and not fun.

3
The Lab - Contributions and Mods / Re: changing traits with lua
« on: June 11, 2017, 06:11:35 PM »
wait does lua support have callback functions? and if it does can someone give me a list of them?

There are four LUA callbacks, two of which are calendar-related:

    `on_new_player_created` -  called when starting the game (used in StatsThroughSkills mod)
    `on_skill_increased` -  called when player skill is increased (used in StatsThroughSkills mod)
    `on_day_passed` -  called once a day (at midnight)
    `on_minute_passed`- called once a minute

4
well, i would assume everything in the guy's house is owned by them.
You are no wiseguy.

5
Hey Zhilkin, could this work for the mod I wanted to do where:

The apocalypse continues to evolve as you explore with fighting pits, cannibal towns, and apocalypse churches.

Basically, I wouldn't want them to generate in the first overmap, but I would want them to start generating when you reveal more overmaps. Possibly also only during later seasons.

There are four LUA callbacks, two of which are calendar-related:

  • `on_new_player_created` -  called when starting the game (used in StatsThroughSkills mod)
  • `on_skill_increased` -  called when player skill is increased (used in StatsThroughSkills mod)
  • `on_day_passed` -  called once a day (at midnight)
  • `on_minute_passed`- called once a minute

It is possible to store player string variables which can be saved/loaded with the game.

Code: [Select]
    player = {
        parent = "Character",
        functions = {
            { name = "get_value", rval = "string", args = { "string" } },
            { name = "set_value", rval = nil, args = { "string", "string" } }
        }
    }

Calendar class fields are exported to LUA:

Code: [Select]
    calendar = {
        new = {
            { "calendar" },
            { "int" },
            { "int", "int", "int", "season_type", "int" },
        },
        by_value_and_reference = true,
        attributes = {
        },
        functions = {
            { name = "day_of_week", rval = "string", args = { } },
            { name = "day_of_year", rval = "int", args = { } },
            { name = "get_season", rval = "season_type", args = { } },
            { name = "get_turn", rval = "int", args = { } },
            { name = "increment", rval = nil, args = { } },
            { name = "minutes_past_midnight", rval = "int", args = { } },
            { name = "print_time", rval = "string", args = { "bool" } },
            { name = "print_time", rval = "string", args = { } },
            { name = "seconds_past_midnight", rval = "int", args = { } },
            { name = "is_night", rval = "bool", args = { } },
            { name = "seconds", rval = "int", args = { } },
            { name = "minutes", rval = "int", args = { } },
            { name = "hours", rval = "int", args = { } },
            { name = "days", rval = "int", args = { } },
            { name = "sunlight", rval = "float", args = { } },
            { name = "textify_period", rval = "string", args = { } },
            { name = "turn_of_year", rval = "int", args = { } },
            { name = "years", rval = "int", args = { } },
            { name = "sunset", rval = "calendar", args = { } },
            { name = "sunrise", rval = "calendar", args = { } },
        }
    }

All lua mapgen-related (like, `map:ter_set`) and other functions are usable during the game, not only on mapgen stage.

So it should be possible to store initial calendar values, calculate time difference once a minute or once a day and make some changes to the map once enough time is passed.

Still there are many limitations in LUA (or at least I didn't find the way to find a solution):

  • lua generated buldings aren't rotated automatically;
  • overmaps (displayed in the map) cannot be changed;
  • it is not possible to calculate the number of tiles the player have traversed;
  • bigger overmap coordinates are unknown.

6
Nope, we've been signalling for months now that LUA is going away, and nothing compelling has surfaced to change that decision.
(sigh)

Nevertheless  - https://www.dropbox.com/s/rlgitvrk9hoo49r/cdda_lua_mapgen_v2.zip?dl=0

Four overmaps in LUA:

`s_pharm`
`s_sports`
`mil_surplus`
`sub_station`

7
Will it be a good reason to keep LUA if most of mapgen code will be transferred from CPP to LUA?

`mil_surplus` mapgen in LUA: https://www.dropbox.com/s/3gn2p4sgmt5gdmz/cdda_mapgen_mil_surplus.zip?dl=0

Please don't afraid excess amount of loot - i didn't add check for loot spawn chances yet.

8
The Toolbox - Code Help / Re: LUA Mapgen Problems
« on: June 08, 2017, 04:12:02 PM »
You need to use `map:draw_square_ter` function, not `square_ter`, also you need to provide `ter_str_id`, not a string as first parameter of this function.

Code will be like this:
Code: [Select]
map:draw_square_ter(ter_str_id("t_grass"),0,0,23,23)

***

Same for `line_ter` and `line_furn` functions, which should be `draw_line_ter` and `draw_line_furn`.

***

Functions `ter_set`/`furn_set` takes `tripoint` and `ter_str_id`/`furn_str_id` as arguments, so it will be like this:

Code: [Select]
map:ter_set(tirpoint(16,10,0),ter_str_id("t_console"))
map:furn_set(tripoint(18,13,0),furn_str_id("f_indoor_plant"))

***

Function `game.rng` takes two `int` parameters.

***

It is possible to move script to external file:

Code: [Select]
        "script": [
          "dofile('./data/json/mapgen_lua/dojo.lua')"
        ]

***

When lua mapgen script is in external file it will also be easier to test it using LUA debug console and following command:

Code: [Select]
dofile('./data/json/mapgen_lua/dojo.lua')

***

Here is an example: https://www.dropbox.com/s/pm8rpd1bhkhu9f5/cdda_lua_mapgen_example.zip?dl=0

`dojo` building was replaced with your house using lua mapgen


***


Here is another example: https://www.dropbox.com/s/3gn2p4sgmt5gdmz/cdda_mapgen_mil_surplus.zip?dl=0

`mil_surplus` buidling using lua mapgen (don't mind excess amount of loot - i didn't add check for loot spawn chance yet )

9
It seems palettes will now be the same for all map chunks.

Code: [Select]
[
  {
    "type": "palette",
    "id": "national_guard_camp_palette",
    "terrain": {
        " ": "t_thconc_floor",
        "!": "t_metal_floor",
        "#": "t_thconc_floor",
        "$": "t_radio_tower",
        "%": "t_fence_barbed",
        "&": "t_gas_pump",
        "+": [
            "t_door_c",
            "t_door_c",
            "t_door_o",
            "t_door_locked",
            "t_door_locked_interior"
        ],
        ",": "t_pavement_y",
        "-": "t_brick_wall",
        ".": [
            "t_grass",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_grass",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_grass",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_grass",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_grass",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_grass",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_shrub"
        ],
        "0": "t_manhole_cover",
        "1": [
            "t_grass",
            "t_dirt",
            "t_dirt",
            "t_dirt",
            "t_dirt",
            "t_dirt"
        ],
        "2": [
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_shrub",
            "t_tree",
            "t_tree_young",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_shrub",
            "t_tree",
            "t_grass",
            "t_tree_dead"
        ],
        "3": [
            "t_grass",
            "t_dirt",
            "t_dirt",
            "t_dirt",
            "t_dirt"
        ],
        "5": "t_gates_control_brick",
        "6": "t_console_broken",
        "7": "t_machinery_electronic",
        "8": "t_dirtmound",
        "9": "t_door_metal_c",
        "<": "t_stairs_up",
        "=": "t_door_metal_locked",
        ">": "t_stairs_down",
        "A": "t_thconc_floor",
        "B": "t_thconc_floor",
        "C": "t_thconc_floor",
        "D": "t_thconc_floor",
        "E": "t_elevator",
        "F": "t_chainfence_v",
        "G": "t_reinforced_glass",
        "H": "t_sidewalk",
        "I": "t_column",
        "L": "t_thconc_floor",
        "M": "t_wall_metal",
        "O": "t_thconc_floor",
        "Q": "t_dirt",
        "R": "t_thconc_floor",
        "S": "t_thconc_floor",
        "T": "t_thconc_floor",
        "V": "t_thconc_floor",
        "W": "t_window",
        "X": "t_pavement",
        "Y": "t_dirt",
        "Z": "t_dirt",
        "^": [
            "t_utility_light",
            "t_utility_light",
            "t_utility_light",
            "t_sidewalk"
        ],
        "_": "t_pavement",
        "a": "t_pavement",
        "b": "t_thconc_floor",
        "c": "t_thconc_floor",
        "d": "t_thconc_floor",
        "e": "t_strconc_wall",
        "f": "t_chainfence_h",
        "g": "t_thconc_floor",
        "h": "t_thconc_floor",
        "i": "t_sidewalk",
        "m": "t_wall_metal",
        "o": "t_thconc_floor",
        "q": "t_thconc_floor",
        "r": "t_thconc_floor",
        "s": "t_sidewalk",
        "t": "t_thconc_floor",
        "u": "t_thconc_floor",
        "v": "t_thconc_floor",
        "w": [
            "t_window_domestic",
            "t_window_domestic",
            "t_curtains",
            "t_window_domestic",
            "t_window_domestic",
            "t_curtains",
            "t_window_frame"
        ],
        "y": "t_thconc_floor",
        "z": "t_dirt",
        "|": "t_brick_wall",
        "~": "t_rock"
    },
    "furniture": {
        "#": "f_indoor_plant",
        "A": "f_sofa",
        "B": "f_bed",
        "C": "f_cupboard",
        "D": "f_fridge",
        "H": "f_table",
        "L": "f_locker",
        "O": [
            "f_crate_c",
            "f_crate_c",
            "f_crate_o"
        ],
        "Q": "f_sandbag_half",
        "R": "f_exercise",
        "S": "f_sink",
        "T": "f_table",
        "V": "f_vending_c",
        "X": "f_tank_trap",
        "Y": "f_rubble",
        "Z": "f_ash",
        "a": "f_sandbag_half",
        "b": "f_bench",
        "c": "f_counter",
        "d": "f_desk",
        "g": "f_glass_fridge",
        "h": "f_chair",
        "i": "f_bench",
        "o": "f_bookcase",
        "q": "f_sandbag_half",
        "r": "f_rack",
        "t": "f_toilet",
        "u": "f_shower",
        "v": "f_oven",
        "y": "f_treadmill"
    }
  }
]

Using palettes and linting will make json 5 times smaller.

***

Edit:

Basement chunks are using differrent palette:

Code: [Select]
  {
    "type": "palette",
    "id": "national_guard_camp_b1_palette1",
    "terrain": {
        " ": "t_thconc_floor",
        "!": "t_metal_floor",
        "#": "t_thconc_floor",
        "$": "t_lava",
        "%": "t_fence_barbed",
        "&": "t_radio_tower",
        "(": "t_sewage",
        ")": "t_bars",
        "*": "t_potential_trans",
        "+": [
            "t_door_c",
            "t_door_c",
            "t_door_o",
            "t_door_locked",
            "t_door_locked_interior"
        ],
        ",": "t_pavement_y",
        "-": "t_brick_wall",
        ".": [
            "t_grass",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_grass",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_grass",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_grass",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_grass",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_grass",
            "t_grass",
            "t_grass",
            "t_dirt",
            "t_shrub"
        ],
        "0": "t_ladder_up",
        "1": "t_machinery_light",
        "2": "t_machinery_heavy",
        "3": "t_conveyor",
        "4": "t_station_disc",
        "5": "t_gates_control_concrete",
        "6": "t_console_broken",
        "7": "t_machinery_electronic",
        "8": "t_current_trans",
        "9": [
            "t_door_metal_c",
            "t_door_metal_c",
            "t_door_metal_o"
        ],
        "<": "t_stairs_up",
        "=": [
            "t_door_metal_c",
            "t_door_metal_locked",
            "t_door_metal_locked",
            "t_door_metal_locked"
        ],
        ">": "t_stairs_down",
        "@": "t_sai_box",
        "A": "t_thconc_floor",
        "B": "t_thconc_floor",
        "C": "t_thconc_floor",
        "D": "t_thconc_floor",
        "E": "t_elevator",
        "F": "t_chainfence_v",
        "G": "t_reinforced_glass",
        "H": "t_sidewalk",
        "I": "t_column",
        "J": "t_recycler",
        "K": "t_searth_test",
        "L": "t_thconc_floor",
        "M": "t_wall_metal",
        "N": "t_sewage_pipe",
        "O": "t_thconc_floor",
        "P": "t_centrifuge",
        "Q": "t_thconc_floor",
        "R": "t_thconc_floor",
        "S": "t_thconc_floor",
        "T": "t_thconc_floor",
        "U": "t_door_bar_locked",
        "V": "t_thconc_floor",
        "W": "t_window",
        "Y": "t_wall_glass",
        "Z": "t_rock_floor",
        "^": [
            "t_utility_light",
            "t_utility_light",
            "t_utility_light",
            "t_thconc_floor"
        ],
        "_": "t_pavement",
        "`": "t_rock_floor",
        "a": "t_thconc_floor",
        "b": "t_thconc_floor",
        "c": "t_thconc_floor",
        "d": "t_thconc_floor",
        "e": "t_strconc_wall",
        "f": "t_chainfence_h",
        "g": "t_thconc_floor",
        "h": "t_thconc_floor",
        "i": "t_sidewalk",
        "j": "t_missile",
        "k": "t_thconc_floor",
        "l": "t_water_dp",
        "m": "t_wall_metal",
        "n": "t_sewage_pump",
        "o": "t_thconc_floor",
        "p": "t_vat",
        "q": "t_thconc_floor",
        "r": "t_thconc_floor",
        "s": "t_sidewalk",
        "t": "t_thconc_floor",
        "u": "t_thconc_floor",
        "v": "t_thconc_floor",
        "w": [
            "t_window_domestic",
            "t_window_domestic",
            "t_curtains",
            "t_window_domestic",
            "t_window_domestic",
            "t_curtains",
            "t_window_frame"
        ],
        "y": "t_thconc_floor",
        "z": "t_thconc_floor",
        "|": "t_brick_wall",
        "~": "t_rock"
    },
    "furniture": {
        "#": "f_indoor_plant",
        "A": "f_sofa",
        "B": "f_bed",
        "C": "f_cupboard",
        "D": "f_fridge",
        "H": "f_table",
        "L": "f_locker",
        "O": [
            "f_crate_c",
            "f_crate_c",
            "f_crate_o"
        ],
        "Q": "f_standing_tank",
        "R": "f_exercise",
        "S": "f_sink",
        "T": "f_table",
        "V": "f_vending_c",
        "Z": "f_rubble",
        "a": "f_robotic_arm",
        "b": "f_bench",
        "c": "f_counter",
        "d": "f_desk",
        "g": "f_glass_fridge",
        "h": "f_chair",
        "i": "f_bench",
        "k": "f_mannequin",
        "o": "f_bookcase",
        "q": "f_sandbag_half",
        "r": "f_rack",
        "t": "f_toilet",
        "u": "f_shower",
        "v": "f_oven",
        "y": "f_treadmill",
        "z": "f_trashcan"
    }
  }

Following four basement chunks have small differences in terrain part of the palette ("=" symbol defines only "t_door_metal_locked", while most basement chunks have 1 in 4 chance to be "t_door_metal_c"):

national_guard_camp_b1_38
national_guard_camp_b1_51
national_guard_camp_b1_52
national_guard_camp_b1_95


Updated version is here: https://www.dropbox.com/s/iv2p72fi6k97a6k/National_Guard_Camp_Linted_And_UsedPalettes.zip?dl=0

10
None of these functions from catalua.cpp are exported to class_definitions.cpp - this is intended.

Code: [Select]
// Registry containing all the game functions exported to lua.
// -----------------------------------------------------------
static const struct luaL_Reg global_funcs [] = {
    {"register_iuse", game_register_iuse},
    //{"get_monsters", game_get_monsters},
    {"items_at", game_items_at},
    {"choose_adjacent", game_choose_adjacent},
    {"dofile", game_dofile},
    {"get_monster_types", game_get_monster_types},
    {"get_item_groups", game_get_item_groups},
    {NULL, NULL}
};

11
The Toolbox - Code Help / Re: Make a monster ract to being damaged?
« on: June 02, 2017, 08:13:47 AM »
There is an on_hurt function in player class:

Code: [Select]
/** Handles effects that happen when the player is damaged and aware of the fact. */
void on_hurt( Creature *source, bool disturb = true );

12
Lua mod that adds two atomic Rivtech tools (entity scanner and earthquake generator):

https://www.dropbox.com/s/yurzmmqtjhv0r98/ExtraTools_alpha.zip?dl=0

13
I've played a bit with the LUA: http://smf.cataclysmdda.com/index.php?topic=14542.msg300320#msg300320

Will that be enough to prevent LUA from being axed? :)

14
How do I get the launcher to stop replacing my version of PK's Rebalancing that I got from Github every time I update my game?

There is no easy way of doing this. The launcher assume that the mods provided by the base game are always better version than what was installed previously which might not be true for some mods like PK's.

I might have to add some way of preserving a mod. We previously had some talks about mod versioning. Maybe we could use that and compare versions too. It is a work in progress.
I'd say pisskop should change identifier of the mod.

15
1. Download archive https://www.dropbox.com/s/5vllfpns12i4gm3/LuaSandbox.zip?dl=0.
2. Unpack to mods folder.
3. Change absolute path to `LuaSandbox_test.lua`, `LuaSandbox_test2.lua` and `LuaSandbox_item_scanner.lua` files in `preload.lua`, so it will actually lead to the files in mods folder.

Code: [Select]
function iuse_luasandbox_test(item, active)

dofile ("C:\\Utils\\cdda\\data\\mods\\LuaSandbox\\LuaSandbox_test.lua")

end

function iuse_luasandbox_test2(item, active)

dofile ("C:\\Utils\\cdda\\data\\mods\\LuaSandbox\\LuaSandbox_test2.lua")

end

function iuse_luasandbox_item_scanner(item, active)

dofile ("C:\\Utils\\cdda\\data\\mods\\LuaSandbox\\LuaSandbox_item_scanner.lua")

end
game.register_iuse("IUSE_LUA_LUASANDBOX_TEST", iuse_luasandbox_test)
game.register_iuse("IUSE_LUA_LUASANDBOX_TEST2", iuse_luasandbox_test2)
game.register_iuse("IUSE_LUA_LUASANDBOX_ITEM_SCANNER", iuse_luasandbox_item_scanner)

4. Start game in new world with `LuaSandbox` mod enabled.
5. Go to debug menu and add `luasandbox_tester`, `luasandbox_tester2` and `luasandbox_item_scanner` items to your character.

6. Activate `luasandbox_tester` item to scan reality bubble and display menu with names, weights, volumes and coordinates of all items located in reality bubble. Selecting menu entry will teleport you on map to location of selected item.

7. Activate `luasandbox_tester2` item to scan player character inventory and display menu with names, weights, volumes and inventory position of all items located in player character inventory. Selecting menu entry will display popup with name of selected item.

8. Activate `luasandbox_item_scanner` to scan a part of reality bubble and display menu with names, weights, volumes and coordinates of all items located in reality bubble. Selecting menu entry will highlight selected items on map with `fd_laser`. It is also possible to highlight all found items. You can change values for `search mask` (LUA wildcards), `scan range` (better not try more than REALITY_BUBBLE/2=66) and `highlight` (fd_laser, fd_smoke, fd_fire, etc) in the options sub-menu.

N.B.:
Strangely, liquids contained in vehicle tanks (like gasoline and diesel) are counted as items located on the map.

Pages: [1] 2 3 ... 8