NPC use grenade launchers 1.0 for 1.5.2 addon - S.T.A.L.K.E.R. Anomaly mod for S.T.A.L.K.E.R.: Call of Pripyat (2024)

DemocracyWithWar! - Jun 9 2024 - 314 comments

"Also as a small bonus - NPCs can panic (a behavior pattern not used in the original, in which the NPC, instead of attacking the enemy, screams and runs away as far as possible), this behavior is more typical for newbies\rookies who can be afraid of bandits, bloodsuckers, etc., veterans and masters are not afraid of anyone or anything."

Straight must-have mod

Reply Good karma Bad karma+11 votes

Folk0204 - Jun 9 2024 - 121 comments

will install it and see how it works, 10/10 just by this great innovation <3

Reply Good karma Bad karma+1 vote

MangAsar - Jun 9 2024 - 189 comments

Great idea. Gonna test it. Just one concern. The small bonus which is NPCs can panic. Would it not interfere with the mod NPC fleeing? I am using that mod and I think they function a bit similarly. What if I'd prefer that one over the bonus here, what would I do? Can you make this bonus an optional install? Thanks

Reply Good karma Bad karma+10 votes

Author

vlad8599 - Jun 10 2024 - 46 comments

It has not been tested, but nothing should break. Original panic unused scheme just gives NPC chance to scare from some mutants and run away depending on NPC rank, nothing more, nothing less.

Reply Good karma+2 votes

space_kirill - Jun 10 2024 - 31 comments

Привет, вынеси мод на панику за пределы геймдаты, он во первых есть в моддб во вторых не нужно одного с другим смешивать.

Reply Good karma Bad karma+2 votes

totsamy911 - Jun 10 2024 - 5 comments

Nice!

Reply Good karma Bad karma+1 vote

Guest - Jun 10 2024 - 695,085 comments

нпс действительно не могли использовать подстволки, но рпг-7 могли. и да, лучше вырезать фичу паники, для этого точно есть другой аддон

Reply Good karma Bad karma+1 vote

Bamah - Jun 10 2024 - 257 comments

Just comment out the panic scheme in modules.script

Reply Good karma Bad karma+2 votes

Guest - Jun 10 2024 - 695,085 comments

maaam, thank you so much!

Reply Good karma Bad karma+1 vote

gar2 - Jun 10 2024 - 48 comments

Wait what do you mean?

Reply Good karma Bad karma+1 vote

rymbaikupar - Jun 10 2024 - 24 comments

They actually use rpg7... The monolith killed me with it when i increased rewards from doing work

Reply Good karma Bad karma+1 vote

Author

vlad8599 - Jun 10 2024 - 46 comments

Этот мод все еще тестируется, спасибо за ваши отзывы, но просьба написать, поменялось ли ведение боя у НПС. Когда сделаю еще одну версию - учту ваши замечания.

This mod is still being tested, thanks for your feedback, but please write if the NPC combat has changed. When I will make another version, I will create it, taking your opinions too.

Reply Good karma+3 votes

Guest - Jun 10 2024 - 695,085 comments

NPCs already use rpgs and grenade launchers, even underbarrel ones. Although you have to manually switch to the underbarrel grenade launcher yourself and give them it. Their aim sucks like and they only manage to fire the grenades like 10ft.

What would be nice is if they could automatically switch between grenades and bullets and maybe have better aim.

Reply Good karma Bad karma+1 vote

wakiwacky021 - Jun 10 2024 - 1 comments

Can you port more AI addition schemes? NPC AI is kinda lacking rn

Reply Good karma Bad karma+1 vote

baracuda12121989 - Jun 11 2024 - 4 comments

Поделюсь набледениями. С обычными НПС еще не сталкивался у которых были бы подствольники, но компаньоны ведут себя интересно. Для теста набрал 6 компаньонов разного ранга от новичка до мастера и каждому выдал различные виды АК с заряженными подствольниками и гранатами. Теперь к делу, если в момент передачи оружия компаньону в руках ГГ был выбран режим стрельбы подствольником, то абсолютно все напарники стреляют только гранатами(красиво, понравилось:-) жаль они не щадят никого и даже ГГ досталось). Забрал у всех стволы, перевёл в режим стрельбы патронами и вернул обратно, после этого стали стрелять только как обычно, хотя подствольные гранатомёты заряжены и в инвентаре у них так же есть гранаты. Конфликтующих и перезаписывающихся модов нет, вылетов так же нет. Мод установлен и включен последним. С РГ-6 не пробовал, но думаю так же если зарядить и выдать, стрелять начнут.

Reply Good karma Bad karma+2 votes

Author

vlad8599 - Jun 11 2024 - 46 comments

Аддону требуется доработка. Я по собственной неопытности взял не все необходимое из оригинального AI Additions, далее буду пробовать перенести схему для переключения с автомата и обратно. Но не в ближайшее время, сейчас я устал.

Reply Good karma+2 votes

Bamah - Jun 12 2024 - 257 comments

I have the NPCs launching fine in CoC.
The difference between the two are Anomaly broke up the utils into three different scripts.
Well... that my issue. I haven't got back to it yet.

Look at stage 4 launch. This is the launch stage. You are referencing
"st.charged = rx_ai.save_var(npc,"gl_charged",false)" this script is not in the game data.

There is no self.st.charged so, it will not fire. That's why players are arming the npcs launchers.

There are errors in the log pertaining to the scripts included. ff.script is not loading due to syntax error.
so the scheme does not exist.
rx_gl.script also has syntax errors.
Trying to help!

I uploaded my attempt so you can look at it...it may help. It includes some backups of different things I was trying...ran out of enthusiasm at the time. I got rid of the circle crash in CoC and went from there.

Anyone is most welcome to try!
Drive.google.com

Edit: the "rx_gl - 2019 GunMod" that script works in CoC.

Reply Good karma Bad karma+3 votes

Author

vlad8599 - Jun 12 2024 - 46 comments

Thank you a lot! To be honest, I dont have files of CoC, so I used some scripts from original mod for CoP, and trying to adapt it.

rx_ff is not necessary file, but it was in Anomaly resources too. Thats a scheme to prevent NPC firing if there is alliaces on fire line.

Reply Good karma+2 votes

Bamah - Jun 12 2024 - 257 comments

I deactivated the friendly fire function in the GL script. I was reducing conditions to fix my vector issue. In the gl script;
--if (_G.schemes["rx_ff"]) then
-- temp.action[evid_gl_reload]:add_precondition(world_property(rx_ff.evaid,false))
--end

I also removed is wounded condition.

Reply Good karma Bad karma+2 votes

Author

vlad8599 - Jun 12 2024 - 46 comments

Thank you for your help, its very important. Its sad to say, but in Anomaly 1.5.2 your script makes game crashing. Here is an error.

FATAL ERROR

[error]Expression : <no expression>
[error]Function : CScriptEngine::lua_pcall_failed
[error]File : D:\a\xray-monolith\xray-monolith\src\xrServerEntities\script_engine.cpp
[error]Line : 262
[error]Description : fatal error
[error]Arguments :
1 : [Lua] e:/s.t.a.l.k.e.r. anomaly\gamedata\scripts\rx_gl.script(218) :

LUA error: e:/s.t.a.l.k.e.r. anomaly\gamedata\scripts\rx_gl.script:218: attempt to call field 'get_vertex' (a nil value)

Check log for details

stack trace:

! [LUA] 0 : [C ] get_vertex
! [LUA] 1 : [Lua] e:/s.t.a.l.k.e.r. anomaly\gamedata\scripts\rx_gl.script(218) :

I changed a two wrong references to file alu_gl.get_vertex to correct alun_utils.get_vertex, but its still keep crashing with same error.

Can you be so kind and see, if you can prevent this from happening in Anomaly 1.5.2, when you will have some free time?

Reply Good karma+1 vote

Bamah - Jun 12 2024 - 257 comments

sorry, forgot a script download version 2

missing; alu_gl.script

Drive.google.com

Look in the console log when an npc has a gl.
You should see stages being written

Edit: the backups of rx_gl.script do not need the alu_gl.script.
I added that script to isolate the get vertex to experiment.
Actually I'm going back to the oldest backup script and removing the alu_gl.

Reply Good karma Bad karma+2 votes

Author

vlad8599 - Jun 12 2024 - 46 comments

BTW, I could use some more help, if you dont mind. Any ideas how to make NPC change fire modes? I can send you in DM or here on Google old original script that controls weapons and fire modes choose by NPC and includes also grenade launchers as fire mode, but I have no idea how to implement this script to Anomaly - there is no more script to control weapon choice in game resources.

Reply Good karma+2 votes

Bamah - Jun 12 2024 - 257 comments

From memory for this to work "function action_launch_grenade:execute()"
Stages 0-4 must work.
Found target
Create the test shell
Check victim (launch position)
Aim
Launch

Make sure all stages print to log so you can follow the scheme to completion and check the error log to make sure your scripts are loading. Syntax mistake will prevent loading.

You need to make sure it is first creating a test shell.
In your binders for configuring NPC acti configure_actions

This stuff would be at the top of your script. The binders setups and preconditions at the bottom.
evid_gl_fire = 18801
evid_gl_reload = evid_gl_fire+1
actid_gl_fire = evid_gl_fire
actid_gl_reload = evid_gl_reload

Reply Good karma Bad karma+2 votes

Author

vlad8599 - Jun 12 2024 - 46 comments

I am using your scripts from Google drive, with very small edit that I mentioned, with Anomaly 1.5.2. Thats causing a crash. it says about not found sections for ammo m209_bad and m209_verybad, but this is not whats causing crash, its all about nill value in function get_vertex. How can I fix this? Or maybe you can change this?

Reply Good karma+1 vote

Bamah - Jun 12 2024 - 257 comments

Helping you gave me some incite on mine. I'll post back when I overcome the issue. BTW no ctds.

My issue is; the target NPC is not accessible, so cannot get a vertex.

Reply Good karma Bad karma+2 votes

Bamah - Jun 12 2024 - 257 comments

Mine is not crashing. In the log it is stating it cannot find a valid vertex, so npc is not considered accessible. Therefore no launch!

That was my problem prior when I was working on it. No CTDs.
Edit: I'm going to adapt ur script and see if I can get past that error

Reply Good karma Bad karma+2 votes

Author

vlad8599 - Jun 12 2024 - 46 comments

Are you also working with Anomaly 1.5.2? its pretty strange, because I didnt changed anything except that twolines in yout script.

Reply Good karma+1 vote

Bamah - Jun 12 2024 - 257 comments

Yes Anomaly 1.5.2. .
Did you add the bad and very bad grenade ammo test shells to the base ammo when you did your initial mod?

Reply Good karma Bad karma+1 vote

Author

vlad8599 - Jun 12 2024 - 46 comments

I didnt. I just taked the ready script and changed it a little. Where I can find this list? And do you think that this can cause a crash?

Reply Good karma+1 vote

Bamah - Jun 12 2024 - 257 comments

in base.ltx in weapons add the RX_GL stuff.

[gl_test_shell_ammo_vog-25]:gl_test_shell
visual = grenadier\ammo_vog-25.ogf
[gl_test_shell_ammo_vog-25p]:gl_test_shell
visual = grenadier\ammo_vog-25p.ogf
[gl_test_shell_ammo_m209]:gl_test_shell
visual = grenadier\ammo_m209.ogf

;--Added for RX_GL-----------------------------------------------------
[gl_test_shell_ammo_vog-25_bad]:gl_test_shell
visual = grenadier\ammo_vog-25.ogf
[gl_test_shell_ammo_vog-25_verybad]:gl_test_shell
visual = grenadier\ammo_vog-25.ogf

[gl_test_shell_ammo_m209_bad]:gl_test_shell
visual = grenadier\ammo_m209.ogf
[gl_test_shell_ammo_m209_verybad]:gl_test_shell
visual = grenadier\ammo_m209.ogf
;-----------------------------------------------------------------------

Can you link me the Rulix stuff you are porting...please

Reply Good karma Bad karma+1 vote

Author

vlad8599 - 14hours ago - 46 comments

Just tried to do this. It did nothing, game is still crashing with same log. I will try to do one little thing now...

Yes, a link, one minute... But because of my stupidity I am first was using mod for original CoP.

Playground.ru

Reply Good karma+1 vote

Author

vlad8599 - 14hours ago - 46 comments

Okay, my test was a failure. I commented out those string -local vid = alun_utils.get_vertex(self.st.target,math.random(3,5)), and next string is now self.target_point = self.st.target:position()

I believe, it was a strings to fire at covered enemy, but I am not sure.

Game doesnt crashing anymore, BUT NPC now doing everything that he can and every time they cancel launching grenades, according to log. Every time its looking like that:

evl[Никита Гнилой]:shell ammo_m209
launch[Никита Гнилой]:action
launch[Никита Гнилой]:stage 0
launch[Никита Гнилой]:action
launch[Никита Гнилой]:stage 1
cancel[Никита Гнилой]
launch[Никита Гнилой]:finalize action_launch_grenade
Time continual is:26450

Do you have any ideas how to fix that? Maybe we can chat in Discord to make everything faster?

Reply Good karma+1 vote

Bamah - 11hours ago - 257 comments

They are cancelling because the the ammo is absent, and they are not charging the GL. Tie function will then self cancel.
I changed the function to charge the launcher regardless, and it just goes to infinity without firing.

Check your log for ~ STACK TRACEBACK:
You may find a reason.

I changed this from self.target to
local vid = npc:center()

I think both are problems, is the NPC with the launcher is not finalizing due to targeting, so NPC will not charge launcher if no valid target.
I disabled FF, smart covers, is_wounded, still no launch. I think it goes back to get_vector. Something is missing for Anomaly to find the NPC's target.

Out of time for today...sorry.
One more thing. Your port requires rx_ai.script functions. The script you are using is looking for rx_ai a lot.

ASSERTX is needed it's in RX_addons

Reply Good karma Bad karma+2 votes

Author

vlad8599 - 10hours ago - 46 comments

Yeah, I already see that it requires rx_ai addon. But better to work with your version. Seems to be a problem while aiming, for some reason Anomaly cant correctly use function get_vertex from your files, but if I am not using it, NPC with GL cant aim at enemy. Anyway thank you for your help. Maybe some other day we can chat and see, if its possible to fix. My Discord nickname is "examon"(no""), feel free to message me if you want.

Reply Good karma+1 vote

NPC use grenade launchers 1.0 for 1.5.2 addon - S.T.A.L.K.E.R. Anomaly mod for S.T.A.L.K.E.R.: Call of Pripyat (2024)
Top Articles
Latest Posts
Article information

Author: Merrill Bechtelar CPA

Last Updated:

Views: 6216

Rating: 5 / 5 (70 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Merrill Bechtelar CPA

Birthday: 1996-05-19

Address: Apt. 114 873 White Lodge, Libbyfurt, CA 93006

Phone: +5983010455207

Job: Legacy Representative

Hobby: Blacksmithing, Urban exploration, Sudoku, Slacklining, Creative writing, Community, Letterboxing

Introduction: My name is Merrill Bechtelar CPA, I am a clean, agreeable, glorious, magnificent, witty, enchanting, comfortable person who loves writing and wants to share my knowledge and understanding with you.