Aller au contenu

Photo

Script to move enemies


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

#1
Nwalya42

Nwalya42
  • Members
  • 306 messages
Hi all.

I am relatively new to modding games, and have begun working on a small module to help me get the general ideas of certain things. Currently I have a single area which is linked to the single player campaign. I can get there and exit there using the world map and area transitions.

I have created a plot (just a small one) and was looking for some help on scripting a small thing.

I would like a group of darkspawn (team 3) to move from their current location to close to the party after either a conversation exits or a plot point changes. When you enter the area there is a guy laying on the floor, you talk to him and I want you to be attacked by darkspawn which are further down the path (i.e. the darkspawn see you talking to him and run at you). I pressume this is done by scripts.

My question then - How do you make a team of enemies move towards/attack a player? I was thinking I could dramitically increase their sight range and make them spot you, but that might cause issues later depending on the future of the module.

Thanks in advance.

#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
UT_TeamMove will do what you want.

#3
Nwalya42

Nwalya42
  • Members
  • 306 messages
Hi - Thanks for the input! Small problem though - UT_TeamMove doesn't exist - at least not in the publically available toolset. The only function that begins with UT_ is UT_GetNearestObjectByTag, which doesn't really help. I've been working on a slightly different way, but need to use CommandMoveToObject. Only thing is that I don't know how to make an object use the command.
[code=auto:0]
void main()
{
object oPC = GetHero();
object oteamthree[] = GetTeam(3,0);

switch(oteamthree[])
{
CommandMoveToObject(oPC,True,1.0f,FALSE,0.0f);
}
break;
}
[\\code]

Not sure about the use of switch. I get a parsing variable list error when running this on the 4th line. Again, help would be appreciated :)

Modifié par Nwalya42, 05 décembre 2009 - 11:29 .


#4
Challseus

Challseus
  • Members
  • 1 032 messages
You need to include utility_h in your script in order to find/use UT_TeamMove.

Modifié par Challseus, 06 décembre 2009 - 12:01 .


#5
Nwalya42

Nwalya42
  • Members
  • 306 messages
Ahha! Thank you so much! Is there a list of possible libraries anywhere? (e.g. Utility_h, events_h)

#6
Phaenan

Phaenan
  • Members
  • 315 messages
Yup. You can see those under "_Core includes", in your toolset palette. :o

#7
Nwalya42

Nwalya42
  • Members
  • 306 messages
Ahha again! Thanks a heap - should make life easier in the future :)