Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 05/27/09 13:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

programming BSL

I can not schedule something in BSL, you can report a manual to me?


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#2 05/27/09 13:05

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

Re: programming BSL


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 05/27/09 16:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

Ah thanks. I can not create more characters of the same type.
Example:

func void main(void) {
    chr_teleport 0 7010
    powerup_spawn hypo 7010

    ai2_spawn Top_Striker_1
    chr_teleport Top_Striker_1 7008
    chr_changeteam Top_Striker_1 TCTF
    ai2_followme Top_Striker_1 0
}

I would like to create many striker. how can I do?


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#4 05/27/09 16:05

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

Re: programming BSL

ai2_spawn Top_Striker_1 force


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

#5 05/27/09 17:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

you can explain better please?


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#6 05/27/09 17:05

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

Re: programming BSL

using force after ai2_spawn makes it possible to spawn as many of one character as you like.


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

#7 05/27/09 17:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

yes, but how?

ai2_spawn Top_Striker_1
ai2_spawn Top_Striker_1 force

?


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#8 05/27/09 17:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

ah right! how is called the event in which a striker dies?


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#9 05/27/09 17:05

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

Re: programming BSL

Well....there isn't really a way to do it for multiple characters of the same name.


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 05/27/09 17:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

sin ...


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#11 05/27/09 17:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

I would like to create a script that konoko teleportation in an isolated place with an enemy and just kill him if they are equal to 2 and so on ... you know how?


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#12 05/27/09 17:05

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

Re: programming BSL

If what is equal to 2?


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 05/28/09 06:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

sorry, I meant that the striker becomes 2 when 1 dies.  So they are becoming more


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#14 05/28/09 07:05

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

Re: programming BSL

I'm not sure what the dynamics are of handling multiple copies of the same character, and I don't have the time to write and test any code, but maybe someone else can.  I can at least talk theory.

The way I would try to do it is to have a counter for the current number of Strikers, starting it at 1, and a second variable for the number of Strikers to spawn, also starting at 1.  chr_waithealth would of course be used to look for the death of the Striker, and each time it registers a death, the variable tracking current Strikers would decrement.  When it reached zero, the to-spawn variable would increment by 1, and then we'd pass that variable to a function to spawn that same Striker x times.  This function would use our standard method of simulating a for loop -- having the function call itself as a fork until it has looped its code x times -- each time spawning the same Striker with the "force" option.

Would that work?


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

Offline

#15 05/28/09 09:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

it works theoretically. but how is the code?


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#16 05/28/09 09:05

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

Re: programming BSL

I'm hoping someone else can write it or at least give you some code snippets, I'm preparing for a trip today and don't have the time smile


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

Offline

#17 05/28/09 09:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

oh, sorry


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#18 05/28/09 11:05

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

Re: programming BSL

Hope this works. smile

# for level 1; delete all other script files in EnvWarehouse folder

var int add_x = 0;
var int already_added = 0;
var int round = 0;
var int dead = 0;


func main
{
    gl_fog_blue=.15
    gl_fog_red=.15
    gl_fog_green=.15
    gl_fog_start=.99
    gs_farclipplane_set 5000

    chr_location 0 608 100 20
    #ai2_shownames = 1

    sleep 120
    start_round_1
}



func start_round_1
{
    ai2_spawn Top_Striker_1
    dmsg "func start_round_1"
    chr_wait_health Top_Striker_1 0
    start_round_x
   
}

func start_round_x
{
    already_added = 0;
    dead = 0;
    dmsg "func [y.start]_round_x"
    add_x = add_x + 1
    round = round + 1
    sleep 10
    setup_round_x
}

func setup_round_x
{
    dmsg "func [r.setup]_round_x"

    sleep 10

    if (add_x <= round)
    {
        ai2_spawn Top_Striker_1 force
        already_added = already_added + 1
    }

    sleep 10

    if (already_added <= add_x)
    {
        fork setup_round_x
    }

    if (already_added eq add_x)
    {
        dmsg "[b.setup completed]"
        killometer
    }
}

func killometer
{
    dmsg "func killometer"

    chr_wait_health Top_Striker_1 0
    dmsg "clone died"

    dead = dead + 1
    if (dead < add_x)
    {
        fork killometer
    }

    if (dead eq add_x)
    {
        dmsg "[b.starting a new round]"
        fork start_round_x
    }
}

Offline

#19 05/28/09 13:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

Perfect! Thanks!I do not understand many passages.Can you explain them to me?

Last edited by Dr.Karluzz (05/28/09 13:05)


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#20 05/28/09 13:05

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

Re: programming BSL

Which parts?


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

#21 05/28/09 16:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

all! For example: why the striker appears precisely at that point without a command? then I do not understand some function type add_x or already_added


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#22 05/28/09 17:05

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

Re: programming BSL

add_x is the number of Strikers to spawn in this "round", the number which keeps going up by one.  already_added is the counter that tells the script when to stop spawning the Strikers for that round (that is, when already_added equals add_x).


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

Offline

#23 05/28/09 17:05

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

Re: programming BSL

add_x and already_added are Variables.


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

#24 05/29/09 03:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

mmh ok.Why the striker appears precisely at that point without a command?
ok, I understand

Last edited by Dr.Karluzz (05/29/09 05:05)


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

#25 05/29/09 05:05

Dr.Karluzz
Member
From: Milan, Italy
Registered: 05/22/09

Re: programming BSL

ah right! how do you write this script

if the object does not exist, create it

?


Press here >>http://www.myPlugoo.com/5PFFKSWC00BKE0D<< for chat with me

Offline

Board footer

Powered by FluxBB