Mage Phil Posted December 13, 2011 Share Posted December 13, 2011 Hello,this is my first topic I opened at all so i´m not sure if this is the correct section to put it into :| i started trying to edit a script in oblivion which makes mounts flying, in my opinion everything would work but it doesn´t -.- scn 12fliegen ; Saiden Storm's Mounted Flight Script :) ref Ich ; Earth Drake Referenceref FlightPlane ; Flight Plane Reffloat XPos ; X Position float YPos ; Y Positionfloat ZPos ; Z Positionfloat XAngle ; Flight Planes X Rotation Anglefloat Height ; Players X Angle, Used To Rotate FlightPlanefloat Direction ; Direction EarthDrake Is Facing ;Set up references and condition for Flight Begin Gamemode Set Ich to Player Set FlightPlane to SSPlattform SetIgnoreFriendlyHits 1 ;Set FlightPlane to Under EarthDrake when player is riding him and is running If Player.IsRunning == 1 Set XPos to Ich .GetPos X Set YPos to Ich .GetPos Y Set ZPos to Ich .GetPos Z Set Direction to Ich .GetAngle Z Set Height to (Player.GetAngle X) ; Adjusts Height to avoid the player from creating an unpassable wall or falling of the FlightPlane If Height < -30 Set Height to -30 Endif If Height > 40 Set Height to 40 Endif ; Reposition the FlightPlane so it is always under the EarthDrake in Flight If Player.GetDistance FlightPlane > 400 FlightPlane.SetPos X, XPos FlightPlane.SetPos Y, YPos FlightPlane.SetPos Z, ZPos Endif ; Sets the Tilt of the FlightPlane Based on EarthDrake Facing Direction and Player "X" Angle If Direction > 0 && Direction < 90 FlightPlane.SetAngle X, Height Set Height to -Height FlightPlane.SetAngle Y, Height Endif If Direction > 90 && Direction < 180 Set Height to -Height FlightPlane.SetAngle X, Height FlightPlane.SetAngle Y, Height Endif If Direction > 180 && Direction < 270 FlightPlane.SetAngle Y, Height Set Height to -Height FlightPlane.SetAngle X, Height Endif If Direction > 270 && Direction < 360 FlightPlane.SetAngle X, Height FlightPlane.SetAngle Y, Height Endif ; Makes it so if you are riding EarthDrake and Running the FlightIdle will play ;Set FlightPlane Above EarthDrake when Player is walking Elseif Player.isRunning != 1 Set XPos to Ich .GetPos X Set YPos to Ich .GetPos Y Set ZPos to Ich .GetPos Z + 1000 FlightPlane.SetPos X, XPos FlightPlane.SetPos Y, YPos FlightPlane.SetPos Z, ZPos ; Set FlightPlane to Above EarthDrake When Player is not riding him Endif End-------------------------------------------- scn 13fliegensetup ; This script is to set up mounted flight ref Ich ; Earth Drake Referenceref FlightPlane ; Flight Plane Referanceshort Follow ; Variable for the Follow Packageshort Wander ; Variable for the Wander Package ;Set up references and condition for Flight Begin Gamemode Set Ich to Player Set FlightPlane to SSPlattform ; Set the Flight Plane into the same cell as EarthDrake If FlightPlane.GetInSameCell Ich != 1 FlightPlane.MoveTo Ich Endif End ------------------------------- scn 14fliegenpeg ; This script is for a Mount that lets you fly ref Mount ; get a ref to Mountfloat xfactme ; position in x float yfactme ; position in yfloat zfactme ; position in z hightfloat height ; value that modifies position in zfloat direc ;The direction the player is facingfloat Speed ; How much the speed is reducedshort toggle ; used to se if direction is setshort toggle2 ; used to se if flying has happend ;Set up reference's and make player running = flight and player walking = idle Begin Gamemode Set Mount to Player Set Mount to GetSelf Mount.ResetFallDamageTimer if Player.IsRidingHorse == 1 && Player.GetDistance Mount< 512 if Mount.IsRunning == 1 Mount.PlayGroup FastForward, 0 set toggle to 0 set toggle2 to 1 ;Set the mounts speed set Speed to 15 * GetSecondsPassed ;Prevent excessive speeds if Speed > 4 set Speed to 4 endif ;Go up and down set zfactme to Mount.GetPos z set height to (Player.GetAngle X) * Speed set zfactme to zfactme - height ;The start position for movement set xfactme to Mount.GetPos x set yfactme to Mount.GetPos y set direc to Mount.GetAngle z ;Direction 0-89 if direc < 90 && toggle == 0 set toggle to 1 set yfactme to yfactme + ( 90 - direc ) * Speed set xfactme to xfactme + ( direc - 0 ) * Speed endif ;Direction 90-179 if direc < 180 && toggle == 0 set toggle to 1 set direc to direc - 90 set yfactme to yfactme + ( 0 - direc ) * Speed set xfactme to xfactme + ( 90 - direc ) * Speed endif ;Direction 180-269 if direc < 270 && toggle == 0 set toggle to 1 set direc to direc - 180 set yfactme to yfactme + ( direc - 90 ) * Speed set xfactme to xfactme + ( 0 - direc ) * Speed endif ;Direction 270-360 if toggle == 0 set toggle to 1 set direc to direc - 270 set yfactme to yfactme + ( direc - 0 ) * Speed set xfactme to xfactme + ( direc - 90 ) * Speed endif ;Move the horse in the direction Mount.SetPos y, yfactme Mount.SetPos x, xfactme Mount.SetPos z, zfactme endif ;Prevents the mount from falling Mount.SetScale 1.0 endif if Mount.IsRunning != 1 && toggle2 == 1 Mount.Playgroup Idle, 0 set toggle2 to 0 endifend ---------------------------------- the comments of the author don´t fit anymore :)thanks for help Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted December 13, 2011 Share Posted December 13, 2011 What exactly doesn't work with it?An obvious thing I can suggest is "never start your names with numbers"! The compiler will think it's a formid (hex-number) and nothing will work.Perhaps that's it already. If not, could you give some more information about what isn't working? Link to comment Share on other sites More sharing options...
Mage Phil Posted December 13, 2011 Author Share Posted December 13, 2011 It compiles but ingame nothing happens when i´m running :/ i´m going to change the names thanks ^^ Link to comment Share on other sites More sharing options...
Mage Phil Posted December 13, 2011 Author Share Posted December 13, 2011 i changed the names but ingame still nothing happens.maybe the ref mount is something like the word player and is always "there" i don´t know how to describe Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted December 14, 2011 Share Posted December 14, 2011 (edited) No, "Mount" is a simple reference variable. It is first set to the player, then immediately afterwards to the object the script is running on.I take it those scripts are also used in the same conditions as the originals from Saiden? That is Quest scripts are attached to quests which are either started at game start ("start game enabled") or by you yourself from console later ("startquest XXX"), and Object scripts are attached and running on the objects they're meant to be on, namely the mount creature in this case, and I don't really know what else which ones of them need to be attached to? As far as I can see there's at least no Spell script, but that could be the GameMode blocks misleading as well. Given the complexity of this mechanism I'd say you will need some debug outputs at one point or another, telling you a script line was actually reached, so you can better check at which point it goes wrong and why.If not even the first line gets executed, then the use of the scripts itself is wrong, for example. This could be either text message output or output to console, or you could just add a line like "Mount.ModAV Fatigue -50000" right after "set Mount to GetSelf" and hopefully the creature will drop down unconscious ingame... things like that. I personally like to use PlayMagicShaderVisuals or PMS and then codes for like fire or lightning or some such, and then I check the actors who should be affected by my script if they're really "on fire" or "electrocuted"... serves as a fine debug mechanism, but definitely serves as a cause for laughter as well :thumbsup: Edited December 14, 2011 by DrakeTheDragon Link to comment Share on other sites More sharing options...
Mage Phil Posted December 20, 2011 Author Share Posted December 20, 2011 sorry that it toook so long but my pc has been crushed by something :/i´ll try later because nothing works fine at the moment :[ thanks for the answers :D Link to comment Share on other sites More sharing options...
Recommended Posts