Jump to content

Change dynamicale the scale of an object?


eltucu

Recommended Posts

Hello!

 

Well, i was messing around with the CK (probably going to open a thread about an issue that im having) created an interior and started to place stuff, move stuff, etc...

 

While i was messing around with scaling, i noticed that it would be awesome to, say, having the player walk upon some object, activate it, then it becomes colossal right in front of his eyes.

 

That cannot be done with scripting right? Only with animations?

 

EDIT: No wait, there is a setscale command? If there is one, maybe with a script i can increase the scale by a very little amount but each one quarter of a second for example until it becomes the size i want... huh...

 

Lol, i meant dynamically :)

Edited by eltucu
Link to comment
Share on other sites

Yes, you can do that.

 

You may need to also tell the object to Disabel and Enable again just after telling to reset it's scale.

 

I have used an 'OnLoad' event (which would mean it occurs just as the model is loading) that resets the scale of some objects successfully.

Link to comment
Share on other sites

The disable/enable happens so quickly you might not even notice it. If you do notice the object blink, you could add a VFX to it (haven't tried that yet so no idea how) that might obscure the flicker.
Link to comment
Share on other sites

Whats a VFX? Visual FX? Like the one for summons i guess?

 

Anyway, it wouldnt suit my purpose. Did you open the Azura Star cell in the CK? I was thinking of doing some weird "outer realm" stuff for a quest mod that i might never make :P

 

I didnt remember how they dealt with that cell, the sky and that stuff, so i looked it up. Beth used a sphere with some FX stuff in it (single object made out of 3 spheres, each has different mesh settings but use the same texture, neat effect).

 

I was thinking if i could make the player touch the sphere, while its size is as big as a ball (like a sigil stone), then the sphere grows exponentially until it engulfs the player and his/her surroundings. I dunno what use i could give it but i think it may be a cool effect. Maybe activating some kind of epic magical artifact.

 

EDIT: Great, i just dont know what im doing. Tried to make the star sphere nif into an Activator, used a new texture for it and all that. Tried to make an script with an "OnActivate" event but it didnt worked. Im not even sure to what im actually setting the scale. Ingame i cant even activate the sphere, activated it with the console, did nothing.

Scriptname TestingScaleOnActivate extends ObjectReference  

actor Property actRef auto

Event onActivate (ObjectReference actRef)

actRef.SetScale(3.0)

EndEvent

That doesnt even makes any sense. I edited the property so it references back to the player, wich is what i suppose the onActivate is asking for, the ref of the actor who activated it. I dont know how to reference the activator itself inside the script.

Edited by eltucu
Link to comment
Share on other sites

You'll want to do something more like this (at the moment you do not need that property in the script at all):

 

Event OnActivate(ObjectReference actRef)

self.SetScale(3.0)
self.DisableNoWait(); Maybe needed, maybe not
self.Enable(); Maybe needed, maybe not

; actRef is included in the OnActivate event in case you want to 
; reference the object (player) who activated it as you expand the script

EndEvent

Link to comment
Share on other sites

You'll want to do something more like this (at the moment you do not need that property in the script at all):

Yup, noticed that it is way less complicated than i thought. Ended up with this:
Scriptname TestingScaleOnActivate extends ObjectReference  
float Vara

Event Onload ()
vara = getscale()
Endevent

Event onActivate (ObjectReference actRef)
while vara < 10
	Vara = vara + 0.1
	SetScale(vara)
endwhile
EndEvent

Turns out that i dont need to initialize actref, nor the activator ref, the game just assumes it when i call getscale or setscale. That said, i tested it duplicating a lever since it seems that replacing the lever mesh for the star mesh isnt enough for the game to consider it an activator. I dont know how to make the game consider the azura sphere nif as an activator, editing meshes or nif nodes is kinda out of my reach, or at least out of my inmediate reach, unless its something simple. Good stuff is that without doing any enable/disable or wait(), the lever scales fluently, no hiccups. Test it, just attach that to a lever, though an oversized lever isnt something very impressive...

 

I could make a quest around it, "The lever of Boethia" or something like that, it gets bigger and engulfs you, killing you in the process.

Edited by eltucu
Link to comment
Share on other sites

  • Recently Browsing   0 members

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