Agent IDs vs Model IDs

From GameRevision Wiki

Jump to: navigation, search

Contents

Introduction

One of the most important skills a bot-maker needs is the ability to understand the ID numbers Guild Wars uses to distinguish between agents. There are 2 type of ID numbers we use to differentiate between agents, and scripting beginners often confuse them.

Agent ID

The server assigns these numbers to a agent when it spawns. Think of it as a number you're given when you walk into a busy pharmacy. You're number 96. The next time you come, there might have been fewer people before you. This time you're 74. This number changes every time you visit, but will stay the same once you have it. This is effectively the same concept as Agent IDs. A monster will get assigned one when it's first loaded, and keep it until it's unloaded (leaves the pharmacy). After that, it will change.

The highest number currently given out by the pharmacy, or highest Agent ID assigned, can be found by GetMaxAgents(). Since you know the highest agent loaded, you can effectively cycle through all of the loaded agents using a For-Loop. Also, there are the psuedo-IDs -1 and -2. -1 will always be your current target, and -2 will always be yourself.

The most important concept to understand with Agent IDs is that they don't single out the same agent every time you load a map. John Schmidt will not get number 56 every single day. This is where Model IDs come in.

Player Number

More commonly called Model ID, this number is unique to each particular monster. Where Agent ID was just a temporary number, Model ID is a permanent one. If Agent IDs were numbers given by the pharmacy, Model IDs are the visitor's name. An Ettin's Model ID will always be the same number, and all ettins of the same level/type will share this number.

Model ID is actually a misnomer (but remains the accepted terminology). It's actually a Local ID for that monster type. For example Suits of 60 and 80 Armor in Isle of the Nameless both share the same model, but will have different Model IDs. Both suits of 60 armor will share the same Model ID.

It should be mentioned that on a few rare occasions, Model IDs have changed after significant updates (such as the release of an expansion). This shouldn't be an issue, as Guild Wars likely won't be seeing any more updates big enough to cause this, but should be kept in mind.

Items

Items use the same concept as agents: a temporary ID called Item ID, and a permanent one - the model ID.

Personal tools