UroTTa 6 Postado Abril 21, 2014 Autor Share Postado Abril 21, 2014 É @demonbholder, não deu. Tava precisando muito desse script e ninguem consegue me ajudar Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639853 Compartilhar em outros sites More sharing options...
dalvorsn 268 Postado Abril 21, 2014 Share Postado Abril 21, 2014 É @demonbholder, não deu. Tava precisando muito desse script e ninguem consegue me ajudar To na estrada, quando chegar dou uma olhada, mas ja fala de uma vez qual distro ta usando.e que erros aparecemPode ir printando os escopos tambem pra.saber em qual condicional.ele esta parando Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639859 Compartilhar em outros sites More sharing options...
UroTTa 6 Postado Abril 21, 2014 Autor Share Postado Abril 21, 2014 Estou usando distro 1.0 versão 10.37, o script não da nenhum erro so que ele não obedece oque era pra ser feito. Acho que não esta checando os 4 jogadores nas posições que devia estar. Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639863 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Abril 21, 2014 Share Postado Abril 21, 2014 (editado) Estranho que ele ta fazendo o start ficar 4, e pra isso, ele tem que pegar o storage dos players nas 4 posições... E outra, se você ta falando que com só 1 ele já ta dando, deveria dar erro quando ele chama a função doCreatureSay, já que ele não acha a criatura. Vou ficar aguardando o resultado. Editado Abril 21, 2014 por Demonbholder Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639868 Compartilhar em outros sites More sharing options...
UroTTa 6 Postado Abril 21, 2014 Autor Share Postado Abril 21, 2014 O seu ultimo script agora deu erro quando somente um passa na posição: Lua Script Error: [MoveEvents Interface]data/movements/scripts/children of the revolution quest/childrenOfTheRevolutionQuestClick.lua:onStepIn...volution quest/childrenOfTheRevolutionQuestClick.lua:44: attempt to call global 'getThingFromPos' (a nil value)stack traceback: [C]: in function 'getThingFromPos' ...volution quest/childrenOfTheRevolutionQuestClick.lua:44: in function <...volution quest/childrenOfTheRevolutionQuestClick.lua:39> Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639877 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Abril 21, 2014 Share Postado Abril 21, 2014 Sim, o Techrlz falou que essa função não existe mais no tfs 1.0, mas não era a esse erro que eu tava me referindo. Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639879 Compartilhar em outros sites More sharing options...
UroTTa 6 Postado Abril 21, 2014 Autor Share Postado Abril 21, 2014 E o seu ultimo script que tu edito, estava percebendo que esta checando as 4 posições sim, porque, function onStepIn(cid, item, position, lastPosition) start = 0 if item.actionid == 8014 then for i = 1, 4 do local creature = getTopCreature(pos).uid if creature > 0 then if isPlayer(creature) then if getGlobalStorageValue(8014) < 1 then if getPlayerStorageValue(creature, 1050) == 19 then doCreatureSay(creature, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) start = start + 1 end end end end end Sempre quando um jogador passa no tile solta o doCreatureSay em cima dos outros jogadores que esta em suas respectivas posições, so que quando os 4 esta no tile o script não inicia o evento e essa mensagem o certo seria no final quando iniciase o evento. if start == 4 then doCreatureSay(creature, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) doCreateItem(3687, 1, {x = 33265, y = 31116, z = 8}) doCreateItem(3219, 1, {x = 33265, y = 31116, z = 7}) addEvent(TirarEscada, 30 * 1000) setGlobalStorageValue(8014, 1) addEvent(setGlobalStorageValue, 8014, 0) creature = "" for k = 1, 4 do for j = 1, 20 do if(k < 3) then creature = "eternal guardian" else creature = "lizard chosen" end summonPos = {x = math.random(33239, 33295), y = math.random(31100, 31132), z = 7} addEvent(doSummonCreature, k * 30 * 1000, creature, summonPos) addEvent(doSendMagicEffect, k * 30 * 1000, summonPos, CONST_ME_TELEPORT) end end addEvent(doClearMissionArea, 5 * 30 * 1000, {x = 33239, y = 31100, z = 7}, {x = 33295, y = 31132, z = 7}) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 15335, 2) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 1050, 20) end endreturn trueend Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639885 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Abril 21, 2014 Share Postado Abril 21, 2014 (editado) ... Editado Abril 21, 2014 por Demonbholder Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639893 Compartilhar em outros sites More sharing options...
UroTTa 6 Postado Abril 21, 2014 Autor Share Postado Abril 21, 2014 O script funcionou porem, tem uns detalhes: Quando um jogador entra no tile e pra mandar uma mensagem: E o seguinte, se tem 1 jogador numa pos manda 1x, se tem 2 manda 2x, se tem 3, vai mandar 4x o docreaturesay e o certo seria mandar somente uma. Outro detalhe tambem é que quando as funções fosse executada era pra executar um docreaturesay no meio da sala avisando, mas não consegui por. codigo abaixo: local pos = { {x = 33258, y = 31079, z = 8}, {x = 33259, y = 31089, z = 8}, {x = 33266, y = 31084, z = 8}, {x = 33263, y = 31093, z = 8} } function doClearMissionArea(fromPos, toPos) for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = fromPos.z, toPos.z do if(getTopCreature({x = x, y = y, z = z}).uid > 0) then if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then doTeleportThing(getTopCreature({x = x, y = y, z = z}).uid, {x = 33353, y = 31410, z = 8}) doSendMagicEffect({x = 33353, y = 31410, z = 8}, CONST_ME_TELEPORT) else doRemoveCreature(getTopCreature({x = x, y = y, z = z}).uid) end end end end end return true end function TirarEscada() local escada = getTileItemById({x = 33265, y = 31116, z = 8}, 3687) local escada2 = getTileItemById({x = 33265, y = 31116, z = 7}, 3219) if escada then doRemoveItem(escada.uid, 1) doRemoveItem(escada2.uid, 1) doCreateItem(11097, 1, {x = 33265, y = 31116, z = 7}) end return true end function onStepIn(cid, item, position, lastPosition) start = 0 if item.actionid == 8014 then for i = 1, 4 do local creature = getTopCreature(pos[i]).uid if creature > 0 then if isPlayer(creature) then if getGlobalStorageValue(8014) < 1 then if getPlayerStorageValue(creature, 1050) == 19 then doCreatureSay(cid, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) start = start + 1 end end end end end if start == 4 then doCreatureSay("The army is complete again. You hear a hatch opening elsewhere, followed by a grinding sound.", TALKTYPE_ORANGE_1, false, cid, {x = 33261, y = 31086, z = 8}) doCreateItem(3687, 1, {x = 33265, y = 31116, z = 8}) doCreateItem(3219, 1, {x = 33265, y = 31116, z = 7}) addEvent(TirarEscada, 30 * 1000) setGlobalStorageValue(8014, 1) addEvent(setGlobalStorageValue, 8014, 0) creature = "" for k = 1, 4 do for j = 1, 20 do if(k < 3) then creature = "eternal guardian" else creature = "lizard chosen" end summonPos = {x = math.random(33239, 33295), y = math.random(31100, 31132), z = 7} addEvent(doSummonCreature, k * 30 * 1000, creature, summonPos) addEvent(doSendMagicEffect, k * 30 * 1000, summonPos, CONST_ME_TELEPORT) end end addEvent(doClearMissionArea, 5 * 30 * 1000, {x = 33239, y = 31100, z = 7}, {x = 33295, y = 31132, z = 7}) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 15335, 2) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 1050, 20) end end return true end Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639897 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Abril 21, 2014 Share Postado Abril 21, 2014 (editado) Então o código antigo tava funcionando? Não sei se eu entendi direito o que você quer, vê se é isso: local pos = { {x = 33258, y = 31079, z = 8}, {x = 33259, y = 31089, z = 8}, {x = 33266, y = 31084, z = 8}, {x = 33263, y = 31093, z = 8} } function doClearMissionArea(fromPos, toPos) for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = fromPos.z, toPos.z do if(getTopCreature({x = x, y = y, z = z}).uid > 0) then if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then doTeleportThing(getTopCreature({x = x, y = y, z = z}).uid, {x = 33353, y = 31410, z = 8}) doSendMagicEffect({x = 33353, y = 31410, z = 8}, CONST_ME_TELEPORT) else doRemoveCreature(getTopCreature({x = x, y = y, z = z}).uid) end end end end end return true end function TirarEscada() local escada = getTileItemById({x = 33265, y = 31116, z = 8}, 3687) local escada2 = getTileItemById({x = 33265, y = 31116, z = 7}, 3219) if escada then doRemoveItem(escada.uid, 1) doRemoveItem(escada2.uid, 1) doCreateItem(11097, 1, {x = 33265, y = 31116, z = 7}) end return true end function onStepIn(cid, item, position, lastPosition) start = 0 if item.actionid == 8014 then for i = 1, 4 do local creature = getTopCreature(pos[i]).uid if creature > 0 then if isPlayer(creature) then if getGlobalStorageValue(8014) < 1 then if getPlayerStorageValue(creature, 1050) == 19 then start = start + 1 end end end end end if start == 4 then doCreatureSay(cid, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) doSendAnimatedText({x = 33261, y = 31086, z = 8}, "The army is complete again. You hear a hatch opening elsewhere, followed by a grinding sound.", TALKTYPE_ORANGE_1) doCreateItem(3687, 1, {x = 33265, y = 31116, z = 8}) doCreateItem(3219, 1, {x = 33265, y = 31116, z = 7}) addEvent(TirarEscada, 30 * 1000) setGlobalStorageValue(8014, 1) addEvent(setGlobalStorageValue, 8014, 0) creature = "" for k = 1, 4 do for j = 1, 20 do if(k < 3) then creature = "eternal guardian" else creature = "lizard chosen" end summonPos = {x = math.random(33239, 33295), y = math.random(31100, 31132), z = 7} addEvent(doSummonCreature, k * 30 * 1000, creature, summonPos) addEvent(doSendMagicEffect, k * 30 * 1000, summonPos, CONST_ME_TELEPORT) end end addEvent(doClearMissionArea, 5 * 30 * 1000, {x = 33239, y = 31100, z = 7}, {x = 33295, y = 31132, z = 7}) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 15335, 2) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 1050, 20) end end return true end Editado Abril 21, 2014 por Demonbholder Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639901 Compartilhar em outros sites More sharing options...
Techrlz 39 Postado Abril 21, 2014 Share Postado Abril 21, 2014 Então o código antigo tava funcionando? Não sei se eu entendi direito o que você quer, vê se é isso: local pos = { {x = 33258, y = 31079, z = 8}, {x = 33259, y = 31089, z = 8}, {x = 33266, y = 31084, z = 8}, {x = 33263, y = 31093, z = 8} } function doClearMissionArea(fromPos, toPos) for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = fromPos.z, toPos.z do if(getTopCreature({x = x, y = y, z = z}).uid > 0) then if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then doTeleportThing(getTopCreature({x = x, y = y, z = z}).uid, {x = 33353, y = 31410, z = 8}) doSendMagicEffect({x = 33353, y = 31410, z = 8}, CONST_ME_TELEPORT) else doRemoveCreature(getTopCreature({x = x, y = y, z = z}).uid) end end end end end return true end function TirarEscada() local escada = getTileItemById({x = 33265, y = 31116, z = 8}, 3687) local escada2 = getTileItemById({x = 33265, y = 31116, z = 7}, 3219) if escada then doRemoveItem(escada.uid, 1) doRemoveItem(escada2.uid, 1) doCreateItem(11097, 1, {x = 33265, y = 31116, z = 7}) end return true end function onStepIn(cid, item, position, lastPosition) start = 0 if item.actionid == 8014 then for i = 1, 4 do local creature = getTopCreature(pos[i]).uid if creature > 0 then if isPlayer(creature) then if getGlobalStorageValue(8014) < 1 then if getPlayerStorageValue(creature, 1050) == 19 then start = start + 1 end end end end end if start == 4 then doCreatureSay(cid, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) doSendAnimatedText({x = 33261, y = 31086, z = 8}, "The army is complete again. You hear a hatch opening elsewhere, followed by a grinding sound.", TALKTYPE_ORANGE_1) doCreateItem(3687, 1, {x = 33265, y = 31116, z = 8}) doCreateItem(3219, 1, {x = 33265, y = 31116, z = 7}) addEvent(TirarEscada, 30 * 1000) setGlobalStorageValue(8014, 1) addEvent(setGlobalStorageValue, 8014, 0) creature = "" for k = 1, 4 do for j = 1, 20 do if(k < 3) then creature = "eternal guardian" else creature = "lizard chosen" end summonPos = {x = math.random(33239, 33295), y = math.random(31100, 31132), z = 7} addEvent(doSummonCreature, k * 30 * 1000, creature, summonPos) addEvent(doSendMagicEffect, k * 30 * 1000, summonPos, CONST_ME_TELEPORT) end end addEvent(doClearMissionArea, 5 * 30 * 1000, {x = 33239, y = 31100, z = 7}, {x = 33295, y = 31132, z = 7}) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 15335, 2) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 1050, 20) end end return true end doSendAnimatedText não existe no tfs 1.0 Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639903 Compartilhar em outros sites More sharing options...
UroTTa 6 Postado Abril 21, 2014 Autor Share Postado Abril 21, 2014 E mais ou menos isso so que o seu doSendAnimatedText acho que não existe essa função no 1.0. [C]: in function 'debugPrint' data/compat.lua:305: in function 'doSendAnimatedText' ...volution quest/childrenOfTheRevolutionQuestClick.lua:48: in function <...volution quest/childrenOfTheRevolutionQuestClick.lua:39> E essa mensagem doCreatureSay(cid, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) Era pra quando o jogador pisase no tile ja soltava ela. Não quando executase as funções. Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639904 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Abril 21, 2014 Share Postado Abril 21, 2014 function onStepIn(cid, item, position, lastPosition) start = 0 if item.actionid == 8014 then doCreatureSay(cid, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) for i = 1, 4 do local creature = getTopCreature(pos[i]).uid if creature > 0 then if isPlayer(creature) then if getGlobalStorageValue(8014) < 1 then if getPlayerStorageValue(creature, 1050) == 19 then start = start + 1 end end end end end if start == 4 then doCreateItem(3687, 1, {x = 33265, y = 31116, z = 8}) doCreateItem(3219, 1, {x = 33265, y = 31116, z = 7}) addEvent(TirarEscada, 30 * 1000) setGlobalStorageValue(8014, 1) addEvent(setGlobalStorageValue, 8014, 0) creature = "" for k = 1, 4 do for j = 1, 20 do if(k < 3) then creature = "eternal guardian" else creature = "lizard chosen" end summonPos = {x = math.random(33239, 33295), y = math.random(31100, 31132), z = 7} addEvent(doSummonCreature, k * 30 * 1000, creature, summonPos) addEvent(doSendMagicEffect, k * 30 * 1000, summonPos, CONST_ME_TELEPORT) end end addEvent(doClearMissionArea, 5 * 30 * 1000, {x = 33239, y = 31100, z = 7}, {x = 33295, y = 31132, z = 7}) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 15335, 2) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 1050, 20) end end return true end Coloquei pra mandar qnd ele pisar no tile. A respeito do animated text, eu não to com nada aqui pra ver qual função substituiu ela, se alguém souber, ajuda ele ai. Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639908 Compartilhar em outros sites More sharing options...
Techrlz 39 Postado Abril 21, 2014 Share Postado Abril 21, 2014 Passei pra ele o seguinte code e resolveu: doCreatureSayWithRadius(cid, "The army is complete again. You hear a hatch opening elsewhere, followed by a grinding sound.", TALKTYPE_ORANGE_1, 33261, 31086, {x = 33261, y = 31086, z = 8}) Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639909 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Abril 21, 2014 Share Postado Abril 21, 2014 Boa, essa função é nova ou já tinha antes? Não lembro de ter visto ela... Link para o comentário https://xtibia.com/forum/topic/232159-script-movements-n%C3%A3o-esta-executando-da-forma-correta/page/2/#findComment-1639911 Compartilhar em outros sites More sharing options...
Posts Recomendados