Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 04/13/08 10:04

coool
Member
From: China Haikou
Registered: 02/12/08

A script,play with weapons.

I post the bsl files and BINACJBOCharacter.oni ,maybe someone like it  smile

but there's something wrong,sometimes oni crashed when playing,I don't know why:(

Offline

#2 04/13/08 11:04

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

Re: A script,play with weapons.

func flag_p
{
flg=flg + 1
if(flg > 15) flg= 0
sleep 1
fork flag_p
}


func wea_id
{
w_id= w_id + 1
if(w_id > 16) w_id= 0
sleep 1
fork wea_id
}

Try combining this into one function. But I don't think that is it...

...also, it might be a problem with BINACJBOCharacter. What did you modify in it?

-------------------

Ok, I found something else...

Doesn't Oni crash when you try to call a function while it is already running?

You call flag_id a large number of times there...

------------------

I do have to say, good work on the script. Though lots of it looks copied from OTA tongue.

Last edited by Gumby (04/13/08 12:04)


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

#3 04/14/08 00:04

coool
Member
From: China Haikou
Registered: 02/12/08

Re: A script,play with weapons.

Yes something is the same as ota.

I don't think it's the problem of BINACJBOCharacter,I just add some charaters,this is the first BINACJBOCharacter file of adding charaters,when I learned how to add.I use this file always,it dosen't make any problems yet.


"You call flag_id a large number of times there..."

what's this meaning? the ota also call a flag id many times...

Offline

#4 04/16/08 05:04

coool
Member
From: China Haikou
Registered: 02/12/08

Re: A script,play with weapons.

OK now I know that's the problem.

the flags is strange that if I use them,oni will crashed.
I tried that change a ota's flags to that I used in this script,oni crashed also.

So I change the flags,it become OK.
but I find a problem again,I can't add more AIs...I use GrifElite01-6,whatever adding ,or change a charater to another,it won't work,nothing happen when I enter the game.



By the way,is there any place to post scripts together,people play and discuss together?

Last edited by coool (04/16/08 05:04)

Offline

#5 04/16/08 17:04

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

Re: A script,play with weapons.

What do you mean by adding more AIs? You can only add those which are in the level.

http://ssg.oni2.net/subfold/charas/charas.htm


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

#6 04/16/08 18:04

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

Re: A script,play with weapons.

Gumby: Actually... http://wiki.oni2.net/AE:AddCHAR

Edit: I organized the info on how to add characters to a level on the wiki.

Last edited by EdT (04/16/08 23:04)

Offline

#7 04/16/08 23:04

coool
Member
From: China Haikou
Registered: 02/12/08

Re: A script,play with weapons.

I know the charater must be in that level.

I add charaters by this:

fork add_1

func add_1
{
ai2_spawn(GrifElite01)
chr_set_health(GrifElite01, 18)
chr_unkillable(GrifElite01, 1)
fork flag_id
chr_teleport(GrifElite01, flgid)
ai2_makeaware(GrifElite01, 0)
fork re_b1
}

func re_b1
{
chr_wait_health(GrifElite01, 1)
chr_pain(GrifElite01, "death")
srf = srf + 1
#fork scf
chr_givepowerup(GrifElite01, invis, -1)
sleep 30
chr_teleport(GrifElite01, 513)
sleep 300
fork flag_id
chr_teleport(GrifElite01, flgid)
chr_inv_reset(GrifElite01)
chr_set_health(GrifElite01, 18)
fork wea
chr_giveweapon(GrifElite01, w_nm)
chr_givepowerup(GrifElite01, ammo, 9)
chr_givepowerup(GrifElite01, cell, 9)
fork re_b1
}

if I change GrifElite01 to another,like C_Sb75(it's in level 19)
but it won't work,just nothing happen when I enter the game(everything dose't happen,like there's no bsl files in compound folder)

and I add a charater more like this:

fork add_7


func add_7
{
ai2_spawn(C_Sb77)
chr_set_health(C_Sb77, 21)
chr_unkillable(C_Sb77, 1)
fork flag_id
chr_teleport(C_Sb77, flgid)
ai2_makeaware(C_Sb77, 0)
fork re_b7
}

func re_b7
{
chr_wait_health(C_Sb77, 1)
chr_pain(C_Sb77, "death")
srf = srf + 1
#fork scf
chr_givepowerup(C_Sb77, invis, -1)
sleep 30
chr_teleport(C_Sb77, 513)
sleep 300
fork flag_id
chr_teleport(C_Sb77, flgid)
chr_inv_reset(C_Sb77,
chr_set_health(C_Sb77, 18)
fork wea
chr_giveweapon(C_Sb77, w_nm)
chr_givepowerup(C_Sb77, ammo, 9)
chr_givepowerup(C_Sb77, cell, 9)
fork re_b7
}

nothing happened at all.

It's so strange,just GrifElite01-GrifElite06 worked...
and if you try to change a charater,you can understand what I said smile

Last edited by coool (04/16/08 23:04)

Offline

Board footer

Powered by FluxBB