StalkerSoup
StalkerSoup
Would you like to react to this message? Create an account in a few clicks or log in to continue.


The official StalkerSoup forum
 
HomeRegisterLog in
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Latest topics
» Defend the Bar crash
[SOLVED] Crash when using bandage + medkit Icon_minitimeby Jowien Thu 16 May 2024 - 16:32

» Problem with RG6 and Kalmyak
[SOLVED] Crash when using bandage + medkit Icon_minitimeby Zetsuchini Mon 13 May 2024 - 15:37

» Starting directly at Collector mode
[SOLVED] Crash when using bandage + medkit Icon_minitimeby Sword2012 Sun 12 May 2024 - 4:55

» First Person Weapon Models and Strelok AK Texture
[SOLVED] Crash when using bandage + medkit Icon_minitimeby TrueB Mon 6 May 2024 - 19:10

» Is StalkerSoup completed?
[SOLVED] Crash when using bandage + medkit Icon_minitimeby Sword2012 Tue 30 Apr 2024 - 2:48

» A walk through StalkerSoup...
[SOLVED] Crash when using bandage + medkit Icon_minitimeby Jowien Tue 16 Apr 2024 - 2:08

» Yakut does not give a dialog pt.2
[SOLVED] Crash when using bandage + medkit Icon_minitimeby SPEC Sat 13 Apr 2024 - 15:32

» Vanilla graphics addon? And maybe a better hitmarker?
[SOLVED] Crash when using bandage + medkit Icon_minitimeby DUCATISLO Mon 8 Apr 2024 - 17:03

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendarCalendar
Top posting users this week
No user
Statistics
We have 1750 registered users
The newest registered user is atst1

Our users have posted a total of 12554 messages in 1752 subjects
Who is online?
In total there is 1 user online :: 0 Registered, 0 Hidden and 1 Guest

None

Most users ever online was 254 on Thu 8 Apr 2021 - 17:10

 

 [SOLVED] Crash when using bandage + medkit

Go down 
4 posters
AuthorMessage
Semtex
Novice



Posts : 12
Join date : 2021-04-23

[SOLVED] Crash when using bandage + medkit Empty
PostSubject: [SOLVED] Crash when using bandage + medkit   [SOLVED] Crash when using bandage + medkit Icon_minitimeTue 7 Feb 2023 - 0:16

Hi there,

I have instant CTD every time I use a bandage then a medkit.

Here is the stack trace:

FATAL ERROR
 
[error]Expression    : fatal error
[error]Function      : CScriptEngine::lua_error
[error]File          : E:\stalker\sources\trunk\xr_3da\xrGame\script_engine.cpp
[error]Line          : 73
[error]Description   : <no expression>
[error]Arguments     : LUA error: ...es\stalkersoup\gamedata\scripts\dmx_medicines.script:167: attempt to perform arithmetic on upvalue 'act_health' (a nil value)
 

stack trace:

Can anyone help me on this?
thx
--------------------------------------------------------------------------------------

RESPONSE from nekomaster:

I found the culprit, when you deactivate the "dmx_hide_weapon" option in modder's script, this makes the function "medical_hide_wpn" in dmx_medicines.script crash because lines 151 and 243 are commented.

The function need to be like that to prevent crashes:

Code:
function medical_hide_wpn(obj_section)
 if dmx_hide_weapon == true then --110019 // HERE, REMOVE THE "--" AT THE START OF THIS LINE
 if not (has_alife_info("advanced_outfit_used") or has_alife_info("bar_arena_fight")) then
 --utils.info_msg("2", script_name(), "medical_hide_wpn:", "act_health value: "..utils.ToString(act_health))
 if food_tabl[obj_section] then
 dmx_medical_hide_wpn(5)
 elseif drink_tabl[obj_section] then
 dmx_medical_hide_wpn(4)
 elseif medical_tabl[obj_section] then --110017.1
 if obj_section == "medkit" then
 if not has_alife_info("actor_medkit_use_info") then
 --amk.start_timer("actor_medkit_use_timer", 3, "")
 --tb3d_services.give_info("actor_medkit_use_info")
 act_health = db.actor.health
 dmx_medical_hide_wpn(6)
 medical_show_hud()
 else
 db.actor.health = act_health - 0.48 --110020 - aleks1970
 --utils.info_msg("3", script_name(), "medical_hide_wpn: medkit", "db.actor.health value: "..utils.ToString(db.actor.health))
 amk.spawn_item_in_inv("medkit")
 news_manager.send_tip(act, "medic_not_finished", nil, "medic_icon", 16000)
 end
 elseif obj_section == "medkit_army" then
 if not has_alife_info("actor_medkit_use_info") then
 --amk.start_timer("actor_medkit_use_timer", 8, "")
 --tb3d_services.give_info("actor_medkit_use_info")
 act_health = db.actor.health
 dmx_medical_hide_wpn(8)
 medical_show_hud()
 else
 db.actor.health = act_health - 0.70 --110020 - aleks1970
 amk.spawn_item_in_inv("medkit_army")
 news_manager.send_tip(act, "medic_can_overdose", nil, "medic_icon", 16000)
 end
 elseif obj_section == "medkit_scientic" then
 if not has_alife_info("actor_medkit_use_info") then
 --amk.start_timer("actor_medkit_use_timer", 7, "")
 --tb3d_services.give_info("actor_medkit_use_info")
 act_health = db.actor.health
 dmx_medical_hide_wpn(11)
 medical_show_hud()
 else
 --db.actor.health = act_health - 0.75 --110020 - aleks1970
 amk.spawn_item_in_inv("medkit_scientic")
 news_manager.send_tip(act, "medic_can_overdose", nil, "medic_icon", 16000)
 end
 elseif obj_section == "suvorotka" then
 if not has_alife_info("actor_medkit_use_info") then
 --amk.start_timer("actor_medkit_use_timer", 10, "")
 --tb3d_services.give_info("actor_medkit_use_info")
 act_health = db.actor.health
 dmx_medical_hide_wpn(14)
 medical_show_hud()
 else
 --db.actor.health = act_health - 0.95 --110020 - aleks1970
 --utils.info_msg("3", script_name(), "medical_hide_wpn: suvorotka", "db.actor.health value: "..utils.ToString(db.actor.health))
 amk.spawn_item_in_inv("suvorotka")
 news_manager.send_tip(act, "medic_can_overdose", nil, "medic_icon", 16000)
 end
 elseif obj_section == "medkit_elite" then
 if not has_alife_info("actor_medkit_use_info") then
 --amk.start_timer("actor_medkit_use_timer", 10, "")
 --tb3d_services.give_info("actor_medkit_use_info")
 act_health = db.actor.health
 dmx_medical_hide_wpn(18)
 medical_show_hud()
 else
 --db.actor.health = act_health - 0.95 --110020 - aleks1970
 amk.spawn_item_in_inv("medkit_elite")
 news_manager.send_tip(act, "medic_can_overdose", nil, "medic_icon", 16000)
 end
 elseif obj_section == "morphine" then --110016
 if not has_alife_info("actor_medkit_use_info") then
 --amk.start_timer("actor_medkit_use_timer", 10, "")
 --tb3d_services.give_info("actor_medkit_use_info")
 act_health = db.actor.health
 dmx_medical_hide_wpn(10)
 medical_show_hud()
 else
 db.actor.health = act_health - 0.76 --110020 - aleks1970
 amk.spawn_item_in_inv("morphine")
 news_manager.send_tip(act, "medic_can_overdose", nil, "medic_icon", 16000)
 end
 end
 elseif mini_medical_tabl[obj_section] then
 dmx_medical_hide_wpn(6) --110020 - aleks1970
 medical_show_hud()
 end
 else
 if has_alife_info("actor_medkit_use_info") then tb3d_services.remove_info("actor_medkit_use_info") end
 hud:RemoveCustomStatic("medkit_static") --110020 - aleks1970
 dmx_medical_hide_wpn(0) --110019.1
 end
 end -- // HERE, REMOVE THE "--" AT THE START OF THIS LINE
end



EDIT from nekomaster: So using those changes I'm STILL having this crash/error when I use bandages and then a medkit right after

Code:

FATAL ERROR
 
[error]Expression    : fatal error
[error]Function      : CScriptEngine::lua_error
[error]File          : E:\stalker\sources\trunk\xr_3da\xrGame\script_engine.cpp
[error]Line          : 73
[error]Description   : <no expression>
[error]Arguments     : LUA error: ... - stalkersoup\gamedata\scripts\dmx_medicines.script:167: attempt to perform arithmetic on upvalue 'act_health' (a nil value)
 

stack trace:

I copied and pasted the code-snippet from the first post and replaced the exact same section in my dmx_medicines.script just so I dont miss anything and yeah it still crashes for me with the same error that the first post was complaining about and suppossedly fixed.



EDIT from nekomaster: For now I commented out these lines...
Code:
db.actor.health = act_health - 0.xx

(where xx = the value)

...aaaaand the game functions fine without them!

Just means that now the warnings in the news will always appear regardless of the player/actors health but I think this is a fair trade off to have stuff work.

Either way in the end using medkits or morphine works and hides weapons without issue or crashes 😊

(I think I managed to solve my issue with my own code tweaks lol)
Back to top Go down
Sword2012
Administrator
Sword2012


Posts : 1241
Join date : 2017-05-31
Location : UK

[SOLVED] Crash when using bandage + medkit Empty
PostSubject: Re: [SOLVED] Crash when using bandage + medkit   [SOLVED] Crash when using bandage + medkit Icon_minitimeSun 9 Jul 2023 - 15:42

My apologies, but in editing the above post for conciseness, I inadvertently sent it back in time to last February...  Rolling Eyes

This combined post from Semtex, with a very useful fix from nekomaster, should be dated today


Last edited by Sword2012 on Sun 9 Jul 2023 - 18:49; edited 5 times in total (Reason for editing : Trying to do a relatively simple job while tired...)
Back to top Go down
nekomaster
Novice
nekomaster


Posts : 16
Join date : 2021-02-13

[SOLVED] Crash when using bandage + medkit Empty
PostSubject: Re: [SOLVED] Crash when using bandage + medkit   [SOLVED] Crash when using bandage + medkit Icon_minitimeSun 9 Jul 2023 - 15:44

Sword2012 wrote:
My apologies, but in editing the above post for conciseness, I inadvertently sent it back in time to last February...  Rolling Eyes

This combined post from Semtex, with a very useful fix from nekomaster, should be dated today

Enh, either way, so long as people can find the fix, which ever works, is what counts in the end.

I'm just glad my hack works (at least for myself)
Back to top Go down
Hydralisk
Novice
Hydralisk


Posts : 15
Join date : 2018-10-07
Location : Poland

[SOLVED] Crash when using bandage + medkit Empty
PostSubject: Re: [SOLVED] Crash when using bandage + medkit   [SOLVED] Crash when using bandage + medkit Icon_minitimeTue 29 Aug 2023 - 16:31

I have the same issue, however I don't have the dmx_medicines.script file and I'm not sure how to get a hold of it. I tried to extract it from the game files but all I got was a garbled mess of missing characters.
Back to top Go down
Sponsored content





[SOLVED] Crash when using bandage + medkit Empty
PostSubject: Re: [SOLVED] Crash when using bandage + medkit   [SOLVED] Crash when using bandage + medkit Icon_minitime

Back to top Go down
 
[SOLVED] Crash when using bandage + medkit
Back to top 
Page 1 of 1
 Similar topics
-
» [solved]Ivaschenko Parcel
» Crash on launching...
» Zaton crash
» Yantar Crash
» Defend the Bar crash

Permissions in this forum:You cannot reply to topics in this forum
StalkerSoup :: StalkerSoup main discussions-
Jump to: