Keldis Posted February 18, 2012 Share Posted February 18, 2012 (edited) oh and heres my "junk" code, dont say i did not warn you :P Scriptname TranslateTest extends activemagiceffect Conditional import Utility import form import game import debug event OnEffectStart(Actor Target, Actor Caster) While(Caster.IsEquipped(FlyRing)) if (Caster.GetRace() != DragonRacePlayer) Caster.setrace(DragonRacePlayer) endif int Value = FlyTest.GetValueInt() ObjectReference CasterT = GetPlayer() if (Value == 0) ForceFirstPerson() FlyTest.SetValue(1) Wait(2) endif if (Value == 1) ForceThirdPerson() endif SendAnimationEvent(CasterT ,"FlyStartHover") float pX = Caster.GetPositionX() float pY = Caster.GetPositionY() float pZ = Caster.GetPositionZ() float aX = Caster.GetAngleX() float aY = Caster.GetAngleY() float aZ = Caster.GetAngleZ() float i = pz -(500) float ci = pz + (500) if (ax <= 0 ) ;&& Caster.HasMagicEffect(Fly) Caster.TranslateTo(px,py,i,ax,ay,az,1000,1000) ;messagebox("<0") Wait(1) endif if (ax >= 0) ; && Caster.HasMagicEffect(Fly) Caster.TranslateTo(px,py,ci,ax,ay,az,1000,1000) ;messagebox(">0") Wait(1) endif endwhile EndEvent event OnEffectFinish(Actor Target, Actor Caster) Flytest.SetValue(0) endevent ; Event onEffectFinish(Actor Target, Actor Caster ) ; While(TRUE) ; endwhile ; Endevent ObjectReference property Spawner auto ObjectReference property PlayerRef auto MagicEffect Property Fly auto Idle Property FlyStartHover auto Race Property DragonRacePlayer auto Idle Property SwimStop auto int Property MoveType auto Conditional Idle Property CharacterMoveStart auto Armor Property FlyRing auto GlobalVariable Property FlyTest auto Int Property NewProperty Auto Conditional Edited February 18, 2012 by DarkenDe Link to comment Share on other sites More sharing options...
porroone Posted February 18, 2012 Share Posted February 18, 2012 Cool, It didnt occur to me to use the script as a magiceffect, I have been running it on actor, which caused the script sometimes to stick even if you removed the whole mod (only removing the compiled script fixed the problem). Link to comment Share on other sites More sharing options...
Galacticat42 Posted February 18, 2012 Share Posted February 18, 2012 Is there any way to detect keypresses? If so I'm gunna be all over that. Link to comment Share on other sites More sharing options...
porroone Posted February 18, 2012 Share Posted February 18, 2012 Im afraid not, you can get IsRunning or IsSprinting but its not of most use, we will have to wait for SKSE for those awsome functions they added to the scripting languages of old bethesda games like fallout3 or oblivion. Link to comment Share on other sites More sharing options...
Keldis Posted February 18, 2012 Share Posted February 18, 2012 (edited) yeah the getkeypress command is really something bethesda could have added in the firstplace, or something to detect Xbox360 Controller keys (i play with one)but lets hope that the SKSE team will come up with something we can use :P Edited February 18, 2012 by DarkenDe Link to comment Share on other sites More sharing options...
Ashven Posted February 19, 2012 Share Posted February 19, 2012 (edited) Do you gentlemen think this could be translated to climbing applications? I'm not exactly programming oriented and the scripts make no sense to me, but what I would ask is could this be modified to move only upwards if the sprint key is pressed and the player is walking forwards, but not moving? (Assusming that your not moving means you're walking into a wall.) Animations do not matter whatsoever. Edited February 19, 2012 by Ashven Link to comment Share on other sites More sharing options...
zorndyken Posted February 19, 2012 Share Posted February 19, 2012 cool, i hope to see angel / demon wings armor with this mod Link to comment Share on other sites More sharing options...
jimhsu Posted February 19, 2012 Share Posted February 19, 2012 (edited) (code) That concept does look solid. However, I still think we get a OnKeyPressed function to enable state changing, unless someone can come up with a creative hack alternative. Not thinking of anything right now as far as this problem is concerned. If we do manage to find an OnKeyPressed substitute, instead of making separate while loops, I would probably prefer summing up the key inputs and finding the result incidence angle, instead of having the angle controls be binary. I.e, if the player presses both the up and right arrows, the angle of incidence would be 45 degrees in the XY plane (assuming you define the horizontal and vertical speeds to be the same). Since we have real math functions now, I hope that will be somewhat easier than in Oblivion. This approach would probably lead to a much finer granularity approach and generally better results. Blending havok animations is another story entirely, and I don't really want to touch that right now. Edited February 19, 2012 by jimhsu Link to comment Share on other sites More sharing options...
porroone Posted February 19, 2012 Share Posted February 19, 2012 Do you gentlemen think this could be translated to climbing applications? I'm not exactly programming oriented and the scripts make no sense to me, but what I would ask is could this be modified to move only upwards if the sprint key is pressed and the player is walking forwards, but not moving? (Assusming that your not moving means you're walking into a wall.) Animations do not matter whatsoever. Yea that could be done easy using the translate function, but we need more functions, for example in order to climb you would need to detect if there is an object in front of the player and what kind of object it is ( we dont want it climbing players! (or maybe we do) ), then a way to mesure the object, so the it knows when stop climbing, in most object base scripting languages I worked with, had those functions, and this game does aswell they just didnt include them in papyrus. Link to comment Share on other sites More sharing options...
Keldis Posted February 19, 2012 Share Posted February 19, 2012 (edited) I agree, what i now tried is the basic fo3 and Oblivion options (Placing Collision under your feet, or placing Water etc) But it does not really work, the moveto command is really resource consuming with the way i did this, but i found another neat option that i used in my progress mod seen in the video below, it is an ini setting called "fInAirFallingCharGravityMult" setting this to 0 under the [Havok] settings (the option needs to be added first) lets the player float in their current position, the default value is 1.35, and this is what i came up with using the SetIniFloat command in a script. EDIT: Its a little bit bugged for the moment and only for testing until a GetKeyPress option will be available. Edited February 19, 2012 by DarkenDe Link to comment Share on other sites More sharing options...
Recommended Posts