DarkLink Posted July 19, 2011 Share Posted July 19, 2011 Okay guys, I changed abit my scripts, trying to make it working with edf files. and I guess, I am messed up things a bit Now getElementPosition of element on map doesnt work, neither getElementData(element, posX) .. I have on console bad argument at getElementData and getElementPosition , tryed each one. My script: local radar = getElementByID("radar") local x,y,z = getElementData(radar, "posX", false), getElementData(radar, "posY", false), getElementData(radar, "posZ", false) also tryed local radar = getElementByID("radar") local x,y,z = getElementPosition(radar) both gave me errors. And map file: <map edf:definitions="borderpatrol,editor_main"> <object id="radar" doublesided="false" model="4832" interior="0" dimension="0" posX="494.01837158203" posY="2283.5415039063" posZ="67.924118041992" rotX="0" rotY="0" rotZ="235.99731445313" /> .... ... .. .. </map> on meta.xml: <meta> <info author="Tiago Martins" version="0.1" type="gamemode" name="DarkLink" description="A gamemode about border patrol and emigration" edf:definition="borderpatrol.edf"/> <map src="teleporte.map" dimension="0" /> ... ... (many scripts here..) </meta> Thanks guys, any clue? Link to comment
SDK Posted July 19, 2011 Share Posted July 19, 2011 You should try to use debug techniques on your scripts. Add outputChatBox(tostring(radar)) after the getElementByID line, see what it outputs. If it's "false", it didn't find the element, which means something is wrong between meta/script/map. Link to comment
DarkLink Posted July 19, 2011 Author Share Posted July 19, 2011 You should try to use debug techniques on your scripts.Add outputChatBox(tostring(radar)) after the getElementByID line, see what it outputs. If it's "false", it didn't find the element, which means something is wrong between meta/script/map. I guess its a problem with map file, but dont know how to fix it I started doing my map with ctf definitions, now made my own definitions and set it on map, like u can see. But something went wrong Thanks for ur reply. Link to comment
eAi Posted July 20, 2011 Share Posted July 20, 2011 Try editing your script and your map file just down to the code you've pasted, because I can't see anything obvious wrong with them... Link to comment
DarkLink Posted July 21, 2011 Author Share Posted July 21, 2011 Try editing your script and your map file just down to the code you've pasted, because I can't see anything obvious wrong with them... Thanks for your reply? What do you mean by editing the files just down to the code I pasted? Its everything ok down.. Thanks. Link to comment
SDK Posted July 21, 2011 Share Posted July 21, 2011 Your code (well, 1 line) should work, but it could be that something else is interfering. Put the code and map in a separate resource to test it, disable the other stuff and see if it works. Link to comment
DarkLink Posted July 21, 2011 Author Share Posted July 21, 2011 Okay thanks guys, I found out what is causing the error. When I have this on .map file I get error, when I dont have it, its ok. .. <passage id="passage (1)" size="2" passage destination="passage (3)" posX="2486.3046875" posY="-1661.8643798828" posZ="12.374344825745" rotX="0" rotY="0" rotZ="0" /> <passage id="passage (2)" size="2" passage destination="passage (4)" posX="2482.7746582031" posY="-1663.1722412109" posZ="12.382147789001" rotX="0" rotY="0" rotZ="0" /> <passage id="passage (3)" size="2" passage destination="passage (1)" posX="2478.8254394531" posY="-1661.8198242188" posZ="12.382147789001" rotX="0" rotY="0" rotZ="0" /> <passage id="passage (4)" size="2" passage destination="passage (2)" posX="2481.6726074219" posY="-1657.4172363281" posZ="12.365883827209" rotX="0" rotY="0" rotZ="0" /> .. This is a custom element, markers that will make teleport for the destination. So you guys know what is wrong here? Thanks. Link to comment
SDK Posted July 21, 2011 Share Posted July 21, 2011 change "passage destination" to "passage_destination" Link to comment
DarkLink Posted July 21, 2011 Author Share Posted July 21, 2011 change "passage destination" to "passage_destination" WORKING! Thanks alot mate! Didnt know about this mistakes :b I understand now Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now