Advanced scripting functions

Post » Tue May 17, 2011 11:55 pm

I'm wondering if the following things are possible, whether in TES construction set default scripting functions, or with OBSE, or if a new .dll could be written as an OBSE plugin.

1: Control of the 3rd person camera: Let's say I made a room with a chest on one side and a door on the other. Now when the player approaches the chest, the 3rd person camera will most likely be facing the backside of the player looking at the chest. Now, let's say that when the player opens the chest, the door behind him/her closes and locks! Is it possible to force the 3rd person camera to rotate around the player until the door behind him/her is within the cameras view?

2: Pyro Heaven: Is there a way to, via script, detect a static object such as a tree or a house, and delete it / replace it with an active object? Let's say I really hate the owner of CottonCreek Farm, and I want to burn his farm down! I want to be able to drop a lit torch near his house, and via script, replace the static house mesh with an active mesh of the same kind that I can animate to burn down to a pile of ashes!

3: Snowey Grounds: Is it possible to create a shader that can be applied to the world ground? Let's say it's a bright snowey day and I want to go for a walk. a few hours later it's still snowing, but the dirt road I'm standing on just seems to stay clear of any snow or ice. A simple shader *could* fix this if permitted by the CS. Otherwise it would be ideal to use an animated gif for the ground texture with programmable animation sequencing, but that will never happen.

4: Magic Jumping Beans: Let's say I want to make a rock, and when the player activates the rock, it jumps up 3 feet then falls down. Or shoots 10 feet to the left. Possible?

5: B*** me - Ah, I guess the forum didn't like my witty pun. Anyway, WIND: Is it possible to, via script, control the 'wind blowing' animation of trees, bushes, and grass, without actually increasing the wind in the current region?

6: The Crystal Sniffer: Is it possible to, via script, manipulate properties of a player-equipped object, such as a ring on the players finger, or an amulet around his/her neck? These properties would include: Amination, 3D Scale, color (via shaders?), and further, is there a way to track the position of an object that's equipped to the player. Let's say I want a ring that, when the player is near a treasure chest, a script detects the world position of the ring and places a small flame at the same position, making it look like the ring is now on fire.


These are all ideas that will support a lot of new functions and player control in a mod I'm working on. Any help is much apperciated, and I'm sorry if some of these questions are completely absurd or beginner level.

Thanks for the help!
User avatar
Rob Smith
 
Posts: 3424
Joined: Wed Oct 03, 2007 5:30 pm

Post » Wed May 18, 2011 7:17 am

For the 1st point you can call CreateFullActorCopy to copy the player, then use the real player as a 1st person camera. You can move it with SetPos and rotate it with SetAngle Z. You should call SetPos from a scripted spell and also call ResetFallDamageTimer afterwards. This combination disables falling and collision. When you finished the camera animation you should call DeleteFullActorCopy in order not to save the copied player in a savefile then reposition the player to its original position.
User avatar
Greg Cavaliere
 
Posts: 3514
Joined: Thu Nov 01, 2007 6:31 am

Post » Wed May 18, 2011 2:53 am

...


Perfect, that will work! So I'll basically do the following:

When player activates treasure chest:
DisableSaveMode (don't let the player save game) Possible??
Record current camera state (1st person, 3rd person)
Copy 'player' and set clone position to Player x,y,z,zrot
Fade to black within 0.3 seconds
ForcePC1stPerson //;whatever the actual function is called
Set player (which is now basically just used as a camera) position to (clone position +/- distance)
set player angleZ to (calculate angle from player position to clone position)
Fade back in within 0.8 seconds
check if 'door' is within camera view
move and rotate player(camera) until above is true

When door is within camera view:
delay for 5 seconds'ish, and start door 'close and lock' script
wait for door script to return true, else; report error and return
wait for player to press a button
when above is true, fade to black 0.3 seconds
delete clone
set player position to clone x,y,z,zrot
set camera state to recorded value (1st person or 3rd person)
fade back in 0.8 seconds
EnableSaveMode (?)

It just seems too easy. Thanks Zennorious!
User avatar
Laura-Lee Gerwing
 
Posts: 3363
Joined: Fri Jan 12, 2007 12:46 am


Return to IV - Oblivion