specifying pawn location by ID

JMass

Active Member
Can anyone tell me when I a have a pawn ID in a variable ${anID} how I refer the its location? Would it be ${Pawn[${anID}].Location} ?

I am trying to put together an atom that will log all the pawns I run across with thier location. The onPawnSpawned event returns the four variables that are passed to this atom below. I would also like to log the location. But I am uncertain how to refer to the location of a particular pawn when I have its ID.

My goal is like below in that I was to echo/log the location.

Thank you very much.

Code:
atom(script) SpawnLog_onPawnSpawned(string anID, string aName, string aLevel, string aType)
{
	echo "Pawn Spawned: ${aName} (${anID}) :: ${aLevel} :: ${aType} chunk: ${Me.Chunk} ${Pawn[${anID}].Location}"
}
 

JMass

Active Member
Thank you Shaba.

What I am trying to figure out is how to reference pawns as they spawn to collect more information about them than what is provided in the onPawnSpawned event.

Anything I have tried putting the in brackets for ${Pawn[].X} ${Pawn[].Y} or ${Pawn[].Location} results in NULL. I cannot use Me.xxx I am assuming because I am not targeting them.
 

JMass

Active Member
Whoot! Thank you, that worked perfectly. I had looked right at examples of that being used but was thinking the commas were separating parameter types.

Related to /location. From the HUD examples on the Inner Space website I saw that I can add a constantly updated me.location on my hud. :)

Code:
hud -add loc 20,65 X ${Me.X} Y ${Me.Y}
 

Amadeus

The Maestro
Staff member
No, the client has no need to know the number of dots on a mob until you target it. Therefore, to get the difficulty, you'll have to target it, then do:

${Me.TargetAsEncounter.Difficulty}
 
Top Bottom