Jump to content

porroone

Members
  • Posts

    237
  • Joined

  • Last visited

Everything posted by porroone

  1. Yea I figured that much like 5 days ago, thats why I made a flying ring instead, you cant get the x-plane while mounted, if you do find a way I promise ill make a religion out of your person.
  2. Well after doing some debugging I know exactly whats wrong, basically it doesnt get the ring, thats why the IsEquipped function doesnt run anything, funny thing adding a 2nd script that returns the ring works, so I think ill stick to that. Edit: Well I just have no idea on how to call the damn ring inside the script if the script is inside the ring, tried adding the armor as "Armor property FlightRing auto" then went to properties, look for the damn ring there, ok, save, I have a debug.MessageBox that shows me the name of the item and it returns None, if I try with "self" which usually returns the object is running the script it returns something like name of the script + inContainer or something like that, but still the IsEquipped function doesnt recognaise it as valid, so the only way I see to do this is adding the script to the player, its the only way this can work. Edit2: Anyway the actor thing works but I cant seem to play the animations and I dont know why, here is the new working code, needs to be added to Player: Scriptname __PlyFly extends Actor Idle property flyAnim auto Armor property RingFF auto Actor property Player auto import utility import form import game import debug import ObjectReference float bearing float elevation float speed float posx float posy float posz Event OnObjectEquipped(Form RingFF, ObjectReference akObjectReference) Player = Game.GetPlayer() if Player.IsEquipped(RingFF) Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",0) while Player.IsEquipped(RingFF) Fly() endWhile endIf endEvent function Fly() if Player.IsRunning() posx = Player.GetPositionX() posy = Player.GetPositionY() posz = Player.GetPositionZ() bearing = Player.GetAngleZ() elevation = Player.GetAngleX() if Player.IsSprinting() speed = 5000 else speed = 1000 endIf if bearing < 90 posx += (bearing)*speed posy += (90 - bearing)*speed elseif bearing > 90 && bearing < 180 posx +=(180 - bearing)*speed posy +=(90 - bearing)*speed elseif bearing > 180 && bearing < 270 posx += (180 - bearing)*speed posy += (bearing - 270)*speed elseif bearing > 270 posx += (bearing - 360)*speed posy += (bearing - 270)*speed endif posz = Player.GetPositionZ() - (elevation*(speed*2)) PlayIdle(flyAnim) Player.TranslateTo(posx,posy,posz,Player.GetAngleX(),Player.GetAngleY(),Player.GetAngleZ(),speed,1) else Player.StopTranslation() endIf endFunction Event OnObjectUnequipped(Form RingFF, ObjectReference akObjectReference) Player.StopTranslation() Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",1.35) endEvent
  3. Well for some reason I cant get it working now, I made a standalone mod (My original ring was inside a custom mod I had) and it just doesnt work, god knows why.
  4. Ok after what you said I did some debugging and turns out you are right, the script needs to be attached to the actor instead of the ring, which kind of sucks, anyway around it ? Edit: ok this is driving me nuts, I cant get it working now.
  5. Get directional velocity, there is a conditional function that returns it, but its ok I found a workaround.
  6. Yea I do use PlayerRef, maybe you need to define the Armor property aswell, I always do it in case, but I think that attaching the script to the ring should call the OnEquipped event when the player equips the ring, in any case use a Debug.MessageBox to see if its triggering it.
  7. Well after that bit of code (removing gravity) my ring works perfect now I might even make an official release, I just need to find a better animation, the one im using right now its kind of glitchy. Edit: here is the code im currently using, this one works perfect. Scriptname __PlyFly extends ObjectReference Idle property JumpFall auto Armor property DuneFlyingRing auto Actor property Player auto import utility import form import game import debug import actor float bearing float elevation float speed float posx float posy float posz float move float dtime Event OnEquipped(Actor Player) Debug.MessageBox("motherf***er") Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",0) while Player.IsEquipped(DuneFlyingRing) Fly() endWhile endEvent Event OnUpdate() if Player.IsRunning() && move == 1 debug.notification("am i running") Fly() endIf endEvent Event OnTranslationComplete() move = 0 Fly() endEvent function Fly() if Player.IsRunning() posx = Player.GetPositionX() posy = Player.GetPositionY() posz = Player.GetPositionZ() bearing = Player.GetAngleZ() elevation = Player.GetAngleX() speed = 1000 if bearing < 90 posx += (bearing)*speed posy += (90 - bearing)*speed elseif bearing > 90 && bearing < 180 posx +=(180 - bearing)*speed posy +=(90 - bearing)*speed elseif bearing > 180 && bearing < 270 posx += (180 - bearing)*speed posy += (bearing - 270)*speed elseif bearing > 270 posx += (bearing - 360)*speed posy += (bearing - 270)*speed endif posz = Player.GetPositionZ() - (elevation*speed) Player.PlayIdle(JumpFall) Player.TranslateTo(posx,posy,posz,Player.GetAngleX(),Player.GetAngleY(),Player.GetAngleZ(),speed,1) RegisterForSingleUpdate(0.2) if Player.IsSprinting() move = 0 endIf else Player.StopTranslation() endIf endFunction Event OnUnequipped(Actor Player) Player.StopTranslation() Debug.MessageBox("unequipped") Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",1.35) endEvent
  8. Wow that looks very promising, so If I understand it correctly basically what you did is changing the gravity on the player when the ring is equipped, then use that to hover up, take off the ring and thats the part that I dont get, how does it slowly falls down ? shouldnt you fall instantly to the ground when you take off the ring ? Im going to mess with that stuff right noww hehe thanks a lot. Edit: After reading it properly I see it sets the gravity mul, that explains why it does fall slowly, one thing tho where did u find that setting ?
  9. 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.
  10. Yea I think sadly, we all contemplate the limitations of papyrus, I am kind of dissapointed, i really expected more and i know they could had added a shitload more of functions, probably they want to limit what we develope so they can release stuff like flying mounts and s*** in the form of DLC, and then we will get the cool s***.
  11. I think I know why it doesnt compile the function, when you extend I think it takes the default script on the bsa try to import it instead: Import ActorBase I got my functions to compile right, problem was they didnt return the value I wanted, maybe its different in your case, its worth trying.
  12. 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.
  13. 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).
  14. Yes, post it, maybe we can help each other since we are trying to do the same. The funny thing is that you can actually get a flying dragon by just using animations, creating whats called a behavior, but Its hard, the only thing I managed to do is make the dragon mount go to the hover animation when I press the jump key. Also the Animation tab offers a lot more conditionals functions than papyurs.
  15. One thing tho how expensive is to run the while loop ? my experience scripting on other games always showed me that loops are just good to itinerate through tables, usually most of the scripting language brings a "Think" function where you can set the next itineration in ms, thats why I went for the OnUpdate function, it looked like the logical choice, but after testing it a bit I discover it tends to pile s*** if the code runs faster than the interval you are setting.
  16. Yea its the best animation I found to simulate the flight animation. I found a glitch tho, when you are going up, it plays the endJump idle aswell, I think it has to do with some of the conditions the JumpFall idle has so it plays the animation but after a few seconds it looks like its stepping down from a jump, im not sure if im putting it clear enough for ppl to understand lol, english isnt my first language. Edit: Just read the comment above and the link doesnt work :/ but I like the loop idea, since I dont think the OnUpdate function is designed to do what im trying to do. Edit2: I watched the video and I think its a pretty neat job, I also got to the conclusion the only way to get a dragon to fly is to morph yourself into one, till skse brings us more functions for papyrus, making a rideable dragon seems out of the question, since you cant get the x-plane while riding :/
  17. Interesting mod, could you tell me if riding the horse in first person returns the angle x ?
  18. You can always try to define the function yourself if you say it works as a console command I dont see why wouldnt it in papyrus, basically go to the ActorBase script and type the following: Class Function SetClass() native Then compile and tell me if it works, I tried this myself yet, but with a different kind of function, if you do it this way and import ActorBase into your script, it will compile the function as a valid one.
  19. You can use states to avoid that from happening basically would look something like this. auto State Mount Event OnActivate() Debug.MessageBox("mounted") GoToState("riding") endEvent endState State riding Event OnActivate() Debug.Messagebox("dismount") GoToState("Mount") endEvent endState This way OnActivate should only be called once while dismounting.
  20. I kind of did something similar using a ring instead, when equipping it makes you fly and plays the fall iddle, I dont have any videos but here is the code if someone is interested. Scriptname __PlyFly extends ObjectReference import Actor Idle property JumpFall auto Armor property DuneFlyingRing auto Actor property player auto float bearing float elevation float speed float posx float posy float posz float move float dtime Event OnEquipped(actor player) RegisterForUpdate(0.01) player.PlayIdle(JumpFall) player.SetMotionType(Motion_Keyframed) endEvent Event OnUpdate() if player.IsRunning() UnregisterForUpdate() posx = player.GetPositionX() posy = player.GetPositionY() posz = player.GetPositionZ() Fly() else endIf endEvent function Fly() bearing = player.GetAngleZ() if player.GetAngleX() > 10 elevation = -50 elseif player.GetAngleX() < -10 elevation = 50 elseif player.GetAngleX() > -10 && player.GetAngleX() < 10 elevation = 0 endif speed = 10000 if bearing < 90 posx += (bearing)*100 posy += (90 - bearing)*100 elseif bearing > 90 && bearing < 180 posx +=(180 - bearing)*100 posy +=(90 - bearing)*100 elseif bearing > 180 && bearing < 270 posx += (180 - bearing)*100 posy += (bearing - 270)*100 elseif bearing > 270 posx += (bearing - 360)*100 posy += (bearing - 270)*100 endif posz = player.GetPositionZ() + (elevation * 100) player.PlayIdle(JumpFall) TranslateTo(posx,posy,posz,player.GetAngleX(),player.GetAngleY(),player.GetAngleZ(),speed,1) RegisterForSingleUpdate(0.01) endFunction Event OnUnequipped(Actor player) StopTranslation() UnregisterForUpdate() endEvent Its a bit glitchy, I dont advise using it lol, i made it mostly to check how script flight simulation worked.
  21. If it is possible, which im not sure, you would have to change the horse skeleton animation, check how the player's skeleton do it and try to import that to the horse skeleton.
  22. Yep that much I know, ive been messing with the setvehicle function, if I can somehow create an object with the animations and the model of a dragon, use the function to enable player controls on it I might be able to do it, otherwise I need some external function but I have no idea on how to add libs on papyrus, that would make things much simplier so if anybody knows something about I would appreciate the help.
  23. Funny thing is I think its related to the 3rd person camera, since if I set it to first person (while not riding ofc) and ask the script to do a Notication with that angle, the angles work great I get 0 while in center view, 90 while looking up and -90 while looking down.
  24. Ignore that code, yes is the akatosh one, i used it to see how the angles work in-game and I can only get the z-plane angle so the TranslateTo function will only get that angle, even if I set Player.GetAngleX,y,z on the translate argument it keeps returning 0, my guess is the dragon overrides the player view angle. I also tried the SetAngle function with the player's angle and even if looked up or down the dragon only moved in the z-plane. If you see on the script im also calling another script, one I've set on the player's to return the angles, that doesnt work either, right now im checking the code behind actor, objectreference and game, since I see some functions there that arent displayed on the Papyrus Reference page.
×
×
  • Create New...