Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 27/5/09 13:11

Dr.Karluzz
Member
From: Milan, Italy
Registered: 22/5/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 27/5/09 13:31

Gumby
Member
From: Seattle, WA, USA
Registered: 30/8/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 27/5/09 16:54

Dr.Karluzz
Member
From: Milan, Italy
Registered: 22/5/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 27/5/09 16:56

Gumby
Member
From: Seattle, WA, USA
Registered: 30/8/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 27/5/09 17:16

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

Re: programming BSL

you can explain better please?


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

Offline

#6 27/5/09 17:18

Gumby
Member
From: Seattle, WA, USA
Registered: 30/8/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 27/5/09 17:23

Dr.Karluzz
Member
From: Milan, Italy
Registered: 22/5/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 27/5/09 17:24

Dr.Karluzz
Member
From: Milan, Italy
Registered: 22/5/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 27/5/09 17:27

Gumby
Member
From: Seattle, WA, USA
Registered: 30/8/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 27/5/09 17:28

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

Re: programming BSL

sin ...


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

Offline

#11 27/5/09 17:30

Dr.Karluzz
Member
From: Milan, Italy
Registered: 22/5/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 27/5/09 17:48

Gumby
Member
From: Seattle, WA, USA
Registered: 30/8/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 28/5/09 6:31

Dr.Karluzz
Member
From: Milan, Italy
Registered: 22/5/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 28/5/09 7:43

Iritscen
Moderator
From: NC, USA
Registered: 22/10/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?


byproducts are fine, but where's the beef?

Offline

#15 28/5/09 9:19

Dr.Karluzz
Member
From: Milan, Italy
Registered: 22/5/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 28/5/09 9:30

Iritscen
Moderator
From: NC, USA
Registered: 22/10/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


byproducts are fine, but where's the beef?

Offline

#17 28/5/09 9:43

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

Re: programming BSL

oh, sorry


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

Offline

#18 28/5/09 11:22

paradox-01
Member
From: Germany
Registered: 14/1/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 28/5/09 13:07

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

Re: programming BSL

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

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


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

Offline

#20 28/5/09 13:42

Gumby
Member
From: Seattle, WA, USA
Registered: 30/8/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 28/5/09 16:41

Dr.Karluzz
Member
From: Milan, Italy
Registered: 22/5/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 28/5/09 17:50

Iritscen
Moderator
From: NC, USA
Registered: 22/10/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).


byproducts are fine, but where's the beef?

Offline

#23 28/5/09 17:56

Gumby
Member
From: Seattle, WA, USA
Registered: 30/8/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 29/5/09 3:46

Dr.Karluzz
Member
From: Milan, Italy
Registered: 22/5/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 (29/5/09 5:45)


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

Offline

#25 29/5/09 5:45

Dr.Karluzz
Member
From: Milan, Italy
Registered: 22/5/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