Jump to content

Recommended Posts

Posted (edited)

OnRaceSwitchComplete is the Event you would be looking for I believe, for that logic. It does need to be attached to either the player form directly (can't recommend that), a quest alias with the player in it or a magic effect that is affecting the player.

 

I've heard that it does prevents registering for animation events in aliases though, I don't actually know if that's true since I've actually never used the event myself

Edited by Arocide
Posted (edited)

When transforming, the player looses the magic effect ability but i already have player quest alias for the OnPlayerLoad. So that could be used?

It would put a OnLoad to check for race changes as a Safe Guard as well tho, but OnRaceSwitchComplete will be hugely more efficient than always running the IFs. Its a big one (at least thats what im aiming for), because after i make it efficient, need to add the player level and perks and everything to the formula as well. Helped a lot, as usual. Thanks man. xD

Edited by theimmersion
Posted (edited)
  On 4/10/2015 at 12:28 PM, theimmersion said:

When transforming, the player looses the magic effect ability but i already have player quest alias for the OnPlayerLoad. So that could be used?

 

You could or you could attach it as another, stacking a few scripts on an alias is fine.

Edited by Arocide
Posted (edited)
  On 4/10/2015 at 12:25 PM, Arocide said:

I've heard that it does prevents registering for animation events in aliases though, I don't actually know if that's true since I've actually never used the event myself

 

Might be, it does in quest script. But doesnt matter, because the event would actually say to my quest script that the race changed and than after the change, with some delay, the code would reapply the animation registration again but only that time instead of all the time. + there would be the maintenance on load where its always a safe guard. And it will be in the description (if the mod bugges, quick save/load) that should be an easy but a good way to fix stuff.

 

About the Onload could be used, yeah i meant like that alias could be used, not the function. My bad. xD

Thats what i needed. So i can stack a side script for the transformation. Awesome. And God d*mmit. Got lots of recoding to do. xD

I smell recode from scratch again. xD i do that a lot. xD

Edited by theimmersion
Posted
  On 4/10/2015 at 12:46 PM, theimmersion said:

 

  On 4/10/2015 at 12:25 PM, Arocide said:

I've heard that it does prevents registering for animation events in aliases though, I don't actually know if that's true since I've actually never used the event myself

 

Might be, it does in quest script. But doesnt matter, because the event would actually say to my quest script that the race changed and than after the change, with some delay, the code would reapply the animation registration again but only that time instead of all the time. + there would be the maintenance on load where its always a safe guard. And it will be in the description (if the mod bugges, quick save/load) that should be an easy but a good way to fix stuff.

 

 

That sorta came out wrong, what I ment to say was that changing race apparently screws with it* I need a coffee. :sweat:

Posted (edited)

Wait, screws the ability to register for animations at all?

That might be a problem. But it worked fine when i transformed into a vampire. The only thing i needed to do is make the animation register constantly.

Maybe werewolves actually have different jump animation names or some names are different.

There is after all a few names for what logic would say same thing. JumpStart and JumpBegin and JumpUp. When human, only JumpUp for instance work.

Maybe the Werewolf actually uses JumpStart and makes you think you cant register after the transformation. Gonna test that out.
Also a simple fix, If getRace wolf, reg for jump start otherwise reg for jump up. That would do it.

Since you seem to know a lot about scripting, you know how to make a script update without needing to disable the mod completely?
When i change anything about a code and dont use a save file prior to installed mod or if i dont stop and start the script and quest the changes dont apply. Its like the old script is still available and it uses that instead of the new code. Very annoying and very inconviniante for mod users to update this way every time. Its especially annoying because its in that early progress and lots of stuff is getting changed on every update on the script.

 

As its stands, im gonna need to recode the whole script again from scratch. Partially wanting that as well because i made a mistake and didnt actually take in account something. The always run in the game. I assume many or enough players use the always run and my script is not coded for that. Its not something i can fix with a few changes (not safely and reliably anyway), its rather needing a whole redo. YEY *gun to the head* xD

Edited by theimmersion
Posted (edited)

I like to think I know a lot about scripting, whether or not I do... well that remains to be seen :D . Papyrus will save script state to saves, so variables, the currently running functions and the call stacks are all saved, there's a page on save files and how papyrus will handle different situations here. How people deal with updating scripts, well that differs from person to person I think. Most will (depending on what their scripts do) probably use the OnPlayerLoadGame() event to check for version changes and then update variables that need to be updated for the new version there (A short example of this is shown on the OnPlayerLoadGame page on the wiki).

 

You may find working in smaller chunks is better (and easier), personally I hate working with large script files I try to keep them under 500-600 lines as a general rule find it much easier to navigate but sometimes more can't be helped, usually it's pretty easy to see where you could split functionality. Calling Papyrus functions doesn't actually produce that much overhead so where you re-use a lot of script code you could probably place it in a function and work that into something shorter without sacrificing too much.

Edited by Arocide
Posted (edited)

Yeah if you know how to do it. I know the most base of it. Following the logic actually.

 

Like:

if lookForSomething

doSomething

endif.

 

Thats my knowledge. xD

And thats why its freakin huge. xD

 

Im gonna try and redo the whole script and see how compressed i can get it. Ill post the new script in the main post.

Havent started yet tho. Gathering some brain power. xD I should get it done withing this month. If easter doesnt steal too much time from me.

BTW, what you think about spliting some of the code into multiple scripts? Like Movement control one script and all the calculations in another?
Thats where i missed Fallouts scripting. I put every complicated and slow process code in one Base script and all the fast respond functions in another script calls stuff when needed from the Base script. No idea how to do that now.

And mostly because the variables are local now. And i dont think making 100 global variables is a good idea. xD

Edited by theimmersion
Posted (edited)

You can access a scripts properties from anywhere else if you so wish, you just need the scripts reference. Personally, I like to follow OOPs (Object Oriented Programming) single responsibility principle even though papyrus isn't technically OOP (well it is but it isn't) I just find it a useful guideline in thinking about how scripts should turn out. Single responsibility essentially just means it should only do one thing, what that thing is? well that is up to you. It could be Player Movement, it could be applying maintenance code that you need to run each game load, it could be monitoring for changes on an object and performing changes as required... Think of only one thing you want that script to do and stick with it. This doesn't mean start creating hundreds of script files which are extremely short but think of one general thing you want that script to do, and make it fulfill that purpose and that purpose only.

 

Well, that's how I like to approach it anyway if that works for you... well that's for you to decide.

Edited by Arocide
Posted

I actually did that but in Fallout. Like i said, i set up the base script. For instance, if this was in fallout, id make the calculations in one base script and attach everything else to it. But in FO, i could use the variables from the base script and further manipulate those variables with everything else in that smaller script that just needs to aplly the action.

For instance:

I want all the stuff get calculated in one script and than just need one small script thats fast that will apply the calculated values to the player movement that were calculated by the slow script. The calculations doesnt need to be fast, they can have latency, the applied modifications must be fast.

Thast the general concept in my head.

But in Papyrus its much more complicated.

Script properties? like GlobaVariable property Actor property, Race property etc? Those can be accessed or rather the values of those from any script?

How?! I dont care for the variables or the property itself and what not, but if i can access the value of that property, please tell me how.
That can ease up a lot. Thats essentially what i did in FO scripts. How do i tell one script about the property of another script?
I knew there are like functions you can write in one and use by another script but i dont think i need that nor do i know how to do that either. :(

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...