Data Realms Fan Forums http://45.55.195.193/ |
|
Throwable Scanner (TDExplosive) http://45.55.195.193/viewtopic.php?f=73&t=45851 |
Page 1 of 1 |
Author: | mckryall [ Wed Nov 12, 2014 4:27 am ] |
Post subject: | Throwable Scanner (TDExplosive) |
Hey, I'm not sure if anyone checks this board, but I've been searching the internet and this is my last hope. I had an idea for non-handheld scanners, such as grenades, dropship bombs, and bullets, and started to read over similar lua files in the game. I took an impulse grenade and stripped it down and gave it a rock sprite. and tried to take inspiration from the Heavy Digger's lua file and a timer for the impulse grenade (TimedFuze.lua). This is the most recent rewrite of Camera.lua: Whenever I run this, it doesn't do anything. Not when I load the map, not when I buy the bomb (with actor), not when the order is delivered, and not when the bomb is thrown (or after the timer runs out). Am I using the SceneMan:RevealUnseenBox command incorrectly? It reveal the entire scene as soon as my order was delivered whenever I set the lua to an update(self) function containing only the line "for t=1,4 do SceneMan:RevealUnseenBox(0,0,SceneMan.SceneWidth,SceneMan.SceneHeight,t-1) end". ( no newlines) I want information on how and when the functions of the script are called, and how to use RevealUnseenBox (and RevealUnseen). Thanks for any help, mckryall |
Author: | Bad Boy [ Wed Nov 12, 2014 4:48 am ] |
Post subject: | Re: Throwable Scanner (TDExplosive) |
I'm not 100% sure what's going wrong but your script is way messier than needed and that probably makes it less fun to debug. Are there any console errors? Either way, try something like this for starters. If nothing happens, put a print in somewhere and see if it's showing up in the console at all: Code: function Update(self) if self:IsActivated() then --Flags as true once it's been actually thrown, so it won't do anything if you drop it from a ship. Remove this if you'd like it to start revealing as soon as it exists for i = 0, 3 do SceneMan:RevealUnseenBox(self.Pos.X, self.Pos.Y, 100, 100, i); end end end This should keep revealing a 100 by 100 pixel box around the grenade once it's been thrown. |
Author: | mckryall [ Wed Nov 12, 2014 4:40 pm ] |
Post subject: | Re: Throwable Scanner (TDExplosive) [Solved!] |
I got it to work! I completely rewrote my script. I had to attach a fuse script to the grenade, and I attached my main script to the payload. Here are the files: Throwable Camera.ini TimedFuze Throwable Camera.lua Camera.lua This was written in B28(27?) because I'm using OSX 10.7 and can't update (I'm on a school computer). Throw it up in a high arc and it will start glowing, move horizontally, and reveal a 300x300 square. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |