EPDGaffney Posted April 17, 2018 Share Posted April 17, 2018 I remember reading something kind of like this but the opposite, where SetPos and SetAngle do work and MoveTo doesn't, but the data would still get moved even if the 3D visual representation did not. So, I have a script which turns a crank. All the sounds were playing but it wasn't turning, so I checked its position in the console and it hadn't updated. Update3D didn't fix it. And attempting SetAngle in the console yielded the message that it 'cannot be moved'. Nothing about this on Google but I've seen it before. Never knew it would affect scripts, though. SetAngleEx did nothing different. Doing a PlaceAtMe of the object's base ID however yields a mesh that can be moved and rotated via the console. Anyone familiar with this very inventive roadblock? Link to comment Share on other sites More sharing options...
EPDGaffney Posted April 17, 2018 Author Share Posted April 17, 2018 I still want to know what causes this, now that I know it can happen in scripting as well, but this worked for me in this particular instance:https://geckwiki.com/index.php/Rotate Link to comment Share on other sites More sharing options...
Mktavish Posted April 18, 2018 Share Posted April 18, 2018 Ya rotate is the way to go ... when just spinning something on 1 axis.For an on / off effect , here is a script I did for a spinning energy weapon. But could put any on/off code in there for whatever ? SCN BMTurret01Script Float Timer Begin GameMode If GetInSameCell Player Set Timer to Timer + GetSecondsPassed Rotate Y 20 ; this # is how fast it rotates , try 15 if to fast If Timer < 2 ; this is how long the burst is on FireWeapon BMTurretArcWeap ; this is the new weap base-id elseIf Timer >= 2 ; this is when the burst stops StopCombat If Timer > 4 ; this is when to start the count over Set Timer to 0 endifendifendif End ~~~~~~~~~~~~ The notes were not meant for you , someone trying to make it work.Just left em there since was easier :turned: Link to comment Share on other sites More sharing options...
EPDGaffney Posted April 18, 2018 Author Share Posted April 18, 2018 I had no idea we could do that and I love it. Is there a 'slide' function I've been missing as well? So often I wish I could just move an object across the world independent of physics or animations or anything like that. I use it all the time in Unreal Engine 4, so I miss it a lot modding this engine. I'd looked for something like Rotate as well but somehow missed it, so I'm hoping this exists as well. That said, I think it's important to know what causes this problem where specific references can't be moved but other references with the same base ID can. Link to comment Share on other sites More sharing options...
Mktavish Posted April 18, 2018 Share Posted April 18, 2018 Slide as in move something across the X or Y axis ? Ya sure with "SetPos to GetPos + 1" running with a timer. Here is a script I made for moving water up / down ... but can substitute "Z" with X or Y This is a script I borrowed and changed from this mod https://www.nexusmods.com/newvegas/mods/61807 ~~~~~~~~~~~~~SCN MyWaterMovingScript Short Open Float WaterPosZ ; this is for editing the position of the waterFloat Move ; and this is for moving the waterFloat StartZ ; this is for returning the water pos before deletingFloat TimerFloat Time ; this gets the timer tor the if timer line Begin OnActivate If Move == 0 Set Move to 1 If Open == 0 Set StartZ to MyPlacedWater01Ref.getpos z ; gets the starting z pos so it can be disabled Set Open to 1 endif endif End Begin GameMode IF Open == 1 Set WaterPosZ to MyPlacedWater01Ref.getpos z + 1 ; use " - " for moving water down Set Time to .001 ; this is one value for the speed the object moves if Timer < Time Set Timer to Timer + GetSecondsPassed else if Move > 0 ; this runs everytime after activated if Move < 101 ; <<< Water will stop moving here ...set this to the Z pos difference between ;bottom and top +1 MyPlacedWaterRef.SetPos z WaterPosZ ; When this runs the reference moves Set Time to Time + .001 Set Move to Move + 1 ; repeats steps If Move > 100 ; <<< Same diff number above - 1... now the water stops MyPlacedWater02Ref.Enable MyPlacedWater01Ref.SetPos z StartZ ;enable player controls here if you had to disable them MyPlacedWater01Ref.Disable Set Open to 0 Set Move to 0 endifendif endifendif endifEnd~~~~~~~~~~~~~~~~~~~~ And the caveat with moving water ... is it's information for what makes an actor go into swimming mode , or holding their breath. Will not move with the visual surface. So you have to enable a new placeable water at the height the old one traveled. Plus you cannot disable the old one until returning the surface back to where it started without crashing the game. So there may be other objects that suffer bugs from becoming separated like that ? I know the collision information of a platform won't travel either.Honestly I'm not really sure what you are talking about , with some references cannot be moved ?Is the crank wheel your talking about just a static , or is it an Activator / moveable static ?But I have had a creature turret , freak out on it's physics when trying to rotate it , was throwing in movements on it's facing up/down angle instead of only rotating on the Y axis. So I ended up having to use the zaxeye creature , and set it immobile. Which I thought was weird the angle of it's weapon would rotate , but then not it's 3D render. I haven't messed with moving on two axis at once yet ... but will be attempting it for a player jetpack feature in a mod I'm working on to simulate an rts game element (the isometric view). Somebody has already done it though , which I thought we were discussing it on somebodies mod request thread awhile back ??? Link to comment Share on other sites More sharing options...
EPDGaffney Posted April 18, 2018 Author Share Posted April 18, 2018 Slide as in move something across the X or Y axis ? Ya sure with "SetPos to GetPos + 1" running with a timer.That's kind of what I thought we had to do for rotation as well, and what my initial script looked like (but with SetAngle instead of SetPos). What I'm saying is instead of 1) going to the trouble of doing this, and 2) trying to use this function on references that just won't let you, is there a function like Rotate but for locational transform modification instead of angle transform modification? And I still need to know what causes this error. Link to comment Share on other sites More sharing options...
Mktavish Posted April 18, 2018 Share Posted April 18, 2018 There is something funky with SetAngle err GetAngle , I'm not sure. Uhmattbravo was messing with it on his creature car mod , and reported wasn't doing what he wanted. But as far as I know ... SetPos and GetPos work just fine. To move an object reference along an axis. Isn't that what you mean by locational transform modification ? You just add or take away from it's positional data. The scripting doesn't really need to be as complicated as I made it , but it has other things going on with it than just moving an object. Link to comment Share on other sites More sharing options...
EPDGaffney Posted April 18, 2018 Author Share Posted April 18, 2018 I haven't run into this problem with a script yet, but here and there, if I use SetPos in the console, it will give me a message that the reference 'cannot be moved'. When my SetAngle script wasn't working, I tried via console and got that exact message. Again, what's very odd is that spawning another object with the same base ID will spawn one that I can move and turn using SetPos and SetAngle. So it's not the NIF or what its Type is in the GECK. In my experience so far, this has happened only with objects of the Static form type. Link to comment Share on other sites More sharing options...
dubiousintent Posted April 19, 2018 Share Posted April 19, 2018 ... what's very odd is that spawning another object with the same base ID will spawn one that I can move and turn using SetPos and SetAngle. So it's not the NIF or what its Type is in the GECK. In my experience so far, this has happened only with objects of the Static form type.Did you compare flags between the "unmovable" object and the newly spawned one? "Obstacle", "Visible When Distant", or "Has Tree LOD" for instance? -Dubious- Link to comment Share on other sites More sharing options...
EPDGaffney Posted April 19, 2018 Author Share Posted April 19, 2018 Good call but most of them are greyed out to begin with. It's a persistent reference that is initially disabled but in recent memory, I tried it on an object that started out enabled, and if it was a persistent reference, that was a mistake. But I think I've just realised the problem: it's scaled. This engine gets a bit weird about that. Have to test and google. Link to comment Share on other sites More sharing options...
Recommended Posts