Jump to content

moving scripting


coolpkmn

Recommended Posts

calm down

 

umm ok i assume you want it to slide aside to reveal a secret door or somesuch

try something like this

 

it's been a while and i don't have the cs with me today so i may not get the function names right etc

 

Begin secret_winerack_script

short timer
short moving
short state

if ( MenuMode == 1 )
 Return
endif

if ( OnActivate == 1 )
 if ( state == 0 )
   if ( Player->GetItemCount, secret_winerack_key > 0 )
     Set moving to 1
     Set state to 1
     Set timer to 0
     PlaySound3D "Door Stone Open"
   else
     MessageBox "There is a small hole in the wine rack, where a key might fit."
   endif
 endif
endif

if ( moving == 1 )
; 64 units/sec for 4 secs: distance is 256
 Move X, 64

 Set timer to ( timer + GetSecondsPassed )

 if ( timer > 4 )
   Set moving to 0
 endif
endif

End

 

let's see.... i don't -think- i've forgotten anything but i lack a way to test this. see if it works.

you may wanna change X to Y for the Move command.

 

and unless you change the wine rack from a Static to an Activator, the change in position won't be saved in a savegame. and then you're in trouble, coz u can only open it once.

Link to comment
Share on other sites

A bit off-topic... but could that script be used to make a city rise out of the water? For a mod I'm working on, one of the ideas was to have a daedric city rise out of a lake as part of a quest.
Link to comment
Share on other sites

Yes and no.

 

That scrpt,or one like it could move the bildings and NPC's but not the ground.

 

an alternet methid is to have the city in a new externel cell/plane and script for the wotter to lower. this would be simpeler becous it only needs one comand rather then one for each object. Bad part is you couldent just walk to the city, you would have to port there.

Link to comment
Share on other sites

  • 2 weeks later...

This script is detailed to my specific needs, but if you have a knowledge of the scripting language you could modify it to suit your own needs. Includes variables to reset objects as well, which I found very helpful. I wrote this a while back, but feel free to use it if you wish. :D

 

Begin my_platform_mover300 

short start 
short platmov 
short countstate 
long counter 
float timer 


if ( menumode == 1 ) 
  return 
endif 

if ( OnActivate == 1 ) 
  if ( start == 0 ) 
     set timer to ( timer + GetSecondsPassed ) 
     set start to 1 
  endif 
  return 
endif 

if ( GetDistance, Player < 3180 ) 
  if ( counter > 800 ) 
     if ( countstate == 2 ) 
        set platmov to 4 
;         set countstate to 3 
;         Messagebox, "platform loop" 
     endif 
  elseif ( counter > 400 ) 
     if ( countstate == 1 ) 
        set platmov to 3 
        set countstate to 2 
        Messagebox, "platform bottom" 
     endif 
  elseif ( counter > 100 ) 
     if ( countstate == 0 ) 
        set platmov to 2 
        set countstate to 1 
        Messagebox, "platform top" 
     endif 
  endif 

  if ( platmov == 4 ) 
     if ( timer < 3 ) 
;         set platmov to 2 
;         Messagebox, "platform loop" 
        set counter to 101 
        set timer to 0 
        set countstate to 0 
     endif 
     return 
  elseif ( platmov == 3 ) 
     if ( timer < 4 ) 
        my_lvl1_platform_spin01-> rotate, X 22 
        my_lvl1_platform_spin02-> rotate, X -22 
        my_lvl1_platform_updwn01-> move, Z 135 
        my_lvl1_platform_updwn02-> move, Z -135 
        set counter to ( counter + 1 ) 
        set timer to 0 
     endif 
     return 
  elseif ( platmov == 2 ) 
     if ( timer < 4 ) 
        my_lvl1_platform_spin01-> rotate, X 22 
        my_lvl1_platform_spin02-> rotate, X -22 
        my_lvl1_platform_updwn01-> move, Z -175 
        my_lvl1_platform_updwn02-> move, Z 175 
        set counter to ( counter + 1 ) 
        set timer to 0 
     endif 
     return 
  elseif ( platmov == 1 ) 
     if ( timer < 4 ) 
        my_lvl1_platform_spin01-> rotate, X 22 
        my_lvl1_platform_spin02-> rotate, X -22 
        my_lvl1_platform_updwn01-> move, Z 153 
        my_lvl1_platform_updwn02-> move, Z -153 
        set counter to ( counter + 1 ) 
        set timer to 0 
     endif 
     return 
  endif 
else 
  if ( start == 1 ) 
     set start to 0 
     set platmov to 0 
     set counter to 0 
     set countstate to 0 
     Messagebox, "Platforms deactivated." 
     "my_lvl1_platform_updwn01"-> PositionCell, 3536.000, 7504.000, 12704.000, 0 "Bitter Coast Region, Unexplored Cavern" 
     "my_lvl1_platform_updwn02"-> PositionCell, 3600.000, 7504.000, 12704.000, 0 "Bitter Coast Region, Unexplored Cavern" 
;      if ( GetAngle Y, "my_lvl1_platform_updwn02" != 180 ) 
        "my_lvl1_platform_updwn02"-> SetAngle, Y, 180 
;      endif 
  endif 
  return 
endif 

if ( start == 0 ) 
  return 
endif 

if ( start == 1 ) 
  set platmov to 1 
  set counter to 0 
  set countstate to 0 
  Messagebox, "Platforms activated." 
  if ( CellChanged == 0 ) 
     if ( GetSoundPlaying "Machinery" == 0 ) 
        PlayLoopSound3DVP "Machinery", 1.0, 1.0 
     endif 
  endif 
  return 
endif 

End my_platform_mover300

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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