PDA

View Full Version : 2 Questions


Xelat
23.04.2006, 15:16
1. Anyone knows all math functions of AI in NASC e.g. sqrt and etc? (symbol ^ is xor)
2. I making moving NPC's, but have a problem! When no one of players don't see the NPC, he will stoops and no making next movetodesire event, or not finish current. How to fix this?

humordwarf
23.04.2006, 15:34
1. Anyone knows all math functions of AI in NASC e.g. sqrt and etc? (symbol ^ is xor)
2. I making moving NPC's, but have a problem! When no one of players don't see the NPC, he will stoops and no making next movetodesire event, or not finish current. How to fix this?

1. % is mod :wink:
2. dont use DoNothingDesire, use AddTimer inside CREATED and TIMER_FIRED events, and inside TIMER_FIRED use your MoveTo stuff

Xelat
23.04.2006, 15:37
1. Anyone knows all math functions of AI in NASC e.g. sqrt and etc? (symbol ^ is xor)
2. I making moving NPC's, but have a problem! When no one of players don't see the NPC, he will stoops and no making next movetodesire event, or not finish current. How to fix this?

1. % is mod :wink:
2. dont use DoNothingDesire, use AddTimer inside CREATED and TIMER_FIRED events, and inside TIMER_FIRED use your MoveTo stuff
I already try this, but no have other results! :(

I say more!
NPC stops only on finish point of movetodesire, not on path. When NPC is stopped, and I going to NPC, when I see NPC, he's continue moving!
Strange system, but maybe it's made to decrease server loading.

Xelat
23.04.2006, 15:41
About math functions, I already find some functions:
% mod
| bit or
& bit and

and so.... :(
server not have a sqrt function or operator...

humordwarf
23.04.2006, 15:50
1. Anyone knows all math functions of AI in NASC e.g. sqrt and etc? (symbol ^ is xor)
2. I making moving NPC's, but have a problem! When no one of players don't see the NPC, he will stoops and no making next movetodesire event, or not finish current. How to fix this?

1. % is mod :wink:
2. dont use DoNothingDesire, use AddTimer inside CREATED and TIMER_FIRED events, and inside TIMER_FIRED use your MoveTo stuff
I already try this, but no have other results! :(

I say more!
NPC stops only on finish point of movetodesire, not on path. When NPC is stopped, and I going to NPC, when I see NPC, he's continue moving!
Strange system, but maybe it's made to decrease server loading.

hanlers:
MOVE_TO_FINISHED
MOVE_TO_WAY_POINT_FINISHED
MOVE_AROUND_FINISHED

try to add new desires somewhere there

Xelat
23.04.2006, 15:57
Ты не понял! Я все эти функции уже пробовал! Возможно нужна какая-то манипуляция с его глобальными параметрами, типа float MoveTo_DecayRatio = 0.0; или float MoveTo_BoostValue = 0.0;
Он вообще игнорит все приказы передвигаться куда либо, если рядом никого нету! Но как только кто-то рядом появляется, у него просыпается желание и он бежит сломя голову дальше!
Я пробовал даже делать телепортацию с таймером, но в результате он после всех телепортаций начинал бегать дальше туда, куда он до этого не добежал!

many word, no sense.. sorry others! :roll:

humordwarf
23.04.2006, 16:00
About math functions, I already find some functions:
% mod
| bit or
& bit and

and so.... :(
server not have a sqrt function or operator...
~ not

lol, you really need sqrt in AI ?
- sqrt for integer values using common operands:

unsigned sqrt_newton(long l)
{
long temp, div = l;
unsigned rslt = (unsigned)l;
if (l <= 0)
return 0;
while (1)
{
temp = l / div + div;
div = temp >> 1;
div += temp & 1;
if (rslt > div)
rslt = (unsigned)div;
else
{
if (l / rslt == rslt - 1 && l % rslt == 0)
rslt--;
return rslt;
}
}
}

convert it into nasc... or try search more in google.

Xelat
23.04.2006, 16:05
About math functions, I already find some functions:
% mod
| bit or
& bit and

and so.... :(
server not have a sqrt function or operator...
~ not

lol, you really need sqrt in AI ?
- sqrt for integer values using common operands:

unsigned sqrt_newton(long l)
{
long temp, div = l;
unsigned rslt = (unsigned)l;
if (l <= 0)
return 0;
while (1)
{
temp = l / div + div;
div = temp >> 1;
div += temp & 1;
if (rslt > div)
rslt = (unsigned)div;
else
{
if (l / rslt == rslt - 1 && l % rslt == 0)
rslt--;
return rslt;
}
}
}

convert it into nasc... or try search more in google.

Thanks! I will try. :P

humordwarf
23.04.2006, 16:10
Ты не понял! Я все эти функции уже пробовал! Возможно нужна какая-то манипуляция с его глобальными параметрами, типа float MoveTo_DecayRatio = 0.0; или float MoveTo_BoostValue = 0.0;
Он вообще игнорит все приказы передвигаться куда либо, если рядом никого нету! Но как только кто-то рядом появляется, у него просыпается желание и он бежит сломя голову дальше!
Я пробовал даже делать телепортацию с таймером, но в результате он после всех телепортаций начинал бегать дальше туда, куда он до этого не добежал!

many word, no sense.. sorry others! :roll:

try to continue experiments :wink:
add Say texts to handlers to see when and what fired
e.g.
PSTATE_IDLE
IDLE_FINISHED
IDLE_INTRRUPTED
etc...

Xelat
23.04.2006, 16:24
Ты не понял! Я все эти функции уже пробовал! Возможно нужна какая-то манипуляция с его глобальными параметрами, типа float MoveTo_DecayRatio = 0.0; или float MoveTo_BoostValue = 0.0;
Он вообще игнорит все приказы передвигаться куда либо, если рядом никого нету! Но как только кто-то рядом появляется, у него просыпается желание и он бежит сломя голову дальше!
Я пробовал даже делать телепортацию с таймером, но в результате он после всех телепортаций начинал бегать дальше туда, куда он до этого не добежал!

many word, no sense.. sorry others! :roll:

try to continue experiments :wink:
add Say texts to handlers to see when and what fired
e.g.
PSTATE_IDLE
IDLE_FINISHED
IDLE_INTRRUPTED
etc...
say don't help for me, because I'm not in range of saying text, when it's needed.. :/
but something need to do... ok, I'm go on thinking...

humordwarf
23.04.2006, 16:41
i think GM in insivible mode not visible for mobs...
and they possible will still in idle mode, when that GM will close
maybe not... not tested..

Xelat
23.04.2006, 17:15
i think GM in insivible mode not visible for mobs...
and they possible will still in idle mode, when that GM will close
maybe not... not tested..
ha ha.. mde...
You right think that I do all it in hide mode? :lol:
Not, this problem is very serious!

Xelat
23.04.2006, 18:26
Are you know, RemoveAllAttackDesire will remove only attack desires or all desires?