edit: Darius ADv_tools do work in fort mode.
oh I just smooth out more of the wagon mode code for adventurers.
function adv_tools.wagonmode()
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
indx=GetCreatureAtPos(getxyz())
--indx=0
--print(string.format("%x",vector:getval(indx)))
flg=engine.peek(vector:getval(indx),ptr_Creature.flags) --get flags
flg:set(1,0)
flg:set(74,0)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
print("To stay normal press y, else hit Enter turn Wagon mode on.")
r=io.stdin:read() -- repeat for it too work... also creature will be dead.
if r== "y" then
flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
flg:set(1,0)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
else
flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
flg:set(1,0)
flg:flip(74)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
end
end
sadly I wonder why does it only work when the creature is dead. guess it from the fact it only meant to be use only for caravans in fort mode and those where pulled by some type of animal, oh well makes me wonder oh well still wonder why that zombie mod doesn't work.
edit: made a easier to play with flags command for adventure mode.
function adv_tools.insertflag()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector)
indx=GetCreatureAtPos(getxyz())
flg=engine.peek(vector:getval(indx),ptr_Creature.flags)
print("insert flag:")
entry=io.stdin:read()
flg:flip(entry)
engine.poke(vector:getval(indx),ptr_Creature.flags,flg)
end