Jump to content

Photo

Let's do some maths and scripting

math scripting script oblivion modding mod obse construction set

  • Please log in to reply
1 reply to this topic

#1
TheMedievalsKnights

TheMedievalsKnights

    Old hand

  • Supporter
  • PipPipPip
  • 711 posts

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 day
  • Curtains 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.


Edited by TheMedievalsKnights, 04 May 2020 - 12:52 AM.


#2
TheMedievalsKnights

TheMedievalsKnights

    Old hand

  • Supporter
  • PipPipPip
  • 711 posts

I have a problem with the door that teleports me to my sell, If I attach my script to the door, it wont teleport me when I activate it. If I remove the script it does teleport me.

 

Door script :

Spoiler

 

QuestScript, it is just used to store my variables

 

Spoiler

 

Anyone knows what the issue is ?

I looked at some scripted doors from the game that do something before teleporting the player but they don't seem to have anything more in particular in their script.

 

Thanks a lot

 







Also tagged with one or more of these keywords: math, scripting, script, oblivion, modding, mod, obse, construction set

Page loaded in: 1.104 seconds