Jump to content

Question about MonsterAI


drakth
 Share

Recommended Posts

Hi everyone,

 

Im pretty new with leadwerks and LUA, i have some questions about the MonsterAI LUA script.

 

I decided to make a small platform with some characters, (the crawler model and monsterAI script), the idea was that they attack each other and if the player got close enough also be attacked by one of the crawlers.

 

So, what i did was built a small platform, placed the 2 crawlers close together and changed the team property, one of them to good and the other to bad. However when i tested it, the one set to the Good team went after the Bad crawler, but, the bad team crawler didnt go after the good one, but went looking for me :P, so i decided to take a look at the monsterAI script.

 

Im never did anything with LUA however im familiar with programming. From what i saw, i thought i had to modify the function ChooseTarget(), but i the only thing i saw was this line:

 

if entity.script.teamid~=nil and entity.script.teamid~=0 and entity.script.teamid~=self.teamid then

...

end

 

IF i understand this line correctly its checking if the team is not empty, different to neutral and the team of the target is different than the one of the object where the script is running, right?

 

I dont see what could be causing the crawler to go after me rather the other crawler :-/

 

Oh one other question, i looked for the entity (object i suppose?) on http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/ but i didnt seem to find anything, where can i find this?

 

Thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...