Pek Dracus Movement Oblivion

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Pek Dracus Movement Oblivion as PDF for free.

More details

  • Words: 2,808
  • Pages: 13
scriptname pek_dracus_script_oblivion

short short short short short short short short short short float float float float float float float float float float float float float float short

doonce onpcdrop realtimerotation realtimerotationtmp realtimerotationdefault button activate_menu increments lockit angleincrements scaleincrements currxangle curryangle currzangle currxpos currypos currscale startxangle startyangle startzangle currzpos startxpos startypos startzpos controlvar

;====================================================== ;(script originally made by dracus. extended by pekka.) ;(dracus comments are within # and pekka's within = .) ;pekkas version: 0.09b ;====================================================== ;============================================ ; when the object is used for the first time ; we set a number of default settings ; realtimerotaion is described in detail ; at the last section in this script. ; search for active_menu == 6 and you find it ;============================================

;================================================================ ;if rotation is set to on, the first part will make it to rotate. ;else the rotation stops with 0. we optimize the script and lag ;a bit less when we direct set it to -1 i hope. (pekka) ;================================================================ begin gamemode

if (doonce == 0) set doonce to 1 set increments to 1 set angleincrements to 1 set scaleincrements to 0.05 set realtimerotationdefault to 111 endif if ( onpcdrop == 1 ) set currzpos to (getpos, z, + 14) setpos, z, currzpos set currxangle to 270 set currzangle to (getangle, z) + 270 setangle, z, currzangle setangle, x , currxangle ; setangle, y , currxangle set onpcdrop to 0 endif if ( realtimerotation == -1 ) ;will maybe optimize this section and skip testing of all other options. (pekka) elseif ( realtimerotation == 000 ) rotate, x, 0 rotate, y, 0 rotate, z, 0 set realtimerotation to -1 elseif ( realtimerotation == 001 ) rotate, z, 30 elseif ( realtimerotation == 010 ) rotate, y, 30 elseif ( realtimerotation == 011 ) rotate, y, 30 rotate, z, 30 elseif ( realtimerotation == 100 ) rotate, x, 30 elseif ( realtimerotation == 101 ) rotate, x, 30 rotate, z, 30 elseif ( realtimerotation == 110 ) rotate, x, 30 rotate, y, 30 elseif ( realtimerotation == 111 ) rotate, x, 30 rotate, y, 30 rotate, z, 30 endif ;======================================================== ;i turned following check off as we should be able to put ;crystals outdoor and adjust them outdoor as well. ;(pekka) ;======================================================== ; ;######################################################## ; if we're outside, there's no need for this script at all

;######################################################## ; ;if (getinterior == 0) ; return ;endif ;######################################################## ; this code makes sure that the object acts like a regular item ; that you can pick up and place in your inventory while ; in menu mode ;######################################################## ;if ( menumode == 1 ) ; if ( onactivate == 1 ) ; activate ; set lockit to 0 ; endif ; return ;endif ;######################################################## ; if controlvar = -1 means the player selected the "take" option ; in the menu and lets you pick up the item ;######################################################## if ( controlvar == -1 ) activate set controlvar to 0 set lockit to 0 return endif ;####################################################### ;locks the painting position back in place ;fixes a problem with the positioned object going back to where ;you dropped it after you load a savegame ;there's no way to know when the game is loaded that i know. ;i set the variable "lockit" to 1 whenever the painting is positioned ;when it is set to 1 this piece of code checks ;to see if the object is out of place and puts it back where it's ;supposed to be. ;####################################################### if ( lockit == 1 ) if ( (getpos, setpos, setpos, setpos, ; ; ; ; ; ; ;

z) x, y, z,

!= currzpos ) currxpos currypos currzpos

set currxangle to (currxangle setangle, x, currxangle set currxangle to (currxangle setangle, x, currxangle set curryangle to (currxangle setangle, y, curryangle set curryangle to (currxangle

+ 1) - 1) + 1) - 1)

; ; ; ; ;

setangle, y, curryangle set currzangle to (currzangle + 1) setangle, z, currzangle set currzangle to (currzangle - 1) setangle, z, currzangle return elseif ( (getpos, y) != currypos ) setpos, x, currxpos setpos, y, currypos setpos, z, currzpos

; ; ; ; ; ; ; ; ; ; ; ;

set currxangle to (currxangle setangle, x, currxangle set currxangle to (currxangle setangle, x, currxangle set curryangle to (currxangle setangle, y, curryangle set curryangle to (currxangle setangle, y, curryangle set currzangle to (currzangle setangle, z, currzangle set currzangle to (currzangle setangle, z, currzangle

+ 1) - 1) + 1) - 1) + 1) - 1)

return elseif ( (getpos, x) != currxpos ) setpos, x, currxpos setpos, y, currypos setpos, z, currzpos ; ; ; ; ; ; ; ; ; ; ; ;

set currxangle to (currxangle setangle, x, currxangle set currxangle to (currxangle setangle, x, currxangle set curryangle to (currxangle setangle, y, curryangle set curryangle to (currxangle setangle, y, curryangle set currzangle to (currzangle setangle, z, currzangle set currzangle to (currzangle setangle, z, currzangle

+ 1) - 1) + 1) - 1) + 1) - 1)

return elseif ( getscale != currscale ) setscale, currscale return endif ; ; ; ; ;

if ( (getangle, z) != currzangle ) set currxangle to (currxangle + 1) setangle, x, currxangle set currxangle to (currxangle - 1) setangle, x, currxangle

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

set curryangle to (currxangle + 1) setangle, y, curryangle set curryangle to (currxangle - 1) setangle, y, curryangle set currzangle to (currzangle + 1) setangle, z, currzangle set currzangle to (currzangle - 1) setangle, z, currzangle return elseif ( (getangle, y) != curryangle ) set currxangle to (currxangle + 1) setangle, x, currxangle set currxangle to (currxangle - 1) setangle, x, currxangle set curryangle to (currxangle + 1) setangle, y, curryangle set curryangle to (currxangle - 1) setangle, y, curryangle set currzangle to (currzangle + 1) setangle, z, currzangle set currzangle to (currzangle - 1) setangle, z, currzangle return elseif ( (getangle, x) != currxangle ) set currxangle to (currxangle + 1) setangle, x, currxangle set currxangle to (currxangle - 1) setangle, x, currxangle set curryangle to (currxangle + 1) setangle, y, curryangle set curryangle to (currxangle - 1) setangle, y, curryangle set currzangle to (currzangle + 1) setangle, z, currzangle set currzangle to (currzangle - 1) setangle, z, currzangle return elseif ( getscale != currscale ) setscale, currscale return endif

endif end ;################## ; end of lock check ;################## ;######################### starting menu ############################ begin onactivate ;if (getinterior == 0) ; activate ; set lockit to 0

; return ;endif ; if ( controlvar == 0 ) ; set lockit to 0 ; return ;endif set set set set set set set set set set set set

activate_menu to 1 controlvar to 1 startxpos to getpos, x startypos to getpos, y startzpos to getpos, z startxangle to getangle, x startyangle to getangle, y startzangle to getangle, z currxpos to getpos, x currypos to getpos, y currzpos to getpos, z currscale to getscale

if ( activate_menu == 1 ) messagebox "main menu", "take", "rotate", "position", "scale", "realltime rotation on/off", "realltime rotation setup", "done" set activate_menu to 0 set lockit to 0 endif end begin gamemode if ( controlvar == 1 ) set button to getbuttonpressed if ( button == -1 ) return elseif ( button == 0 ) set controlvar to -1 set activate_menu to 0 return elseif ( button == 1 ) set controlvar to 2 set activate_menu to 2 elseif ( button == 2 ) set controlvar to 3 set activate_menu to 3 elseif ( button == 3 ) set controlvar to 4 set activate_menu to 4 elseif ( button == 4 ) set controlvar to 5 set activate_menu to 5 elseif ( button == 5 ) set controlvar to 6 set activate_menu to 6 else set controlvar to 0 set activate_menu to 0 set lockit to 1

return endif

endif

;######################## rotation menu ################################### if ( activate_menu == 2 ) messagebox "rotation menu (increment = %g)", angleincrements, "change increment", "rotate x", "rotate y", "roatate z", "reset to 0", "restore", "back" set activate_menu to 0 endif if ( controlvar == 2 set currxangle set curryangle set currzangle

) to getangle, x to getangle, y to getangle, z

set button to getbuttonpressed if ( button == -1 ) return elseif ( button == 0 ) if ( angleincrements == 1 ) set angleincrements to 5 elseif ( angleincrements == 5 ) set angleincrements to 45 elseif ( angleincrements == 45 ) set angleincrements to 90 elseif ( angleincrements == 90 ) set angleincrements to -1 elseif ( angleincrements == -1 ) set angleincrements to -5 elseif ( angleincrements == -5 ) set angleincrements to -45 elseif ( angleincrements == -45 ) set angleincrements to -90 else set angleincrements to 1 endif set activate_menu to 2 return elseif ( button == 1 ) set currxangle to ( currxangle + angleincrements ) if ( currxangle >= 360 ) set currxangle to ( currxangle - 360 ) elseif ( currxangle <= -360 ) set currxangle to ( currxangle + 360 ) endif setangle, x, currxangle set activate_menu to 2 return elseif ( button == 2 ) set curryangle to ( curryangle + angleincrements ) if ( curryangle >= 360 ) set curryangle to ( curryangle - 360 ) elseif ( curryangle <= -360 )

set curryangle to ( currxangle + 360 ) endif setangle, y, curryangle set activate_menu to 2 return elseif ( button == 3 ) set currzangle to ( currzangle + angleincrements ) if ( currzangle >= 360 ) set currzangle to ( currzangle - 360 ) elseif ( currzangle <= -360 ) set currzangle to ( currxangle + 360 ) endif setangle, z, currzangle set activate_menu to 2 return elseif ( button == 4 ) setangle, x, 0 setangle, y, 0 setangle, z, 0 set activate_menu to 2 return elseif ( button == 5 ) setangle, x, startxangle setangle, y, startyangle setangle, z, startzangle set activate_menu to 2 return else set activate_menu to 1 set controlvar to 1 return endif endif

;##################### position menu ####################### if ( activate_menu == 3 ) messagebox "position menu (increment = %g)", increments, "change increment", "+x", "-x", "+y", "-y", "+z", "-z", "restore", "back" set activate_menu to 0 endif if ( controlvar == 3 ) set button to getbuttonpressed if ( button == -1 ) return elseif ( button == 0 ) if ( increments == 1 ) set increments to 5 elseif ( increments == 5 )

set increments to 10 elseif ( increments == 10 ) set increments to 30 else set increments to 1 endif set activate_menu to 3 return elseif ( button == 1 ) set currxpos to ( currxpos + setpos, x, currxpos set activate_menu to 3 return elseif ( button == 2 ) set currxpos to ( currxpos setpos, x, currxpos set activate_menu to 3 return elseif ( button == 3 ) set currypos to ( currypos + setpos, y, currypos set activate_menu to 3 return elseif ( button == 4 ) set currypos to ( currypos setpos, y, currypos set activate_menu to 3 return elseif ( button == 5 ) set currzpos to ( currzpos + setpos, z, currzpos set activate_menu to 3 return elseif ( button == 6 ) set currzpos to ( currzpos setpos, z, currzpos set activate_menu to 3 return elseif ( button == 7 ) setpos, x, startxpos setpos, y, startypos setpos, z, startzpos set currxpos to startxpos set currypos to startypos set currzpos to startzpos set activate_menu to 3 return else set activate_menu to 1 set controlvar to 1 return endif

increments )

increments )

increments )

increments )

increments )

increments )

endif ;==================================================== ;======= turning realltime rotation on or off =======

;==================================================== if ( activate_menu == 5 ) if ( realtimerotation <= 0 ) if ( realtimerotationtmp <= 0 ) set realtimerotation to realtimerotationdefault else set realtimerotation to realtimerotationtmp endif else set realtimerotationtmp to realtimerotation set realtimerotation to 0 endif set activate_menu to 0 set controlvar to 0 set lockit to 1 endif ;============================================================== ;scaling menu, allows you to make the object bigger or smaller. ;============================================================== if ( activate_menu == 4 ) messagebox "set scale menu (increment = %0f)", scaleincrements, "change increments", "bigger", "smaller", "restore", "back" set activate_menu to 0 endif if ( controlvar == 4 ) set currscale to getscale set button to getbuttonpressed if ( button == -1 ) return elseif ( button == 0 ) ;--------------------------------------------------------------;scaleincrement is a float and a float is never an exact number ;wich a short or integer is. so therefor i do a check above the ;actuall value that i actually set. (pekka) ;--------------------------------------------------------------if ( scaleincrements <= 0.06 ) set scaleincrements to 0.1 elseif ( scaleincrements <= 0.15 ) set scaleincrements to 0.3 else set scaleincrements to 0.3 set scaleincrements to 0.05 endif elseif ( button == 1 ) set currscale to ( currscale + scaleincrements ) ;==================================================================== ;i have to set a max and min limit or i think things might become ;nasty, specially if we try to make the object smaller then 0.

;i havnt test it and i will not test it either. i set max scale ;to 2x and min scale to 0.05x. feel free to change it though. (pekka) ;==================================================================== if ( currscale >= 3.0 ) set currscale to ( 3.0 ) messagebox "i cant make this object bigger. sorry." endif setscale, currscale elseif ( button == 2 ) set currscale to ( currscale - scaleincrements ) if ( currscale <= 0.05 ) set currscale to ( 0.05 ) messagebox "i cant make this object smaller. sorry." endif setscale, currscale elseif ( button == 3 ) setscale, 1.0 else set activate_menu to 1 set controlvar to 1 return endif set activate_menu to 4 return endif ;=============================== ;=== realtime rotation setup === ;=============================== if ( activate_menu == 6 ) messagebox "real time rotation setup", "toggle vertical (x) rotation", "toggle vertical (y) rotation", "toggle horizontal (z) rotation", "back" set activate_menu to 0 endif if ( controlvar == 6 ) set button to getbuttonpressed if ( realtimerotation == -1 ) set realtimerotation to 000 endif if ( button == -1 ) return ;====================================================== ; to toggle every axle, i choosed simulated binary code ; there 1 is on and 0 is of for each axle wich is ; 16 combinations really --> 8 different if for each ; button. example:

; ; 001 = x off, y off and z on ; 110 = x on, y on and z off ;====================================================== elseif ( button == 0 ) if ( realtimerotation == 000 ) set realtimerotation to 100 messagebox "x=on, y=off, z=off" elseif ( realtimerotation == 100 ) set realtimerotation to 000 messagebox "x=off, y=off, z=off" elseif ( realtimerotation == 001 ) set realtimerotation to 101 messagebox "x=on, y=off, z=on" elseif ( realtimerotation == 101 ) set realtimerotation to 001 messagebox "x=off, y=off, z=on" elseif ( realtimerotation == 010 ) set realtimerotation to 110 messagebox "x=on, y=on, z=off" elseif ( realtimerotation == 110 ) set realtimerotation to 010 messagebox "x=off, y=on, z=off" elseif ( realtimerotation == 011 ) set realtimerotation to 111 messagebox "x=on, y=off, z=off" elseif ( realtimerotation == 111 ) set realtimerotation to 011 messagebox "x=on, y=off, z=on" endif elseif ( button == 1 ) if ( realtimerotation == 000 ) set realtimerotation to 010 messagebox "x=off, y=on, z=off" elseif ( realtimerotation == 010 ) set realtimerotation to 000 messagebox "x=off, y=off, z=off" elseif ( realtimerotation == 011 ) set realtimerotation to 001 messagebox "x=off, y=off, z=on" elseif ( realtimerotation == 001 ) set realtimerotation to 011 messagebox "x=off, y=on, z=on" elseif ( realtimerotation == 100 ) set realtimerotation to 110 messagebox "x=on, y=on, z=off" elseif ( realtimerotation == 110 ) set realtimerotation to 100 messagebox "x=on, y=off, z=off" elseif ( realtimerotation == 101 )

set realtimerotation to 111 messagebox "x=on, y=on, z=on" elseif ( realtimerotation == 111 ) set realtimerotation to 101 messagebox "x=on, y=off, z=on" endif elseif ( button == 2 ) if ( realtimerotation == 000 ) set realtimerotation to 001 messagebox "x=off, y=off, z=on" elseif ( realtimerotation == 001 ) set realtimerotation to 000 messagebox "x=off, y=off, z=off" elseif ( realtimerotation == 010 ) set realtimerotation to 011 messagebox "x=off, y=on, z=on" elseif ( realtimerotation == 011 ) set realtimerotation to 010 messagebox "x=off, y=on, z=off" elseif ( realtimerotation == 100 ) set realtimerotation to 101 messagebox "x=on, y=off, z=on" elseif ( realtimerotation == 101 ) set realtimerotation to 100 messagebox "x=on, y=off, z=off" elseif ( realtimerotation == 110 ) set realtimerotation to 111 messagebox "x=on, y=on, z=on" elseif ( realtimerotation == 111 ) set realtimerotation to 110 messagebox "x=on, y=on, z=off" endif else

set activate_menu to 1 set controlvar to 1 return

endif set controlvar to 0 set lockit to 1 endif

end

Related Documents

Oblivion
August 2019 35
Portada Pek
October 2019 10
Oblivion 11
October 2019 22
Oblivion - Violin.pdf
November 2019 18
Movement
October 2019 36