Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 08/25/20 19:08

kozo
Member
Registered: 08/25/20

PNJ does not attack with command ai2_attack

Hi guys

I'm starting to learn how to use dev mode and scripts I got spawn a pnj and another one now I would like him to attack each other but it doesn't work I tried with the command ai2_attack civ_victim_1 civ_victim_11 he looks at himself but doesn't face each other How to do it ? Thanks again

Offline

#2 08/25/20 20:08

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: PNJ does not attack with command ai2_attack

Welcome.  Sorry, but I don't know what a PNJ is.  Your command sounds like it should work, though.  Maybe the AIs are not active for some reason, or maybe their team matters.  Someone else here might be able to help with this.


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#3 08/26/20 03:08

s10k
Member
Registered: 01/14/07
Website

Re: PNJ does not attack with command ai2_attack

Try changing both to different teams using chr_changeteam, then do the ai2_attack.

Offline

#4 08/26/20 10:08

kozo
Member
Registered: 08/25/20

Re: PNJ does not attack with command ai2_attack

Thank you for your answers

So I tried with (chr_changeteam civ_victim_1 Syndicate) it doesn't work, I made a mistake in the commande or is it ok? I also give a weapon to the pnj I tried the command ai2_attack (civ_victim_1 civ_victim_11) but it doesn't even attack with a weapon, does the weapon have ammunition inside or not ?,

Offline

#5 08/26/20 12:08

s10k
Member
Registered: 01/14/07
Website

Re: PNJ does not attack with command ai2_attack

If you give a weapon it should have ammo. Can you make a video of what are you doing? It will be easier to help you.

Offline

#6 08/26/20 13:08

paradox-01
Member
From: Germany
Registered: 01/14/07

Re: PNJ does not attack with command ai2_attack

Presumably you are talking about civ_victim_1 and civ_victim_11 from level 4?

If I remember correctly, civ (civilians) aren't supposed to fight. They cannot.
So you would have to A) take other characters or B) do a few modifications on the civ characters.

For case B you would do this:

- Work through XML tutorial: https://wiki.oni2.net/XML:Basic_tutorial
- For some extra read up: https://wiki.oni2.net/XML:BINA/OBJC/CHAR
- Do actual modifications on level4's CHAR file in Oni\AE\GameDataFolder\level4_Final
-- Remove NonCombatant from <OSD><Flags>
-- Change the Job tag (if necessary) to ...
                <Job>
                    <Type>None</Type>
                    <PatrolPathId>0</PatrolPathId>
                </Job>
- put the modification into a package: https://wiki.oni2.net/Making_a_mod_package
-- if that is too difficult use an existing package but with a level 4 folder to it
--- Oni\AE\AEInstaller\packages\24100HD_Training_Room_Textures\oni\level4_Final

Last edited by paradox-01 (08/27/20 06:08)

Offline

#7 08/26/20 15:08

kozo
Member
Registered: 08/25/20

Re: PNJ does not attack with command ai2_attack

I can't send links I'm not authorized, I just made exactly the commands but here's how the NPC with his weapon (civ_victim_1) doesn't attack civ_victim_11 I also made the command chr_changeteam on civ_victim_1 but when I display the report on the NPC it puts me "neutral". here's how I proceed:

-ai2 spawn civ_victim_11
-ai2_comehere civ_victim_11
-chr_changeteam civ_victim_1
-chr_giveweapon civ_victim_1 (name of the weapon)
-ai2_attack civ_victim_1 civ_victim_11 1

Offline

#8 08/26/20 15:08

s10k
Member
Registered: 01/14/07
Website

Re: PNJ does not attack with command ai2_attack

Paradox gave me an idea maybe you can try the commands here:
ai2_neutralbehavior [ai_name:string | script_id:int] behavior:string - sets up an AI's neutral-interaction - ai2_neutralbehavior neutral_3 none
ai2_noncombatant [ai_name:string | script_id:int] non_combatant:int{0 | 1} - sets or clears an AI's non-combatant state - ai2_noncombatant A1_intro01 1
ai2_panic [ai_name:string | script_id:int] timer:int - makes an AI panic or not panic - ai2_panic A1_s_red02 300

Especially the ai2_noncombatant try set it to 0 to civ_victim_11.

You can post links if you remove the "http" part.

Offline

#9 08/26/20 16:08

kozo
Member
Registered: 08/25/20

Re: PNJ does not attack with command ai2_attack

Okay, thank you if I understand correctly:

ai2_neutral behavior civ_victim_1 none
ai2_noncombatant civ_victim_1 1
ai2_panic civ_victim_1 300

The problem is that when I type the ai2_panic command, the game crashes.

youtu.be/7-JAQV0iwYs

Here's a video I made to show you how I proceed or, worse, if it doesn't work, I do what paradox has sent .

Last edited by kozo (08/26/20 16:08)

Offline

#10 08/27/20 08:08

s10k
Member
Registered: 01/14/07
Website

Re: PNJ does not attack with command ai2_attack

Try
ai2_noncombatant civ_victim_1 0
.

Offline

Board footer

Powered by FluxBB