_g.script crashes the game.

User avatar
Diegtiarov
Trespasser
Posts: 52
Joined: 12 Nov 2015, 08:34
Contact:

_g.script crashes the game.

Postby Diegtiarov » 12 Jul 2017, 10:09

Yo.

I noticed that _g.script crashes the game whenever the game uses custom factions and has DEACTIVATE_SIM_ON_NON_LINKED_LEVELS paremeter set false.
Everything works rock solid while linking all levels together manually via other file. It always crashes in the same line in smart_terrain.script.

Leaving the files and a screenshot; unedited 1.4.22 smart_terrain.script inside.
You do not have the required permissions to view the files attached to this post.

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1371
Joined: 26 May 2012, 22:26

Re: _g.script crashes the game.

Postby Alundaio » 12 Jul 2017, 13:17

self.props.base is nil for the smart terrain, which should not occur. Could be a script error or you forgot to add or inherit the base prop in simulation_objects_props.ltx which would be unlikely if you are using purely vanilla smarts in coc.

I see a few things wrong in sim_board though:


Code: Select all

local bandit = "bandit" or "bandit_novice" or "bandit_advanced" or "bandit_veteran"
local dolg = "dolg" or "dolg_novice" or "dolg_advanced" or "dolg_veteran"
local freedom = "freedom" or "freedom_novice" or "freedom_advanced" or "freedom_veteran"
local killer = "killer" or "killer_novice" or "killer_advanced" or "killer_veteran"
local army = "army" or "army_novice" or "army_advanced" or "army_veteran" or "army_patrol"
local monolith = "monolith" or "monolith_novice" or "monolith_advanced" or "monolith_veteran" or "monolith_patrol"
local stalker = "stalker" or "stalker_novice" or "stalker_advanced" or "stalker_veteran"
local csky = "csky" or "csky_novice" or "csky_advanced" or "csky_veteran"
local ecolog = "ecolog"

local monster_day = "monster_flesh" or "monster_boar" or "monster_mix_boar_flesh" or "monster_cat" or "monster_dog" or "monster_mix_dogs" or "monster_pseudodog" or "monster_izlom" or "monster_zombie" or "monster_snork" or "monster_poltergeist" or "monster_controller" or "monster_burer" or "monster_gigant" or "monster_tushkano"
local monster_night = "monster_psydog" or "monster_borya" or "monster_bloodsucker" or "monster_psybloodsucker" or "monster_psycontroller" or "monster_chimera" or "monster_rat"


'or' is used for conditionals. Basically the value that is not nil or false will occur.

Code: Select all

local bandit = "bandit" or "bandit_novice" or "bandit_advanced" or "bandit_veteran"

Will always equal "bandit"

If you want a variable to hold different values then you need to make a hash table like:

Code: Select all

local dolg = { ["dolg"] = true,["dolg_novice"] = true }


Then check it with:

Code: Select all

if dolg[squad.player_id] == true then



Also keep in mind if you are adding new squad behavior types you need to add them to simulation_objects_props.ltx which can be overwhelming with that amount of new behaviors. And honestly there is not much point in having more then what is already there, like what was done in Misery and M.S.O.

Adding new communities or factions doesn't require you to add them to squad behaviors. These are just specific to what squads do when they are offline. It goes by "faction" field in the squad descriptions. This field doesn't have to reflect the actual faction of the npcs in the squad. So what you are doing isn't necessary.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

User avatar
Diegtiarov
Trespasser
Posts: 52
Joined: 12 Nov 2015, 08:34
Contact:

Re: _g.script crashes the game.

Postby Diegtiarov » 12 Jul 2017, 13:38

If you want a variable to hold different values then you need to make a hash table like:

Code: Select all

local dolg = { ["dolg"] = true,["dolg_novice"] = true }



Then check it with:

Code: Select all

if dolg[squad.player_id] == true then


Will do.
Squads are moving around the map normally, though (while linking levels via simulation_objects.ltx and not enabling full sim in _g.script).


Also keep in mind if you are adding new squad behavior types you need to add them to simulation_objects_props.ltx which can be overwhelming with that amount of new behaviors. And honestly there is not much point in having more then what is already there, like what was done in Misery and M.S.O.


That's why I've sent more than just _g.script in the packed folder. That thing was done way before editing scripts.


Adding new communities or factions doesn't require you to add them to squad behaviors. These are just specific to what squads do when they are offline. It goes by "faction" field in the squad descriptions. This field doesn't have to reflect the actual faction of the npcs in the squad. So what you are doing isn't necessary.


bind_monster.script was crashing like hell while releasing body -or was it creating a corpse and releasing the body only for poltergeist- (object's ID is nil) until I added these to behaviors.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest

cron