Ares1 Posted July 10, 2010 Share Posted July 10, 2010 Hi, I've recently began more work on my mod: Placeable lights and ran into an issue making the lights turn on\off. is there any commands that allow you to replace an object in the game world or a way to change the radius of the light through a script? Link to comment Share on other sites More sharing options...
Cipscis Posted July 11, 2010 Share Posted July 11, 2010 No, but you could use Disable and Enable to toggle between two different items in the same place. Cipscis Link to comment Share on other sites More sharing options...
Ares1 Posted July 11, 2010 Author Share Posted July 11, 2010 Thanks! :D Thats what I'm trying now I'm trying to get the current object to disable itself while moving another object to the old ones exact position to make a light "appear" on, and vice versa if I want the light to "appear" off. my code is still very... lets say crappy :P as it can only make the object disappear and not reappear again. Also once the objects has been toggled once the message with the choices simply does not appear again :/ I started using reference ID's in an attempt to get it to work but with very limited results (it only vanishes the current object while not moving the new one). Here is my code so far... scn Lightonoffscript short buttonshort rsetref b8ref c2ref 010022b8ref 010022c2float xangfloat zangfloat yangfloat xfloat zfloat ybegin onActivate showmessage 1lightoptions if button == 0 && rset ==0 set xang to 010022b8.getangle x set zang to 010022b8.getangle z set yang to 010022b8.getangle y lampoff.disable set x to xang set y to yang set z to zang ref 010022c2.setPos z ref 010022c2.setPos y ref 010022c2.setPos x set rset to 1 set rset to 0 elseif button == 1 && rset == 0 set xang to 010022c2.getangle x set zang to 010022c2.getangle z set yang to 010022c2.getangle y set x to xang set y to yang set z to zang ref 010022c2.disable ref 010022b8.setPos z zang ref 010022b8.setPos y yang ref 010022b8.setPos x xang set rset to 0 elseif button == 2 && rset == 0 player.additem 1lampoff 1 set rset to 0 elseif button == 3 && rset == 0 set rset to 0 endifend Link to comment Share on other sites More sharing options...
Dyadya_Fedor Posted July 11, 2010 Share Posted July 11, 2010 Is this lights movable? , static? , turned via switch? , how they will be placed ?Guess I just can make a suggestion. use can this for light turned ON (example) scn LightONscript short iButton short iButtonPressed ref rMySelf Begin OnActivate Player set rMySelf to GetSelf ShowMessage LightOptionsON set iButtonPressed to 1 end Begin GameMode if iButtonPressed == 1 set iButton to GetButtonPressed if iButton > -1 set iButtonPressed to 0 if iButton == 0 ;Disable ? rMySelf.disable rMySelf.PlaceAtMe TurnedOffLight rMySelf.markfordelete elseif iButton == 1 ;take ? Player.Activate ;misc. item ? elseif iButton == 2 ;do nothing ? endif endif endif end and OFF scn LightOFFscript short iButton short iButtonPressed ref rMySelf Begin OnActivate Player set rMySelf to GetSelf ShowMessage LightOptionsOFF - for turned off light set iButtonPressed to 1 end Begin GameMode if iButtonPressed == 1 set iButton to GetButtonPressed if iButton > -1 set iButtonPressed to 0 if iButton == 0 ; Enable ? rMySelf.disable rMySelf.PlaceAtMe TurnedOnLight rMySelf.markfordelete elseif iButton == 1 ;take ? Player.Activate ;misc. item ? elseif iButton == 2 ;do nothing ? endif endif endif end Link to comment Share on other sites More sharing options...
Ares1 Posted July 12, 2010 Author Share Posted July 12, 2010 thanks :D Ya the lights are placeable and carry-able this script looks way more understandable than my own, is there a way to have the off and on scripts on the same script so it is like this in game ______________|.......turn on......||.......turn off......||.......pick up......||....do nothing....|~~~~~~~~~~~~ I'm going to mess around with your scripts and see what I can do :P thanks again for the help Link to comment Share on other sites More sharing options...
Ares1 Posted July 13, 2010 Author Share Posted July 13, 2010 Thanks so much! this solved the problem completely, you're the best :Dfor the help you have given me you will receive credit in my mod Link to comment Share on other sites More sharing options...
Recommended Posts