Aller au contenu

Photo

Making creature walk the waypoints


  • Veuillez vous connecter pour répondre
12 réponses à ce sujet

#1
dorotea

dorotea
  • Members
  • 19 messages
A silly newb question -- but I need to ask. Basically how do I make the creature walk the waypoints in DA?

Should the waypointsa be given all the same tags as creature tag ( ie say chicken_01 - all of them) ? Which script is then to modify to make the creature move and stop, loop, or patrol ? Are there daytime and nighttime waypoints?

Posts ? Or is the way things work in DA is totally different ?

#2
Nodrak

Nodrak
  • Members
  • 144 messages
I can't recall seeing many moving or patrolling NPCs in the OC, so it might not have a default script setup for this behavior (since if the devs didn't need it, they probably didn't make it). You could write your own custom script to handle the desired effect. If it doesn't exist, I am sure it will be one of the first 'Library Scripts' created.

#3
Sunjammer

Sunjammer
  • Members
  • 925 messages
This sort of thing can be handled by the ambient system. I did a little digging into the ambient system during the beta so I'll try and put together some instructions when I get home from work today (about 5 hours from now).

#4
dorotea

dorotea
  • Members
  • 19 messages
thanks Sunjammer - you will be my hero of the day then!

#5
dorotea

dorotea
  • Members
  • 19 messages
up - still want to play with these waypoints , since I cannot create any new levels , pretty please ?

#6
Erenz

Erenz
  • Members
  • 29 messages
The answer is in here. I'm sorry I cannot give you any more details, but I haven't used this yet, however it may be what you need.
http://social.biowar...bient_behaviour

Modifié par Erenz, 27 novembre 2009 - 12:23 .


#7
Sunjammer

Sunjammer
  • Members
  • 925 messages
Sorry work dragged me down to England for a couple of days but I'm back now!

For a very basic walk waypoint all you need to do is lay out your waypoints using a particular naming convention and set two variables on your creature (either manually or by scripting).  For this example we'll assume you are painting the creature down in the toolset and setting the variables manually.

So paint down (or select) your creature.  Give it a unique tag (mine was chicken). With the creature selected open the Variables windown (click on the ellipsis (...) button in the Variables property in the property grid).  Scroll down until you can see the group of AMBIENT variables and set the following:

AMBIENT_SYSTEM_STATE to 1 // enables the ambient system for this creature
AMBIENT_MOVE_PATTERN to 1 // sets patrol mode, i.e. to walk 1, 2, 3, 4, 3, 2, 1

Then paint the waypoints along the route the creature should follow.  By default should be named using the following convention:

ap_{tag}_{inc}

Where {tag} is the tag of your creature (so chicken in my case) and {inc} is an incrementing count (so 01, 02, 03, etc.).  For me the first waypoint in the set had the tag:

ap_chicken_01

Export and test: it's that easy!

Modifié par Sunjammer, 27 novembre 2009 - 08:16 .


#8
Tensor07

Tensor07
  • Members
  • 11 messages
@SunJammer or anyone who can help:
I'm using this information to get an NPC to walk from one place to another in the same area via script. So far I have one Waypoint with the appropriat tag. I'm assigning the creature's respective Ambient Variables after a plot script is triggered. I can tell the plot trigger fires but I can't tell why the NPC is not responding (not moving to the waypoint). I'm guessing i'm using the wrong command. I was told i should use the following:

case Plot Flag:
{
object oNPC = UT_GetNearestCreatureByTag(oPC, creature_npc_host);

// Waypoint Tag = ap_creature_npc_host_01

Ambient_Start(oPC, 1, 1);

//Ambient_Start(oPC, 1, 1) Replaces:
//SetLocalInt(oNPC, AMBIENT_SYSTEM_STATE, 1);
//SetLocalInt(oNPC, AMBIENT_MOVE_PATTERN, 1);

Any Ideas of what i'm missing?? Thanks

Modifié par Tensor07, 02 janvier 2010 - 10:32 .


#9
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
Tensor07: You don't actually seem to be giving the NPC any commands. I'd first suggest giving the NPC a unique tag so you can use GetObjectByTag() rather than UT_GetNearestCreatureByTag(), but that's just me.



Secondly, if you just want the NPC to move to a new location and stay there, you're probably better off using a waypoint to define the new location/orientation for the NPC, and then using the Rubber_SetHome() and Rubber_GoHome() commands. This will make the NPC walk to that location and stay there. Ambient variables are typically more useful if you want an NPC to wander around an area.



So:

case Plot Flag:

{

object oNPC = GetObjectByTag("<npc tag>")



Rubber_SetHome(oNPC, GetObjectByTag("<npc waypoint tag>"));

Rubber_GoHome(oNPC);

}

#10
Tensor07

Tensor07
  • Members
  • 11 messages
@AmstradHero:



Thanks for pointing that out... I used the Ambient Variables after a couple forums. I'll go back and go through the functions you laid out and implement them.. Thanks a lot for your response. Greatly appreciate it.

#11
Craig Graff

Craig Graff
  • Members
  • 608 messages
Just a quick note that UT_GetNearestObjectByTag is likely to be both a bit quicker and a bit cleaner than GetObjectByTag in most cases.

Modifié par Craig Graff, 08 janvier 2010 - 10:25 .


#12
Tensor07

Tensor07
  • Members
  • 11 messages
Thanks for the note Craig.. greatly appreciated

#13
Flyless

Flyless
  • Members
  • 1 messages
Can the same script be used to help make party NPC's walk whin the PC walks...just fooled around with it and can't seem to find out how to do it.Whin you toggle "walk" ingame your party NPC's seem to injoy running then stoping then running again,i think the PC is the waypoint for this but i do not have the smarts to fix it.It's just something i wanted to work on.