for (local.a=1;local.a<=35;local.a++) probllem...
Moderator: Moderators
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
Of course
I used self.mytarget.size in case you might increase the mytargets, that way you wouldn't have to modify your for statement.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
Hello again.... now i have anothger problem, but its related to this topic so i post here!! I dont know why it dont work.... this is part of thest script///!
Its called by something like
after that another script is called:
What i want get exacly??
a script that let me add infinite number of entities with diffrent targetnames to one entity parm (??) called for example ".my_entities", and after that get all of those entities by FOR statement...
Code: Select all
add local.parent:
if (local.parent.ch)
{
local.parent.num++
local.parent.ch[local.parent.num] = self
}
else
{
//first ch
local.parent.num = 1
local.parent.ch = self
}
end
Code: Select all
$aaa thread add bbb
Code: Select all
for (local.i = 1; local.i < (local.parent.num+1); local.i++)
{
local.parent.ch[local.i] thread .........
}
What i want get exacly??
a script that let me add infinite number of entities with diffrent targetnames to one entity parm (??) called for example ".my_entities", and after that get all of those entities by FOR statement...
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
Infinite? 1024 is the maximum
Hmm, by the looks of your scripts, it doesn't seem anything like what you want to achieve.
Use this to register the entity in 1 variable.
Usage:
Script:
If you want 1 or all entity's to do something:
Usage:
1 for waitexec, NIL or 0 for exec. Don't specify a targetname if you want all registered entities execute your orders.
Or just a local thread!
Usage, similar to the previous script:
1 for waitthread, NIL or 0 for thread. Don't specify a targetname if you want all registered entities execute your orders.
There are a lot more things you can do
. Are these scripts you need?
Cheers
Use this to register the entity in 1 variable.
Usage:
Code: Select all
waitthread register_entity $my_entityCode: Select all
register_entity local.entity:
if (level.entity_register == NIL)
local.i = 1
else
local.i = ( level.entity_register.size + 1 )
level.entity_register[local.i] = local.entity
endIf you want 1 or all entity's to do something:
Code: Select all
register_execution local.orders local.wait local.tname:
if (local.tname == NIL || local.tname == "")
{
for (local.i = 1; local.i <= level.entity_register.size; local.i++)
{
if (local.wait == 1)
level.entity_register[local.i] waitexec local.orders
else
level.entity_register[local.i] exec local.orders
}
}
else
{
for (local.i = 1; local.i <= level.entity_register.size; local.i++)
{
if (local.tname == level.entity_register[local.i].targetname)
{
if (local.wait == 1)
level.entity_register[local.i] waitexec local.orders
else
level.entity_register[local.i] exec local.orders
}
}
}
endCode: Select all
waitthread register_execution global/myscript.scr 1 "my_targetname"Or just a local thread!
Code: Select all
register_thread local.orders local.wait local.tname:
if (local.tname == NIL || local.tname == "")
{
for (local.i = 1; local.i <= level.entity_register.size; local.i++)
{
if (local.wait == 1)
level.entity_register[local.i] waitthread local.orders
else
level.entity_register[local.i] thread local.orders
}
}
else
{
for (local.i = 1; local.i <= level.entity_register.size; local.i++)
{
if (local.tname == level.entity_register[local.i].targetname)
{
if (local.wait == 1)
level.entity_register[local.i] waitthread local.orders
else
level.entity_register[local.i] thread local.orders
}
}
}
endCode: Select all
waitthread register_thread "mythread" 1 "my_targetname"There are a lot more things you can do
Cheers
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
Should be:Aprop wrote:Code: Select all
local.parent.ch = self
Code: Select all
local.parent.ch[1] = self
Anyway, thank you Soldier!