I want to be able to create items in a players backpack when they are offline. I can do it in their bank boxes but when I try in the backpack the item isn't created. Anyone have any idea how to do this for orffline characters?
TIA
TTFN
A "CreateItemInBackpack" question
-
Firedancer
- Grandmaster Poster
- Posts: 104
- Joined: Fri Feb 03, 2006 6:32 am
Hmm not tested it, but have you tried that:Yukiko wrote:I will try that DevGIB. Your example doesn't answer my question exactly but if it works it will be a workaround at least.
account:=FindAccount(<account_name>);
character:=account.getcharacter(<number>);
//... or do a foreach loop through all of these each and compare
// with serial or playername or whatever you got to identify the
// desired char or you have the accountname anyway, then it's easier.
==> so in the end you get the offline character you want to work with.
ok... so you got the char
=> container:=character.backpack;
now if createitemincontainer() doesn't work.... how about creating the item elsewhere, and do a moveitemtocontainer()?
Might want to try adding:
...to the script.
Code: Select all
Set_Script_Option(SCRIPTOPT_CAN_ACCESS_OFFLINE_MOBILES, 1);
Oh my goodness! That might just do it.
Is that a POL 95 option Danielle? If so I must have missed it.
I will try that.
I know DevGIB's solution didn't work.
Firedancer, I already have the character reference through the SystemFindObjectBySerial function call. I use serials to reference the characters. I know the script is working because it works for online characters but not for offline characters.
Is that a POL 95 option Danielle? If so I must have missed it.
I will try that.
I know DevGIB's solution didn't work.
Firedancer, I already have the character reference through the SystemFindObjectBySerial function call. I use serials to reference the characters. I know the script is working because it works for online characters but not for offline characters.
NP DevGIB. Always so many things to think about and overlook in script development. I have been scripting POL/eScript for 3 maybe 4 years now and I was not even aware of that option. I just assumed characters were accessible on or offline. Never had a need before to gain access to an offline players pack in a script before.
To quote Montgomery (Scotty) Scott, "The more they overtake the plumbing, the easier it is to stop up the drain."
To quote Montgomery (Scotty) Scott, "The more they overtake the plumbing, the easier it is to stop up the drain."