You are not logged in.
I can not schedule something in BSL, you can report a manual to me?
Press here >><< for chat with me
Offline
Iritscen: ![]()
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours
Offline
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 >><< for chat with me
Offline
ai2_spawn Top_Striker_1 force
Iritscen: ![]()
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours
Offline
you can explain better please?
Press here >><< for chat with me
Offline
using force after ai2_spawn makes it possible to spawn as many of one character as you like.
Iritscen: ![]()
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours
Offline
yes, but how?
ai2_spawn Top_Striker_1
ai2_spawn Top_Striker_1 force?
Press here >><< for chat with me
Offline
ah right! how is called the event in which a striker dies?
Press here >><< for chat with me
Offline
Well....there isn't really a way to do it for multiple characters of the same name.
Iritscen: ![]()
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours
Offline
sin ...
Press here >><< for chat with me
Offline
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 >><< for chat with me
Offline
If what is equal to 2?
Iritscen: ![]()
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours
Offline
sorry, I meant that the striker becomes 2 when 1 dies. So they are becoming more
Press here >><< for chat with me
Offline
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 !
Offline
it works theoretically. but how is the code?
Press here >><< for chat with me
Offline
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 ![]()
Check out the Anniversary Edition Seven at !
Offline
oh, sorry
Press here >><< for chat with me
Offline
Hope this works. ![]()
# 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 5000chr_location 0 608 100 20
#ai2_shownames = 1sleep 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
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 >><< for chat with me
Offline
Which parts?
Iritscen: ![]()
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours
Offline
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 >><< for chat with me
Offline
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 !
Offline
add_x and already_added are Variables.
Iritscen: ![]()
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours
Offline
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 >><< for chat with me
Offline
ah right! how do you write this script
if the object does not exist, create it?
Press here >><< for chat with me
Offline