Now the questions i want answered is:
Will this work?
Will this take the array number [0-50] or will it take the integer inside the array?
What i want it to do is the latter but it does not work from what i gather.
And if this is true, is there a different way you can do it, or some form of workaround?
In the map you get monster parts as drops that are stored in arrays depending on a part.
What this trigger is supposed to do is sell the parts at a set amount*number of parts.
TotalGain is then the total sell amount gathered at the end, and is what is provided to the player.
Well, this gives 0 credits so i am guessing its a wreck :)
Assistance would be much appreciated.
Sorry for any bad grammar/english.
General - Pick each integer from PlayersStash.HighValueCount[0] to PlayersStash.HighValueCount[50], and do (Actions)
will take integer stored at PlayersStash.HighValueCount[0] and iterate it to integer stored at PlayersStash.HighValueCount[50]
so if your PlayersStash.HighValueCount[0] = 3
and your PlayersStash.HighValueCount[50] = 5
then it will pick 3, then 4 and then 5
EDIT: sorry i cant get what you want to do, please explain what is PlayersStash.HighValueCount, why its 50 size array and confirm that its an integer array
HighValueCount is High Value items in the "inventory" and it is an array of 50, so 50 (51) different High Value item types.
PlayerStash also hold LowValueCount, MediumValueCount and things like Armor, Weapons, Consumables.
But, irrelevant in this trigger.
What the trigger is supposed to do, is check through the players inventory for High Value items (PlayersStash.HighValueCount), and if there excist any, remove that item (sell it) and add the minerals to the players funds.
If there excist none, add +1 to a local variable (currentInt)
The local variable keeps track of what type of item it is, as the items are of different value.
lootableSell.HighValueCount is a variable that stores the different "prices" so the local variable number is used as the item type, or the location in lootableSell.HighValueCount.
Above variable has the same array size of 50.
The trigger is run on dialog button press.
Hope that clarifies a bit atleast :)
@Kueken
As i need the integer number in the array im not sure that will help.
As PlayerStash holds the current amount of items the player has.
So lets say he has:
10 items of type 33 (PlayerStash.HighValueCount[33]
7 items of type 2 (PlayerStash.HighValueCount[2]
Then the trigger will loop through all the arrays, add no minerals for all except 2 and 33, as all other Arrays hold the integer 0 (0 items)
for 2 it adds the mineral price found in lootableSell times 7
and the same principle for 33.
Basically, i need to fetch the integers in the array.
But, please clarify if you think i am mistaken :)
EDIT:
I understand now, brain frooze for a bit, so it uses the integer number in the first and the last (0 and 50) and loops through that. My first thought was that it would loop from 0-50, the array numbers :)
Ofcourse, its easy to understand when you think about it, will have to use some other way around it :)
EDIT 2:
Used Kueken's idea, works flawlessly!
General - Pick each integer from 0 to 70, and do (Actions)
Actions
General - If (Conditions) then do multiple (Actions)
If Then Else
General - Else if (Conditions) then do (Actions)
Else If
(Abs(PlayersStash.WeaponsCount[(Picked integer)])) == 0
Then
Variable - Modify CurrentInteger: + 1
General - Else if (Conditions) then do (Actions)
Else If
(Abs(PlayersStash.WeaponsCount[(Picked integer)])) > 0
Then
From another trigger with the same function, now working.
Hello fellow mapsters!
I have run into an issue that i am pretty sure i know the reason too, but still want to confirm it with you guys.
As the title says, pick each integer and arrays, will/should it work? As an example:
Now the questions i want answered is: Will this work? Will this take the array number [0-50] or will it take the integer inside the array?
What i want it to do is the latter but it does not work from what i gather. And if this is true, is there a different way you can do it, or some form of workaround?
My full code that does not work:
EDIT: Thought i would clarify what i am doing.
In the map you get monster parts as drops that are stored in arrays depending on a part. What this trigger is supposed to do is sell the parts at a set amount*number of parts. TotalGain is then the total sell amount gathered at the end, and is what is provided to the player.
Well, this gives 0 credits so i am guessing its a wreck :)
Assistance would be much appreciated. Sorry for any bad grammar/english.
personally this code:
General - Pick each integer from PlayersStash.HighValueCount[0] to PlayersStash.HighValueCount[50], and do (Actions)
will take integer stored at PlayersStash.HighValueCount[0] and iterate it to integer stored at PlayersStash.HighValueCount[50]
so if your PlayersStash.HighValueCount[0] = 3
and your PlayersStash.HighValueCount[50] = 5
then it will pick 3, then 4 and then 5
EDIT: sorry i cant get what you want to do, please explain what is PlayersStash.HighValueCount, why its 50 size array and confirm that its an integer array
You want to use something like this instead:
PlayerStash is the "inventory" of the player.
HighValueCount is High Value items in the "inventory" and it is an array of 50, so 50 (51) different High Value item types.
PlayerStash also hold LowValueCount, MediumValueCount and things like Armor, Weapons, Consumables. But, irrelevant in this trigger.
What the trigger is supposed to do, is check through the players inventory for High Value items (PlayersStash.HighValueCount), and if there excist any, remove that item (sell it) and add the minerals to the players funds.
If there excist none, add +1 to a local variable (currentInt) The local variable keeps track of what type of item it is, as the items are of different value. lootableSell.HighValueCount is a variable that stores the different "prices" so the local variable number is used as the item type, or the location in lootableSell.HighValueCount. Above variable has the same array size of 50.
The trigger is run on dialog button press.
Hope that clarifies a bit atleast :)
@Kueken As i need the integer number in the array im not sure that will help. As PlayerStash holds the current amount of items the player has.
So lets say he has:
10 items of type 33 (PlayerStash.HighValueCount[33] 7 items of type 2 (PlayerStash.HighValueCount[2]
Then the trigger will loop through all the arrays, add no minerals for all except 2 and 33, as all other Arrays hold the integer 0 (0 items) for 2 it adds the mineral price found in lootableSell times 7 and the same principle for 33.
Basically, i need to fetch the integers in the array.
But, please clarify if you think i am mistaken :)
EDIT:
I understand now, brain frooze for a bit, so it uses the integer number in the first and the last (0 and 50) and loops through that. My first thought was that it would loop from 0-50, the array numbers :)
Ofcourse, its easy to understand when you think about it, will have to use some other way around it :)
EDIT 2:
Used Kueken's idea, works flawlessly!
General - Pick each integer from 0 to 70, and do (Actions) Actions General - If (Conditions) then do multiple (Actions) If Then Else General - Else if (Conditions) then do (Actions) Else If (Abs(PlayersStash.WeaponsCount[(Picked integer)])) == 0 Then Variable - Modify CurrentInteger: + 1 General - Else if (Conditions) then do (Actions) Else If (Abs(PlayersStash.WeaponsCount[(Picked integer)])) > 0 Then
From another trigger with the same function, now working.
Thanks alot!
damn i suggested this one too, but removed from post due i thought it would not fit :D