PKPAIN Posted July 2, 2015 Share Posted July 2, 2015 Hello.As the title says i need a bit of help with a small (or i hope it's small) code in GECK.What i want to do is have a switch that activates 3 objects one after the other.For example if the player activates the switch for the first time object #1 is enabled,press it again and object #2 is enabled and object #1 is disabled and so on until the last object loops back to the first so basically every time i press the switch the next object appears and the last disappears.My code so far looked something like: Ref ObjectRef Begin GameModeset ObjectREF to GetLinkedRefEnd Begin OnActivateObjectREF.Enableset ObjectREF to ObjectREF.GetLinkedRefEnd So it works for the first time it activates the first object but after that than nothing...Also my first object is the linkedRef for the switch and my second objec is the linkedRef for the first object and so onI have no idea what to do so help would be appreciated.Thx Link to comment Share on other sites More sharing options...
Belthan Posted July 2, 2015 Share Posted July 2, 2015 It's best for performance to avoid using GameMode blocks unless you have something that absolutely needs to happen every frame. Try this: SHORT CurrentObject REF Obj1REF REF Obj2REF REF Obj3REF BEGIN OnActivate set Obj1REF to GetLinkedRef set Obj2REF to Obj1REF.GetLinkedRef set Obj3REF to Obj2REF.GetLinkedRef if CurrentObject == 0 Obj1REF.enable Obj3REF.disable set CurrentObject to 1 elseif CurrentObject == 1 Obj2REF.enable Obj1REF.disable set CurrentObject to 2 else Obj3REF.enable Obj2REF.disable set CurrentObject to 0 endif END Link to comment Share on other sites More sharing options...
aerophoneix Posted August 29, 2015 Share Posted August 29, 2015 It's best for performance to avoid using GameMode blocks unless you have something that absolutely needs to happen every frame. Try this: SHORT CurrentObject REF Obj1REF REF Obj2REF REF Obj3REF BEGIN OnActivate set Obj1REF to GetLinkedRef set Obj2REF to Obj1REF.GetLinkedRef set Obj3REF to Obj2REF.GetLinkedRef if CurrentObject == 0 Obj1REF.enable Obj3REF.disable set CurrentObject to 1 elseif CurrentObject == 1 Obj2REF.enable Obj1REF.disable set CurrentObject to 2 else Obj3REF.enable Obj2REF.disable set CurrentObject to 0 endif ENDIs this c++? And can I use Java coding if I bring my extension files and parameters into it? Link to comment Share on other sites More sharing options...
Jokerine Posted August 29, 2015 Share Posted August 29, 2015 No, that's the GECK scripting language used in Fallout and New Vegas. Link to comment Share on other sites More sharing options...
Recommended Posts