What's the proper way to place a creature (NPC) in a game location? I know it can be placed with a script but I can't find functions that seem to do it. I see no GetCreatureByTag function anywhere....*sigh*
Placing a creture on a loaction?
Débuté par
Lotion Soronarr
, janv. 02 2010 06:12
#1
Posté 02 janvier 2010 - 06:12
#2
Posté 06 janvier 2010 - 12:18
Are you trying to create an object, or move an existing object? If you want to create an object, you need to use CreateObject().
To move an object, it's easier to use SetPosition() rather than SetLocation(). SetLocation() let's you specify and area and orientation, but I don't think the area part of that will let you move creatures between areas anyway.
If you just want to move a creature to a waypoint, use UT_LocalJump(), which is really just a wrapper around SetPosition().
To move an object, it's easier to use SetPosition() rather than SetLocation(). SetLocation() let's you specify and area and orientation, but I don't think the area part of that will let you move creatures between areas anyway.
If you just want to move a creature to a waypoint, use UT_LocalJump(), which is really just a wrapper around SetPosition().
#3
Posté 06 janvier 2010 - 03:20
Redcliffe day and night are seperate areas and not in the same area list. You won't be able to move creatures between them.
#4
Posté 06 janvier 2010 - 09:34
Do you know how to see compile errors? The code you've posted has a number of errors that wouldn't compile. Try this:
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch(nEventType)
{
case EVENT_TYPE_AREALOAD_PRELOADEXIT:
{
object oArea = GetArea(GetHero());
location aLoc = Location(oArea, Vector(355.699,344.979,36.9077),0.0);
CreateObject(OBJECT_TYPE_CREATURE, R"aquae.utc", aLoc);
break;
}
}
}
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch(nEventType)
{
case EVENT_TYPE_AREALOAD_PRELOADEXIT:
{
object oArea = GetArea(GetHero());
location aLoc = Location(oArea, Vector(355.699,344.979,36.9077),0.0);
CreateObject(OBJECT_TYPE_CREATURE, R"aquae.utc", aLoc);
break;
}
}
}
#5
Posté 07 janvier 2010 - 03:23
Lotion Soronnar wrote...
But wouldn't this place the NPC in any area the PC is currently in, instead of a specific area (Redclifffe)?
But yes...I should have seen the compile errors. I can be downright stupid sometimes.
You can't create creatures in areas the player isn't in. Well, maybe within the area list, but I don't like to rely on that. You have to create the creature using the area load script for the specific area.





Retour en haut







