Jump to content
  • 0

Mercenary AI not showing ID's of actors


robby22

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  02/28/18
  • Last Seen:  

https://bpaste.net/show/b021df0de56b

Hi in the link above is my modified mercenary AI. I'm logging the actors positions (monsters, npc's, players..etc) and it looks like this

1,162,173
1,173,171
1,168,173
1,163,167

So the second and third index are x, y coordinates which work fine, but the first index always shows a "1" it should tell me the ID's instead, wondering what I did wrong in my code? line 2253

Edited by robby22
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  2
  • Reputation:   0
  • Joined:  04/29/18
  • Last Seen:  

	local actors = GetActors()
	local num = 0
	local actors_list = ""
	for i,v in ipairs(actors) do
		if (v ~= OwnerID) and (v ~= MyID) then
			num = num + 1
			id = GetV(V_MERTYPE, v)
			if actors_list == "" then
				actors_list = ""
			else
				actors_list = actors_list .. " \n"
			end

			local x, y = GetV(V_POSITION, v)
			actors_list = actors_list .. id .. "," .. x .. "," .. y
		end
	end

 

You're ID is id = GetV(V_MERTYPE, v) 

 

Change V_MERTYPE to V_TARGET

 

also the "v" in ipairs(actors) is the actor value already

Edited by phaicm
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  02/28/18
  • Last Seen:  

Thanks for replying. I have changed it to V_TARGET but now it just shows up like this with 0's

Quote

0,162,173
0,173,171
0,168,173

If I log the "v" then I get these numbers below, even without the 1100 those ID's do not show the correct one of the actors in-game.

Quote

110056708,162,173
110052174,173,171
110001415,168,173

I actually got this all working with the homunculus version of this AI if anyone wants to use it. But I really need this working with the mercenary too. ?

Edited by robby22
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.

Guest
Answer this question...

×   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.

×
×
  • Create New...