Quick QUES?

Post » Fri Dec 09, 2011 6:09 pm

Is it possible to make a script to chose a random variable from 1-3 and then to enable/disable some activators to change the shape of a building and the door with a matching interior??. would it be stable?? is there any mod wich does similar so I can use as a guide??

I aim to get it like this:

VAR=1 enable X exterior shape and door to X interior shape.
VAR=2 enable Y exterior shape and door to Y interior shape.
VAR=3 enable Z exterior shape and door to Z interior shape.

The variable is set randomly and all interiors and exteriors would have the same NPC{s/CREAT.
User avatar
rheanna bruining
 
Posts: 3415
Joined: Fri Dec 22, 2006 11:00 am

Post » Sat Dec 10, 2011 1:49 am

That's entirely possible, easily made stable, and do-able.
The function you're looking for would be "Random 3".
So, you could do it like this.
Begin testshort varif ( var == 0 )   set var to Random 3elseif ( var == 1 )   ;stuff goes hereelseif ( var == 2 )   ;stuff goes hereelseif ( var == 3 )   ;stuff goes hereendifend


Please note that is a simple example script, and would not be functional if used in the format. Also, I may have used Random 3 wrong, but I'm pretty sure I saw it used that way before. Look in the script "proxmine"(tribunal) for an exmaple on it.
User avatar
MarilĂș
 
Posts: 3449
Joined: Sat Oct 07, 2006 7:17 am

Post » Fri Dec 09, 2011 12:21 pm

That's entirely possible, easily made stable, and do-able.
The function you're looking for would be "Random 3".
So, you could do it like this.
[code]

Please note that is a simple example script, and would not be functional if used in the format. Also, I may have used Random 3 wrong, but I'm pretty sure I saw it used that way before. Look in the script "proxmine"(tribunal) for an exmaple on it.



Thanks I{ll check it and see if I can get it to work!!!
User avatar
R.I.p MOmmy
 
Posts: 3463
Joined: Wed Sep 06, 2006 8:40 pm

Post » Fri Dec 09, 2011 10:32 am

It should be said that the random function sets a random value to the number, -1. In the above example, var will never be 3. It will include number 0-2; three numbers. There are a few ways we can handle this depending upon what you need done. Also, have a look at http://yacoby.silgrad.com/MW/Mods/MWSFD.htm. It states what I have about random numbers, and much more.
User avatar
Ladymorphine
 
Posts: 3441
Joined: Wed Nov 08, 2006 2:22 pm


Return to III - Morrowind