Jump to content

Help Cast Function


OvadWolfeye

Recommended Posts

That should work.

 

I am newly awaken so... Well the trigger can be any activator I guess and I use some of those green invisible ones myself.

 

When I saw the word home I thought about this:

I use a ladder to climb home and I looked at the Summonable Private Quarter home mod to see how that author solved it and I have permission to use all stuff in that mod as well, as I did add everything from it to my mod and I used that mod until I felt I grew out of that tiny space, so I took all those tools with me to my new flat. It is also there that shrine is placed well in both homes that I did mention earlier. So peek at it to get ideas how to solve some stuff as all the scripts in that mod are brilliant - simple but brilliant and the spell works too.

 

When he place the portal, he makes sure it ends up in front of the player, using trigonometric calculations, with sinus for X and Cosinus for Y and it works great so I use it on my ladder home and I will use it later on when I will make my own Mark and Recall spells, as I plan to add 2 as 9 slots is not enough but 18 might be, well I make 3 spells anyway with 27 slots, to be 100% sure. The ladder also face the player.

 

In your case with an invisible trigger, it doesn't matter where the object lands but when I made my ladder I had to do like this to get it to work. I can add the whole bloody script here but first let me explain what it does exactly or how or rather what your trigger should do every frame as you try to do everything with in the same frame, and that should not work but when I made my ladder home, I learned it the hard way.

 

It uses 3 scripts, one spell, one script on the ladder and also a questscript.

 

When the trigger is home, disable it so start with it disabled, either via CS or OnLoad and also make a timer

  1. Move the trigger to you and exit the script with return
  2. Let the time go a couple of microseconds...
  3. Enable the trigger
  4. Exit the script and let time go again a couple of frames
  5. Cast the spell
  6. Exit the script again
  7. Move the trigger home and disable it

When you use the boots, it will still feels like everything is done immediate, as we talk about microsecond pauses here. Even if you use a second pause all together, it will feel fast.

 

Do you want me to add all my 3 scripts here so you can see what they all are doing in detail? Using 3 scripts was the only proper way I could use to get this to work as it also includes a save game (Optional setting in the house settings that is turned of by default), which is very nasty to use in a spell because if the game crash when saving it with a spell, then that save gets useless... I think that was the main reason I had to use 3 scripts but you should be fine with 2 I think and it might be funnier to solve this in your own way than copy mine but I be happy to share them if you want me too. :smile:

 

Enable and disable?

 

Well the collision sometimes did not follow the object properly, specially if you recast the spell and i do need the collision to be where the activator is but your trigger do not but do it anyway in case... Doing a disable and enable pulls the object and collision together for sure but not always in the same frame so that is one reason to use a short pause between them.

Edited by Pellape
Link to comment
Share on other sites

  • Recently Browsing   0 members

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