Recalcvitals() on offline character

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Recalcvitals() on offline character

Post by xeon »

Hello
I'm scripting some command which, among other things, unequip the player while it is offline.
Unfortunately, if the player is wearing for example some skill-related item, its skill isn't recalculated, because the Recalcvitals() return this error:

error{ errortext = "Mobile is offline" }


Is there a way around this?

thanks

-xeon
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Recalcvitals() on offline character

Post by CWO »

If it returns an error, set a prop on them to recalc. Then in your login/reconnect scripts, look for the prop, recalc, then erase.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: Recalcvitals() on offline character

Post by xeon »

Thanks for your help CWO.

It is an idea the one you said.

Unfortunately the problem is little more complex. The function which is causing me trouble is in reality the GetAttributeTemporaryMod(), which return the same error

error{ errortext = "Mobile is offline" }


What do you suggest? Should I put in a CProp the sum of all #BonusSkill for all skills and recalculate them at logon manually, bypassing the unequip.inc ?
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Recalcvitals() on offline character

Post by Turley »

I would say your problem is a different one if you want to work with offline mobiles you need OfflineMobileRef's, you get them for example with SystemFindObjectBySerial(serial,SYSFIND_SEARCH_OFFLINE_MOBILES)
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: Recalcvitals() on offline character

Post by xeon »

Well, good suggestion, but unfortunately not working too.
I've tried getting the mobile ref with SystemFindObjectBySerial(serial,SYSFIND_SEARCH_OFFLINE_MOBILES) , and then working on player using this, but the GetAttributeTemporaryMod() still returns that error.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: Recalcvitals() on offline character

Post by xeon »

Well, tired of this message, I've scripted around it.

I set a CProp on the offline mobile.

Then, when the mobile login, I do what I've to do to it and erase the CProp.

bye

-xeon
Post Reply