![]() |
FORITEMS doesn´t work right? - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: General Help (/Forum-General-Help) +--- Thread: FORITEMS doesn´t work right? (/Thread-FORITEMS-doesn%C2%B4t-work-right) Pages: 1 2 |
FORITEMS doesn´t work right? - admin phoenix - 07-06-2012 06:46 AM For a resurrect script, I write a new script, so when you die you will be teleported to the next and nearest shrine. this should work with foritems 6144 this doesn´t work as I wish because the players will not teleport to the nearest one. I wrote a little script and checked it again. here is the script and the result... see the screenshot. something is wrong there. [FUNCTION test] FORITEMS 6144 IF (<type> == t_gold) local.x +=1 say <dlocal.x> ENDIF ENDFOR RE: FORITEMS doesn´t work right? - Anarch Cassius - 07-06-2012 06:53 AM Who ever said FORITEMS went in a certain order? Looks like it's scanning the potentially affected area left to right and top to bottom. Makes sense to me. You need to manually find he closest shrine then teleport. [FUNCTION nearest_shrine] FORITEMS 6144 local.lowdistance=50000 //any shrine should be closer than this IF (<type> == t_shrine) IF (<src.distance <I>> < <local.lowdistance>) //if this is the closest one so far local.lowdistance= <src.distance <I>> obj = <I> ENDIF ENDIF ENDFOR SRC.P = <OBJ.P> SRC.FIX //and you should be at the closet shrine That's totally untested but should get the idea RE: FORITEMS doesn´t work right? - Extreme - 07-06-2012 07:25 AM I think the best way, without use foritems is something like this: Code: [DEFNAMES SHRINES_P] RE: FORITEMS doesn´t work right? - Anarch Cassius - 07-06-2012 07:29 AM Extreme's wins. ![]() Much faster script if you have a reasonable number of shrines to define. Faster even if you don't really, but the defs might get tedious RE: FORITEMS doesn´t work right? - Extreme - 07-06-2012 07:34 AM (07-06-2012 07:29 AM)Anarch Cassius Wrote: Extreme's wins.Hehe, or can just use VARs ![]() (07-06-2012 06:46 AM)admin phoenix Wrote: For a resurrect script, I write a new script, so when you die you will be teleported to the next and nearest shrine.@OFF, this shard, Athoris is yours? If yes, can I try play there? I don't know German language, but I just want to know the server. If you can make me an account I would be happy. PS: this server looks awesome, I NEVER seen something like it, congrats. RE: FORITEMS doesn´t work right? - darksun84 - 07-06-2012 10:18 AM Offtopic : I would like to try it too ! But I have the same german language problem ![]() RE: FORITEMS doesn´t work right? - Skul - 07-06-2012 04:40 PM just off how I think this should work: Code: [function teletonearestshrine] Code: [event e_seek_shrine] RE: FORITEMS doesn´t work right? - admin phoenix - 07-06-2012 09:14 PM Thanks for helping me guys ![]() At first I will try Extreme code because it looks very nice but I will control the shrine via sql. Putting a new shrine in the world he coordinations will be writen in the sql. @all yes, it´s my shard and it is in german so it will be very hard for you to play ingame because all systems are in german too ![]() at the moment we have an on open beta. if you want an account you have to register because we control all accounts and chars via sql. for example you have to create a character via homepage ... In 3 weeks we will finish the open-beta and if we don´t get enough german player maybe I will think for an international shard ![]() but then I also need international gamemasters and developers *g* RE: FORITEMS doesn´t work right? - Shaklaban - 07-06-2012 09:38 PM you can read shrines from sql then. i think foritems is not a good idea because its creating giant loops, if a players can use it frequently, even one player can frozen the whole shard with uo loop. RE: FORITEMS doesn´t work right? - Extreme - 07-06-2012 10:24 PM (07-06-2012 09:14 PM)admin phoenix Wrote: Thanks for helping me guysI created the account, I think you must accept it, don't worry when you see what I wrote on the rp boxes ![]() Hope you will let us to try it =D |