Search the Community
Showing results for tags 'math'.
-
I have a platform which is thin and round, big enough for the player to just stand on. I want the player to be able to summon it which I can do with moveto or placeatme However depending on where I am standing say the platform will be tilted part in the ground or in a wall even. How can I call an object that will fall flat on the ground and not collide with other objects ? I know maybe there is fancey math like Actor PlayerRef = Game.GetPlayer() Portal.MoveTo(PlayerRef, 120.0 * Math.Sin(PlayerRef.GetAngleZ()), 120.0 * Math.Cos(PlayerRef.GetAngleZ()), PlayerRef.GetHeight() - 35.0) But this is way above the ground and suspends the object in mid air, if I play with the numbers I can get the object close to the ground but then it is not always level and sometimes is tilted into the ground. Any Idea's ? Thanks
-
[LE] SKI UI, Multiply output subtracts 1 from result.
Guest posted a topic in Skyrim's Creation Kit and Modders
I don't know why this is happening, but I have a simple math operation that takes a global variable, multiplies it by 0.1. Normally this outputs like it should, but if I use an MCM programmed for SKI UI to adjust the 0.1 and put it back, it outputs the value by 1 less then it should. This script fragment is the main one that runs this calculation: gTotalPaid.GetValue() = 5,000 * gPercent.GetValue() = 0.1 fTot = (gTotalPaid.GetValue() * gPercent.GetValue()) gTotIncStat.SetValue(fTot) fTot outputs 500 if untouched, but if I move it up to 0.11 and back to 0.10, it then outputs 499. This isn't the full code, but this is what I use for my SKU UI. These are the important pieces of the code that actually do the adjustments: What's weird is it will subtract 1 from only some multiples. Multiples of 0.05 generally subtract 1, but not all. 0.08 will even give me a flat 400. Does anyone know why Papyrus calculates like this? It shouldn't be rounding up/down since 0.10 should be outputting whole numbers. It just takes 1 away from the result on some multiplier values for seemingly no reason. -
Hi everybody, hope you are doing well ! Alright here is the deal : I am trying to create a house with a complex lighting system. Idealy, the feature that I am trying to implement are the following : Lightbulbs that change depending on the time of day and weather,Light beams that rotates with the time of dayCurtains and shutters that enable/disable the light beams and light bulbs First, let's consider a single window with one lightbulb, one lightbeam, one curtain and one shutter. The cell is behaving as an exterior : I duplicated the tamriel climate where all weathers are copies of the exterior ones except fog, sun light, ambient light and precipitaion are disabled. That way, only the sky is visible, and no light information are provided by the weather. When the player entered the cell, I assume I synchronized the interior weather with the exterior one. Now, the lightbulb will have its own script where a GameMode block calculate the light from the weather ambien and sun light thanks to OBSE functions. Yet, in the CSE render window, it seems the light is interpolated between the 4 time increments (dawn/noon/dusk/midnight). Anyone know the actual function used ? If not, how do you actually interpolate between 2 colors ? Next, because I can't attach an object script to the light beam, I will attach my script to an activator whose parent is the light beam. Then, a GameMode block will rotate the light beam depending on the gametime. Now, this I can't seem to get my fact straight. Because I want the player to be able to interact with the curtain and the shutters, these have to be activators. This seems like a good thing because I can parent the curtain to the lightbulb and the light beam and then disable them. Problem is, no matter who is the parent, the activator gets disabled. I can understand that if the parent is disabled, the child is too. But why does the parent gets disabled if the child is ? I even copy pasted some code from the game, and I get the same result. How can I disable and object, using an activator, without disabling the activator ? I tried going the trick from the CSE wiki tutorial where you duplicate the activator, parenting the duplicate to the other one and set its state as opposite. Problem is : because my activator is animated (there is an animation when the curtain opens or closes), I get weird result. Is there a way to control the animation state (begining/end) of an object ? Example : The curtain is opened, Player activates the curtain, Closing animation plays, once the script timer ends, I disable it The duplicate is thus enabled I would like this last stage to enable the duplicate in closed state, however it does not when I test my script. I know I could symply use the the reference of my objects but I intend to make the script as general as possible so that I only need a few that rely on parent/child relationship. But it seems to me that this is more like a link than an actual parent>child authority relationship. I hope you'll find the reading enjoyable if I was not clear enough, do not hesitate. Cheers, Erwan G.
