AlexxEG Posted June 21, 2009 Share Posted June 21, 2009 This script suppose to place a Static TV at the same place of a Havok ( Moveable TV ) to lock it in one place, but simple as this, I wont :PCan some1 take a look and see if they see something wrong please?BTW "Place" is a global var I made scn LuckyPlaceTVSCRIPT ref MySelf short Button short ActTVs begin onActivate ShowMessage LuckyPlaceTVSet set MySelf to GetSelf set Place to 1 end begin GameMode set Button to GetButtonPressed if ( Button == 0 ) && ( ActTVs == 0 ) LuckyTV1REF.moveto MySelf LuckyTV1REF.enable Disable MarkForDelete set ActTVs to 1 elseif ( Button == 0 ) && ( ActTVs == 1 ) LuckyTV2REF.moveto MySelf LuckyTV2REF.enable Disable MarkForDelete set ActTVs to 2 elseif ( Button == 0 ) && ( ActTVs == 2 ) LuckyTV3REF.moveto MySelf LuckyTV3REF.enable Disable MarkForDelete set ActTVs to 3 elseif ( Button == 0 ) && ( ActTVs == 3 ) LuckyTV4REF.moveto MySelf LuckyTV4REF.enable Disable MarkForDelete set ActTVs to 4 elseif ( Button == 0 ) && ( ActTVs == 4 ) ShowMessage LuckyPlaceTVSetToMany elseif ( Button == 1 ) && ( Place == 1 ) Activate set Place to 0 elseif ( Button == 2 ) && ( Place == 1 ) ;Do NOthing set Place to 0 endif end Link to comment Share on other sites More sharing options...
Stewb Posted June 21, 2009 Share Posted June 21, 2009 Could you tell us what the variable place is actually for? i can't seem to work it out. it is only stuck on the end of the script . If you want the 2nd and 3rd button to be used after placing 1 set then my guess would to remove replace ActTvs with Place and add a condition onto the message box for button 2 and 3 to only be displayed if Place is greater than 0. Something like: if ( Button == 0 ) && ( Place == 0 ) LuckyTV1REF.moveto MySelf LuckyTV4REF.disable LuckyTV1REF.enable Disable MarkForDelete set Place to 1 elseif ( Button == 0 ) && ( Place == 1 ) LuckyTV2REF.moveto MySelf LuckyTV4REF.disable LuckyTV2REF.enable Disable MarkForDelete set Place to 2 elseif ( Button == 0 ) && ( Place == 2 ) LuckyTV3REF.moveto MySelf LuckyTV4REF.disable LuckyTV3REF.enable Disable MarkForDelete set Place to 3 elseif ( Button == 0 ) && ( Place == 3 ) LuckyTV4REF.moveto MySelf LuckyTV4REF.disable LuckyTV4REF.enable Disable MarkForDelete set Pace to 4 elseif ( Button == 0 ) && ( Place == 4 ) ShowMessage LuckyPlaceTVSetToMany elseif ( Button == 1 ) Activate elseif ( Button == 2 ) return endif Edit: Sorry, indentation got screwed when i copied your script, also i think the object needs to be enabled before being moved, then disabled/enabled after moving it. (end of edit) As far as i understood it "Place" was there to enable options once the TV was locked in place. So it should also work as a variable for positioning of 4 T.Vs. If you use the condition on the message window rather than here the options will only appear if you have placed a static T.V. Although my understanding of scripts isn't the best this will probably work better for you. I also have a habit of mis-understanding what people actually want, so my apologies if i screwed up again. Link to comment Share on other sites More sharing options...
Recommended Posts