AlCiao Posted March 27, 2012 Share Posted March 27, 2012 The race-swapping trick, as I understand, was also used by JoshNZ in his AP mod. The default features thing applies there, too, but there's *got* to be a way to keep that from happening. After all, when a PC turns into a vampire (a new race), they don't switch to default features. Link to comment Share on other sites More sharing options...
porroone Posted March 27, 2012 Share Posted March 27, 2012 (edited) Thats an excellent point now that you mention it, ill take a look on how they do the transformation, see if I can get something out of it, thanks a lot for the idea ! :DEdit: got it to keep the facial traits but for some reason the hair resists xDEdit2: Ok AlCiao deserves an award for the best feedback ever, got it working keeping all the character's traits, I just duplicated the Vamp race, removed the vampire traits, and used that as a base, in case anyone finds himself in a similar situation. Thanks a lot AlCiao, now I really have all I need to get this to work, the only thing left to do is to improve the custom animations. Edited March 27, 2012 by porroone Link to comment Share on other sites More sharing options...
porroone Posted March 28, 2012 Share Posted March 28, 2012 Ok, got it working!! the only issue now it wont be compatible with custom races, but if needed I could add compatibility, shouldnt be too hard.This is how my code looks like now, I still need to add some animevents to it but its almost completed: Scriptname __PlyFly extends activeMagicEffect Armor property RingFF auto Actor property Player auto import utility import form import game import debug import ObjectReference perk property NoFallDmg auto Action property JumpS auto race DefaultRace race[] property FlyableRace auto race[] property NormalRace auto GlobalVariable property DirF auto GlobalVariable property DirB Auto GlobalVariable property DirR auto GlobalVariable property DirL Auto float bearing float elevation float speed float posx float posy float posz int i Event OnEffectStart(Actor Player, Actor Caster) Player = Game.GetPlayer() DefaultRace = Player.GetRace() CheckRace() Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",0) if Player.IsEquipped(RingFF) while Player.IsEquipped(RingFF) Fly() endWhile endIf endEvent function CheckRace() While i < 9 if DefaultRace == NormalRace[i] Player.SetRace(FlyableRace[i]) endif i += 1 endWhile endFunction function Fly() sendAnimationEvent(Player,"idlePlayer") if DirF.GetValueInt() == 1 || DirB.GetValueInt() == 1 || DirR.GetValueInt() == 1 || DirL.GetValueInt() == 1 sendAnimationEvent(Player,"moveStart") posx = Player.GetPositionX() posy = Player.GetPositionY() bearing = Player.GetAngleZ() elevation = Player.GetAngleX() posz = Player.GetPositionZ() if Player.IsSprinting() speed = 2000 else speed = 1000 endIf if DirF.GetValueInt() == 1 posx += math.sin(bearing)*speed posy += math.cos(bearing)*speed posz -= math.sin(elevation)*speed elseif DirB.GetValueInt() == 1 posx -= math.sin(bearing)*speed posy -= math.cos(bearing)*speed posz += math.sin(elevation)*speed elseif DirL.GetValueInt() == 1 posx += math.sin(bearing - 90)*speed posy += math.cos(bearing - 90)*speed posz -= math.sin(elevation)*speed elseif DirR.GetValueInt() == 1 posx += math.sin(bearing + 90)*speed posy += math.cos(bearing + 90)*speed posz -= math.sin(elevation)*speed endIf Player = Game.GetPlayer() Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1) else Player.StopTranslation() endIf endFunction Event OnEffectFinish(Actor Player, Actor Caster) Player.StopTranslation() Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",1.35) Player.SetRace(DefaultRace) endEvent Link to comment Share on other sites More sharing options...
xyks Posted March 30, 2012 Share Posted March 30, 2012 Ok, got it working!! the only issue now it wont be compatible with custom races, but if needed I could add compatibility, shouldnt be too hard.This is how my code looks like now, I still need to add some animevents to it but its almost completed: Scriptname __PlyFly extends activeMagicEffect Armor property RingFF auto Actor property Player auto import utility import form import game import debug import ObjectReference perk property NoFallDmg auto Action property JumpS auto race DefaultRace race[] property FlyableRace auto race[] property NormalRace auto GlobalVariable property DirF auto GlobalVariable property DirB Auto GlobalVariable property DirR auto GlobalVariable property DirL Auto float bearing float elevation float speed float posx float posy float posz int i Event OnEffectStart(Actor Player, Actor Caster) Player = Game.GetPlayer() DefaultRace = Player.GetRace() CheckRace() Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",0) if Player.IsEquipped(RingFF) while Player.IsEquipped(RingFF) Fly() endWhile endIf endEvent function CheckRace() While i < 9 if DefaultRace == NormalRace[i] Player.SetRace(FlyableRace[i]) endif i += 1 endWhile endFunction function Fly() sendAnimationEvent(Player,"idlePlayer") if DirF.GetValueInt() == 1 || DirB.GetValueInt() == 1 || DirR.GetValueInt() == 1 || DirL.GetValueInt() == 1 sendAnimationEvent(Player,"moveStart") posx = Player.GetPositionX() posy = Player.GetPositionY() bearing = Player.GetAngleZ() elevation = Player.GetAngleX() posz = Player.GetPositionZ() if Player.IsSprinting() speed = 2000 else speed = 1000 endIf if DirF.GetValueInt() == 1 posx += math.sin(bearing)*speed posy += math.cos(bearing)*speed posz -= math.sin(elevation)*speed elseif DirB.GetValueInt() == 1 posx -= math.sin(bearing)*speed posy -= math.cos(bearing)*speed posz += math.sin(elevation)*speed elseif DirL.GetValueInt() == 1 posx += math.sin(bearing - 90)*speed posy += math.cos(bearing - 90)*speed posz -= math.sin(elevation)*speed elseif DirR.GetValueInt() == 1 posx += math.sin(bearing + 90)*speed posy += math.cos(bearing + 90)*speed posz -= math.sin(elevation)*speed endIf Player = Game.GetPlayer() Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1) else Player.StopTranslation() endIf endFunction Event OnEffectFinish(Actor Player, Actor Caster) Player.StopTranslation() Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",1.35) Player.SetRace(DefaultRace) endEvent  So can we expect a release any time soon? Link to comment Share on other sites More sharing options...
Galacticat42 Posted March 30, 2012 Share Posted March 30, 2012 Awesome work Porroone! I can't wait to implement the finished custom race-compatible code to my mod. You're the best! :thumbsup: Link to comment Share on other sites More sharing options...
porroone Posted March 30, 2012 Share Posted March 30, 2012 Tomorrow I have to work all day, so ill take the laptop and in the free time I will finish up some animations and do a proper release, I was really hoping for a release of skse, which would make things easier, like in terms of installing, there is still the need to include the fInAirFallingCharGravityMult to the config, and of course the problem with collisions. Link to comment Share on other sites More sharing options...
Bazinix Posted March 30, 2012 Share Posted March 30, 2012 http://youtu.be/8K8KQlZJcv8?t=2m41s Number 36... Link to comment Share on other sites More sharing options...
Skyes666 Posted April 1, 2012 Share Posted April 1, 2012 Tomorrow I have to work all day, so ill take the laptop and in the free time I will finish up some animations and do a proper release, I was really hoping for a release of skse, which would make things easier, like in terms of installing, there is still the need to include the fInAirFallingCharGravityMult to the config, and of course the problem with collisions. I'm looking forward to seeing what you'll come up with. Link to comment Share on other sites More sharing options...
Arios1570 Posted April 2, 2012 Share Posted April 2, 2012 Ok, got it working!! the only issue now it wont be compatible with custom races, but if needed I could add compatibility, shouldnt be too hard.This is how my code looks like now, I still need to add some animevents to it but its almost completed: Scriptname __PlyFly extends activeMagicEffect Armor property RingFF auto Actor property Player auto import utility import form import game import debug import ObjectReference perk property NoFallDmg auto Action property JumpS auto race DefaultRace race[] property FlyableRace auto race[] property NormalRace auto GlobalVariable property DirF auto GlobalVariable property DirB Auto GlobalVariable property DirR auto GlobalVariable property DirL Auto float bearing float elevation float speed float posx float posy float posz int i Event OnEffectStart(Actor Player, Actor Caster) Player = Game.GetPlayer() DefaultRace = Player.GetRace() CheckRace() Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",0) if Player.IsEquipped(RingFF) while Player.IsEquipped(RingFF) Fly() endWhile endIf endEvent function CheckRace() While i < 9 if DefaultRace == NormalRace[i] Player.SetRace(FlyableRace[i]) endif i += 1 endWhile endFunction function Fly() sendAnimationEvent(Player,"idlePlayer") if DirF.GetValueInt() == 1 || DirB.GetValueInt() == 1 || DirR.GetValueInt() == 1 || DirL.GetValueInt() == 1 sendAnimationEvent(Player,"moveStart") posx = Player.GetPositionX() posy = Player.GetPositionY() bearing = Player.GetAngleZ() elevation = Player.GetAngleX() posz = Player.GetPositionZ() if Player.IsSprinting() speed = 2000 else speed = 1000 endIf if DirF.GetValueInt() == 1 posx += math.sin(bearing)*speed posy += math.cos(bearing)*speed posz -= math.sin(elevation)*speed elseif DirB.GetValueInt() == 1 posx -= math.sin(bearing)*speed posy -= math.cos(bearing)*speed posz += math.sin(elevation)*speed elseif DirL.GetValueInt() == 1 posx += math.sin(bearing - 90)*speed posy += math.cos(bearing - 90)*speed posz -= math.sin(elevation)*speed elseif DirR.GetValueInt() == 1 posx += math.sin(bearing + 90)*speed posy += math.cos(bearing + 90)*speed posz -= math.sin(elevation)*speed endIf Player = Game.GetPlayer() Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1) else Player.StopTranslation() endIf endFunction Event OnEffectFinish(Actor Player, Actor Caster) Player.StopTranslation() Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",1.35) Player.SetRace(DefaultRace) endEvent Awesome, have so many custom races I want to make able to fly, however, is there a way to make it so only those races can fly or set it as a race ability? I'm thinking set it as a power that can be mapped to the thuum slot. Would also be cool to make it require being in the air first, Say, you're running off a ledge, then take flight. I'm not a coder, so I don't know how difficult this could be to tack on, so if this is a "That will be simple enough" that's cool, but if it's a "How do you expect me to do that?" then feel free to ignore it. Link to comment Share on other sites More sharing options...
Cipherthe3vil Posted April 2, 2012 Share Posted April 2, 2012 I just thought I'd note here. There's an "Ascend" animation that if someone could apply a little ragdoll to it could make for a decent type of flight anim. More like your flying through use of Power or Floating, rather then personal effort. Link to comment Share on other sites More sharing options...
Recommended Posts