Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 12/10/07 20:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Follow?

Is it possible to make an AI follow you (with minimal coding)?

Or will simply spawning a friendly AI be enough (which I doubt)?


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#2 12/10/07 22:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Follow?

You mean like this:
http://www.youtube.com/watch?v=BysMcC14xqY

I take no credit, Loser was the one who figured it out.  It requires OUP and modifying some files.  If you're interested, I can PM you the instructions Loser gave me.

Offline

#3 12/10/07 22:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Follow?

Yes, like that ^_^ Please do


Will an AI continue using a weapon as long as it has ammo?

Last edited by Gumby (12/10/07 22:12)


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#4 12/10/07 22:12

Your_Mom
Member
From: Canada
Registered: 01/31/07
Website

Re: Follow?

I'd like to know too tongue


droid803sig.jpg

Offline

#5 12/11/07 05:12

m2
Member
Registered: 01/22/07

Re: Follow?

If you're interested, I can PM you the instructions Loser gave me.

Why don't you post the instructions here so that everyone can read them?

Offline

#6 12/11/07 08:12

Loser
Member
From: somewhere in da Czech Republic
Registered: 01/14/07

Re: Follow?

You can also disable that Hi,Hi calling, if you want. Find NEUT file on Wiki, find shout sound slot in your selected NEUT file ( I guess it is "civfem_trigger" on a Wiki), and...yes, delete it. No more Hi,Hi.
                                                                                                Loser


"I am just a mere reflection of what I would be."

Offline

#7 12/11/07 09:12

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Follow?

Loser's public instructions can be found here:
http://oni.bungie.org/community/forum/v … d=306#p306
They're not very verbose, but quite complete.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#8 12/11/07 11:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Follow?

geyser: Thanks for the link to the original post.  I couldn't remember where it was.

m2: Here are Loser's detailed instuctions for follow me:

So...use OniUnPacker. Go to the *.dat file of the level where you want to have an ally. Choose some ONCC class. This will be you ally. Then go to Oni Galore Wiki site, type ONCC into search bar and go into that page. Carefully roll down and find which number affects basic health of the character. Change it then to some higher value (about 150-200 is good one). Of course if you choose some strong character (Konoko, Barabus, Mukade) you don't have to change them. But I think you just wanna have a copfem as a sidekick...

Anyway, after you adjust health (you can fine tune other things in the ONCC, I have found out some interesting stuff recently) you can save your *.dat file as this is all you had to do there.

Now go into *.raw file of that level and search for TUEN. That means NEUTral, it will be probably as one of the BINA files in the *.raw (according to an OUP). Now go to the wiki again and type NEUT into search bar. Carefully read the table, notice *neutral ID* field and note somewhere *neutral ID* of the NEUT file YOU chose for your ally (I recommend you choosing the first one).

Next, find *trigger range* field and change it to some enormous value ( 00 00 00 50 for example) then find *talk range* field and change it to zero ^_^ ( 00 00 00 00) then find *follow range* field and type in enormous number again ( 00 00 00 50 ) and finally find *enemy range* field and change it to some moderate amount ( 00 00 00 43 for example ).

Now save *.raw file, then open it again and go to CHAR section (should be BINA -> CHAR). Choose some character, this will be your ally. On wiki read ( type CHAR into search bar) where option bitset 1 is and set it  00, option bitset 2 should be 00, too. Give or not give weapon, that is your choice. Next nullify *job ID* and *patrol path ID*. *Combat ID* you can set 0e or 06, *melee ID* choose some good but not bugging one ( example: for Konoko, furies and copfems 16 or 18, for strikers and elites 15 or 17,  for tankers 0f, for ninjas 1b or 1c ). Next, *neutral ID*, here you have to type in ID of THAT HACKED NEUT file. Then give it some ammo clips if you want, hypos are useless (AI cannot use it). Find *Team ID* and set it *01 00 00 00* or *00 00 00 00* if you aren't rough yet or 05 00 00 00 if you are rough(go aganist TCTF in last chapters).
Alert levels set all to 04 00 00 00. Save the whole *.raw file and don't forget name of your ally (For example A_t47).

Now open scripts and make that AI spawn and teleport to you. Ingame you have to go in front of it so it can notice you. From then it will follow you (I recommend AI dash hack).

Be aware of some bugs: When fighting, AI can forget about you, staying near defeated enemy and staring at him. In that case, just go and show yourself again to it so it can see you. Also AI cannot jump across pits.

Last edited by EdT (12/11/07 11:12)

Offline

#9 12/11/07 18:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Follow?

That first bug is easily fixable...I already have a few ideas...


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#10 12/11/07 20:12

Your_Mom
Member
From: Canada
Registered: 01/31/07
Website

Re: Follow?

One problem:

How do I know what the NEUT ID I edited even is?!?

Last edited by Your_Mom (12/11/07 20:12)


droid803sig.jpg

Offline

#11 12/12/07 01:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Follow?

Your_Mom:  For example in level 4, I did a filter by filename for neut in RawEditor and got CJBONeutral.BINA, then click on the offset.
The first character has an neutral ID of 02 according to this page: http://wiki.oni2.net/OBD:BINA/OBJC/NEUT.

That's the ID you use in the CJBOCharacter.BINA file. Reference: http://wiki.oni2.net/OBD:BINA/OBJC/CHAR

Hope this helps.

Last edited by EdT (12/12/07 01:12)

Offline

#12 12/12/07 02:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Follow?

Uhh...just testing out a script here...maybe it only works with shinatama but...

#
# warehouse_main.bsl
#

var int my_save_point;

func void main(void)
{
    env_show 2010 0
    gl_fog_blue=.15
    gl_fog_red=.15
    gl_fog_green=.15
    gl_fog_start=.99
    gs_farclipplane_set 5000
    obj_create 20 20
    level_start

ai2_spawn shinatama
chr_set_health shinatama 1000
chr_teleport shinatama 7000
chr_giveweapon shinatama w2_sap
chr_unstoppable shinatama 1
fork follow

fork machine
}

func follow
{
ai2_followme shinatama
sleep 10
ai2_setmovementmode shinatama run
fork follow

}
func machine
{
chr_wait_animtype shinatama crouch

chr_giveweapon shinatama w2_sap

sleep 10
fork machine
}

It makes shinny follow me around shooting things with infinate ammo...no bug with being focused on the enemy, full combat awareness, good pathfinding (I can go anywhere I want, and she will find a way), but small bug...for some reason, when I use the second door opener (or maybe the third) shinatama is right there next to me afterward...odd (somehow I once got her stuck inside the wall... >_>)

I'll try it with a different character, to make sure its just not her relying on guns...

---okay tried it with griffin, noticed an odd effect when he has to run to get an enemy...Like he is hesitating...ill have a fix soon...---





What does "return" do?

Last edited by Gumby (12/12/07 02:12)


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#13 12/12/07 18:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Follow?

gumby: nice script.  I even tried to hide from Shinatama, but she found me!

Offline

#14 12/12/07 19:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Follow?

I tried too...I would use kangaroo to jump up  on the different levels and still she finds me!

Still, it only works well if the AI can shoot...


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#15 12/12/07 19:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Follow?

It works fine on other levels.

Here is my modified tctf_main.bsl

#
# tctf_main.bsl
#

func void
main(
    void)
{    

    gl_fog_blue=0
    gl_fog_red=0
    gl_fog_green=0
    gl_fog_start=.995
    gs_farclipplane_set 5000
    env_show 601 0
    env_show 602 0    
    env_show 321 0
    env_show 322 0
    env_show 323 0
    env_show 324 0
    env_show 325 0            
    start
    if (my_save_point eq 0)
    {
        Cut01
    }


ai2_spawn l_t23
chr_set_health l_t23 1000
chr_teleport l_t23 0001
fork follow

}

func follow
{
ai2_followme l_t23
sleep 10
ai2_setmovementmode l_t23 run
fork follow
}

And she is a good fighting partner!

Last edited by EdT (12/12/07 19:12)

Offline

#16 12/12/07 19:12

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Follow?

Well, one thing about it is that shooting AI behaviour is muuuch simpler than melee...

"return" is supposed to do the same thing as in C and elsewhere, but doesn't work fine.
It's OK is you return ints, but returning strings won't work (in the PC version at least).
Additionally, there are major bugs when parsing "else" and "if" clauses, and and and.
The bottom line is that BSL is easily the least polished component in all of Oni, so...


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#17 12/12/07 20:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Follow?

@EdT You didn't get any odd running animations when doing it?

@geyser ANY string functions would be nice...concactating, converting, returning, dividing...

So...the only benifit to doing all this binary stuff is increasing the enemy detect range...

@hesitation glitch - If your AI sees the enemy, but the enemy is far away from you, it will stop as if chained to you a certain part away...until it goes into combat mode, that is...I'm just not sure how to detect this using scripting...maybe a specific animation?


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#18 12/12/07 20:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Follow?

Aha! Just figured it out, I will set a script to detect a rapid change between forward and backward (or whatever animations) and I could probably even use "return" tongue

Is there any way to detect the current alert level for a character?

(Also) I'm currently trying to make a script that when you use a hypo, the AI is healed too...can you force them to use a hypo, is is chr_full_health the only option?

(Last) Next up, run + walk detection

Hey, geyser, what is walk_noaim and run_noaim?

Last edited by Gumby (12/12/07 21:12)


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#19 12/12/07 21:12

Your_Mom
Member
From: Canada
Registered: 01/31/07
Website

Re: Follow?

I just loop ai2_followme and ai2_setmovemntmode a few times before looping the funtion... seems to work well...except when you want it to stop.

I've never had a problem with hesitation in combat outside of the usual pauses between moves though.

Last edited by Your_Mom (12/12/07 21:12)


droid803sig.jpg

Offline

#20 12/12/07 23:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Follow?

I do the same thing...

The run\walk thing will be neat, when I get aroudn to coding it


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

Board footer

Powered by FluxBB