• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

O co chodzi z STACKPOS

redbull915

I learn...
Joined
Oct 10, 2008
Messages
235
Reaction score
0
Location
Poland/Radom
Może mi ktoś powiedzieć mniej więcej jak się tych stackpos używa wiem ze te
PHP:
STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE = 1
STACKPOS_SECOND_ITEM_ABOVE_GROUNDTILE = 2
STACKPOS_THIRD_ITEM_ABOVE_GROUNDTILE = 3
STACKPOS_FOURTH_ITEM_ABOVE_GROUNDTILE = 4
STACKPOS_FIFTH_ITEM_ABOVE_GROUNDTILE = 5
usuwają w wzgledem położenia rzeczy
1 = piersz ktory jest na wierzchu
2 = ktory jest pod pierszym item
itd

tak mniej więcej zrozumiałem te funkcje ale dalej ich nie łapie

PHP:
STACKPOS_GROUND = 0
STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE = 1
STACKPOS_SECOND_ITEM_ABOVE_GROUNDTILE = 2
STACKPOS_THIRD_ITEM_ABOVE_GROUNDTILE = 3
STACKPOS_FOURTH_ITEM_ABOVE_GROUNDTILE = 4
STACKPOS_FIFTH_ITEM_ABOVE_GROUNDTILE = 5
STACKPOS_TOP_CREATURE = 253
STACKPOS_TOP_FIELD = 254
STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE = 255
 
Code:
STACKPOS_GROUND = 0 -- Tile (ziemia)
STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE = 1 (I item na tile'u)
STACKPOS_SECOND_ITEM_ABOVE_GROUNDTILE = 2 (II item na tile'u)
STACKPOS_THIRD_ITEM_ABOVE_GROUNDTILE = 3 (III item na tile'u)
STACKPOS_FOURTH_ITEM_ABOVE_GROUNDTILE = 4 (IV item na tile'u)
STACKPOS_FIFTH_ITEM_ABOVE_GROUNDTILE = 5 (V item na tile'u)
STACKPOS_TOP_CREATURE = 253 (Potwor/Gracz z samej gory)
STACKPOS_TOP_FIELD = 254 (Field z samej gory (np. ff))
STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE = 255  (item/gracz/potwor z samej gory)
 
0 - title/podłoże
1 - item leżący na ziemi
2 - item leżący na itemie nr 1
3 - item leżący na itemie nr 2
etc...

Zaraz dam edita i dodam resztę wyjaśnień :p

#EDIT#
Kur... ale szybko piszę... :(

Zastosowanie np:
Code:
local pozycja_przedmiotu_na_ziemi = toPosition
pozycja_przedmiotu_na_ziemi.stackpos = STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE

local topThing = getThingfromPos(pozycja_przedmiotu_na_ziemi)
    if topThing.itemid == 2555 then
        doTransformItem(topThing.uid, topThing.itemid + 1)
    end
 
Last edited:
Code:
local pozycja_przedmiotu_na_ziemi = toPosition
pozycja_przedmiotu_na_ziemi.stackpos = STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE

local topThing = getThingfromPos(pozycja_przedmiotu_na_ziemi)
    if topThing.itemid == 2555 then
        doTransformItem(topThing.uid, topThing.itemid + 1)
    end

Bez sensu, lepiej użyć:
Code:
local item = getTileItemById(toPosition, 2555)
if(item.uid ~= 0) then
   doTransformItem(item.uid, item.itemid + 1)
end
 
//doRelocate(pos, posTo)
//Moves all moveable objects from pos to posTo

można w ten sposób też wyczyścić kratke ustawiając 'posTo' na pozycje kosza ;D
 
no napisal, ze wszystko co da sie przesunac, a fieldow nie da sie :(
zreszta, juz niewazne, rozwiazalem problem w inny sposob
 
Back
Top