Page 1 of 1
Moviana's Calculations
Posted: Wed Mar 25, 2015 2:03 am
by Balkoth
Are messed up for her potions. For example, I've specifically tested and seen her remove 3 Shadeleaf rather than 2 for a Mixture (and have screenshots to prove it).
I also started once with 20 Cherries and 4 Mixtures later I had 2 instead of 4 which is why I got suspicious in the first place.
Re: Moviana's Calculations
Posted: Wed Mar 25, 2015 7:59 pm
by tarashon
this is strange since she obviously calculates nothing but merely takes what she says she wants and the numbers in the scripts are fixed....
So perhaps some weird lag phenomena ?
/tara
Re: Moviana's Calculations
Posted: Wed Mar 25, 2015 8:05 pm
by Balkoth
I doubt it's lag and rather an error in the scripts. Able to post them for the mixture and elixirs?
Re: Moviana's Calculations
Posted: Wed Mar 25, 2015 8:07 pm
by tarashon
lemme try to find them yes....
/tara
Re: Moviana's Calculations
Posted: Wed Mar 25, 2015 8:17 pm
by tarashon
mixture...
take_shadefern2
void main()
{
object oPC = GetPCSpeaker();
int antal = 2;
string tag = "food_highfern";
object oItem = GetFirstItemInInventory( oPC );
int count = 0;
int stackSize;
int i;
while(GetIsObjectValid(oItem) && count < antal)
{
// Check tag
if (GetTag(oItem) == tag)
{
stackSize = GetItemStackSize(oItem);
if(stackSize == 1)
{
DestroyObject(oItem);
}
else
{
for(i=0; i<stackSize; i++)
{
SetItemStackSize(oItem,GetItemStackSize(oItem)-1);
count+=1;
if(count == antal)
{
return;
}
}
// Take care of last one.
DestroyObject(oItem);
}
}
oItem = GetNextItemInInventory(oPC);
}
return;
}
take_cherry4
void main()
{
object oPC = GetPCSpeaker();
int antal = 4;
string tag = "food_cherie";
object oItem = GetFirstItemInInventory( oPC );
int count = 0;
int stackSize;
int i;
while(GetIsObjectValid(oItem) && count < antal)
{
// Check tag
if (GetTag(oItem) == tag)
{
stackSize = GetItemStackSize(oItem);
if(stackSize == 1)
{
DestroyObject(oItem);
}
else
{
for(i=0; i<stackSize; i++)
{
SetItemStackSize(oItem,GetItemStackSize(oItem)-1);
count+=1;
if(count == antal)
{
return;
}
}
// Take care of last one.
DestroyObject(oItem);
}
}
oItem = GetNextItemInInventory(oPC);
}
return;
}
and elixir....
take_shadefern3
void main()
{
object oPC = GetPCSpeaker();
int antal = 3;
string tag = "food_highfern";
object oItem = GetFirstItemInInventory( oPC );
int count = 0;
int stackSize;
int i;
while(GetIsObjectValid(oItem) && count < antal)
{
// Check tag
if (GetTag(oItem) == tag)
{
stackSize = GetItemStackSize(oItem);
if(stackSize == 1)
{
DestroyObject(oItem);
}
else
{
for(i=0; i<stackSize; i++)
{
SetItemStackSize(oItem,GetItemStackSize(oItem)-1);
count+=1;
if(count == antal)
{
return;
}
}
// Take care of last one.
DestroyObject(oItem);
}
}
oItem = GetNextItemInInventory(oPC);
}
return;
}
take_cherry6
void main()
{
object oPC = GetPCSpeaker();
int antal = 6;
string tag = "food_cherie";
object oItem = GetFirstItemInInventory( oPC );
int count = 0;
int stackSize;
int i;
while(GetIsObjectValid(oItem) && count < antal)
{
// Check tag
if (GetTag(oItem) == tag)
{
stackSize = GetItemStackSize(oItem);
if(stackSize == 1)
{
DestroyObject(oItem);
}
else
{
for(i=0; i<stackSize; i++)
{
SetItemStackSize(oItem,GetItemStackSize(oItem)-1);
count+=1;
if(count == antal)
{
return;
}
}
// Take care of last one.
DestroyObject(oItem);
}
}
oItem = GetNextItemInInventory(oPC);
}
return;
}
and then she takes an ibisflower but...
Thats it...
/tara
Re: Moviana's Calculations
Posted: Wed Mar 25, 2015 9:53 pm
by Balkoth
Okay, yeah, just looking over the Shadefern 2 shows at least two major bugs:
1, when you check if the stack size is 1, you don't increment counter. This means if I have 16 individual Shadeferns it'll destroy all of them and give no credit.
2, the for loop is wrong. For example, imagine I have 2 Shadeferns in a stack. First time through the loop it sets the stack size to 1 and the counter to 1. Second time through the loop it sets the stack size to 1 again (because a stack of 1 minus 1 is still 1) and ups the counter to 2 -- thus it returns thinking it took 2 while only taking 1.
Re: Moviana's Calculations
Posted: Wed Mar 25, 2015 10:09 pm
by tarashon
Sorry Balkoth but all I hear is blabla yabbidi something scriptlike haha.
I'm sure Seeker will have an idea what you are talking about
/tara
Re: Moviana's Calculations
Posted: Thu Mar 26, 2015 5:47 am
by Somnium
Ah, I did not realize that Moviana is still using one of the old semi-autogenerated/hand-edited item-scripts, instead of the quest-script system.
The above scripts should be deleted, and the quest system should be used instead (it has an option for unlimited exchanges)
Re: Moviana's Calculations
Posted: Thu Mar 26, 2015 3:32 pm
by tarashon
Hmm perhaps you would fancy redoing her and sending me the new version Seeker ?
*smiles brighty and extremely charming - kinda like a puppy on steroids or whatever might work really*
/tara