Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 04.04.2006, 02:10   #1
alysia
Архивный участник
 
Join Date: Apr 2005
Posts: 151
Default NPC Despawn after enter new area?

It is possible that a NPC despawn when it enter a new area or arrive a special coordinate/place?
alysia is offline  
Old 04.04.2006, 05:53   #2
Xellos
Архивный участник
 
Join Date: Feb 2006
Posts: 88
Default

sure,
for example when u use a MoveTo or WayPoints u can check when it arrives and issue a Despawn() or when it comes near some coordinates

what exactly do u need / want to do?
Xellos is offline  
Old 05.04.2006, 10:23   #3
alysia
Архивный участник
 
Join Date: Apr 2005
Posts: 151
Default

it would be nice when u can post here an example for the ai code I already searched in the ai.obj for an example (like an npc that already has the ai) but i didn't found anything
alysia is offline  
Old 05.04.2006, 13:23   #4
hamidouch
Архивный участник
 
Join Date: Mar 2005
Posts: 475
Default

EventHandler OUT_OF_TERRITORY()
{
Despawn();
}


that was hard
hamidouch is offline  
Old 05.04.2006, 13:30   #5
Xellos
Архивный участник
 
Join Date: Feb 2006
Posts: 88
Default

here are some example NASC scripts

despawn when leaving own territory:
[php:1:9f40e1ee71].
EventHandler OUT_OF_TERRITORY()
{
Despawn();
}
[/php:1:9f40e1ee71]



ok, and now two variants that will disappear on last waypoint
both examples have to use the warrior_patrol as superclass

immediate despawn on last waypoint:
[php:1:9f40e1ee71].
EventHandler MOVE_TO_WAYPOINT_FINISHED(way_point_index, next_way_point_index)
{
if (next_way_point_index == 0)
Despawn();

super;
}
[/php:1:9f40e1ee71]

despawn after the waypoint-delay on last waypoint:
[php:1:9f40e1ee71].
EventHandler TIMER_FIRED_EX(timer_id)
{
if (timer_id == 100001 && myself.i_ai1 == 0)
Despawn();

super;
}
[/php:1:9f40e1ee71]
Xellos is offline  
Old 05.04.2006, 14:33   #6
alysia
Архивный участник
 
Join Date: Apr 2005
Posts: 151
Default

thanks
alysia is offline  
Old 06.04.2006, 19:11   #7
alysia
Архивный участник
 
Join Date: Apr 2005
Posts: 151
Default

another little question

it is possible to define parameters for waypoints direct in the ai code?
like something


class guard_patrol : guard
{
parameter:
string WayPointsType WayPoints = "5443;2432;-300";
string WayPointDelaysType WayPointDelays = "5sec";

i know this is not working ^^ but I hope u know what i mean and you can help me
alysia is offline  
Old 06.04.2006, 20:21   #8
Xellos
Архивный участник
 
Join Date: Feb 2006
Posts: 88
Default

i know what u mean,
but i guess that this will not work

try it ^^

have not tried this before,
because i use the same ai for multiple monsters
and i need to set the (different) waypoints for each of them,
so defining them inside the ai was not really useful for me
Xellos is offline  
Old 07.04.2006, 19:20   #9
Osito2Dancer
Архивный участник
 
Join Date: Mar 2005
Posts: 442
Default

Quote:
Originally Posted by Xellos
i know what u mean,
but i guess that this will not work

try it ^^

have not tried this before,
because i use the same ai for multiple monsters
and i need to set the (different) waypoints for each of them,
so defining them inside the ai was not really useful for me
}
You could define an "standard territory control" on super class, and then you have to define territory on AI for each class that "inherits" that super class. It can be done, but it's a tedious work, because you have to make sure that all inherited classes have their own territory and waypoints, because if they dont, the moment they summon, if they aren't in the "superclass" defined territory, it will spawn and despawn in less than a second.

I think is posible.

Oso
Osito2Dancer is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 20:09.