SetAnhor
Here is the reference to where it is documented: http://poldoc.fem.tu-ilmenau.de/singlef ... =npcem.xml
Example from setanchor.inc
Example from setanchor.inc
Code: Select all
function drop_anchor()
var cfg := ReadConfigFile("npcdesc");
var dstart := cfg[me.npctemplate].dstart;
var psub := cfg[me.npctemplate].psub;
if(!psub)
psub := 10;
endif
if(dstart)
SetAnchor(me.x, me.y, dstart, psub);
endif
var parms := { me.x, me.y, me.z };
SetObjProperty(me, "Anchor", parms);
endfunction
-
Marilla
Re: SetAnhor
You can't, because you can only use SetAnchor from within an AI script. Not running in an AI script, the function has no appropriate reference to do it's work at all.CrazyMan wrote:How i can to use function SetAnchor but NOT from AI script ?
-
Marilla
CrazyMan, it really depends on what you are intending to do, which is why we'd need to know more.
SetAnchor() does something very specific, for a very specific purpose. In fact, a purpose you really can't use directly in script at all; it sets the anchor point for some of the Core 'wandering' functions, in conjunction with other stuff.
If you are writing your own 'wandering' script, or other NPC movement system, you are welcome to set whatever property you need. But simply setting a cProp named anything at all will not duplicate what npc::SetAnchor() does, at least to my knowledge.
SetAnchor() does something very specific, for a very specific purpose. In fact, a purpose you really can't use directly in script at all; it sets the anchor point for some of the Core 'wandering' functions, in conjunction with other stuff.
If you are writing your own 'wandering' script, or other NPC movement system, you are welcome to set whatever property you need. But simply setting a cProp named anything at all will not duplicate what npc::SetAnchor() does, at least to my knowledge.
OK
CrazyMan what scripts are you using? Because what you gave as an example looks curiously like the World of Dreams NPC anchor settings. They use a CProp I think on some NPCs as an anchor setting and the AI "wander" function uses that CProp to keep the NPC close to it's "birth place".
If you aren't using World of Dreams scripts that might be a place to look for what you want. But still you need to be a little more specific as to what you want to accomplish. I understand you might not want to reveal too much but if you could give a general idea of what you are trying to accomplish it might help us help you.
CrazyMan what scripts are you using? Because what you gave as an example looks curiously like the World of Dreams NPC anchor settings. They use a CProp I think on some NPCs as an anchor setting and the AI "wander" function uses that CProp to keep the NPC close to it's "birth place".
If you aren't using World of Dreams scripts that might be a place to look for what you want. But still you need to be a little more specific as to what you want to accomplish. I understand you might not want to reveal too much but if you could give a general idea of what you are trying to accomplish it might help us help you.