Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ferries
04-21-2008, 01:24 PM,
#11
 
I would happily take a look at your script and see if I can figure out a possibility, I aint to good with the math side of things but you guys can help with that.
[color="#9ACD32"]How do you Skyrim? Show Us in TES Alliance's [url="http://tesalliance.org/forums/index.php?/forum/112-official-skyrim-contest/"]Salute to Skyrim Contest[/url]![/color]
Reply
04-22-2008, 10:41 AM,
#12
 
oK so I came up with a script last night, this will not be the full set up to move the ship, you may need a smaller script to activate the movement based on certain actions. Anyway the position values entered are obviously not final, they are just in there to roduce some movement.

Take a look:

;===========================================
;Script: Test Script for moving an object
;Creator: InsanitySorrow
;Version: 1.0
;===========================================

;===========================================
;Script name
;===========================================

scriptname ISTestMovingScript

;========================================================
;Variables
;========================================================

Short ShipMoving
Short StartMoving
Float Timer

;===========================================
;Axis Info
;===========================================

; Z = positvie number UP, negative number DOWN
; X = positvie number EAST, negative number WEST
; Y = positvie number NORTH, Negative SOUTH

;========================================================
;Main Script
;========================================================

Begin onActivate

Set StartMoving to 1

If ( StartMoving == 1 )
If ( ShipMoving == 0 )
Set Timer to Timer + GetSecondsPassed
If ( Timer <= 15 )
setpos X 10
Else
Set Timer to 0
Set ShipMoving to -1
Endif
Endif

If ( ShipMoving == -1 )
Set Timer to Timer + GetSecondsPassed
If ( Timer <= 15 )
setpos X 10
Else
Set Timer to 0
Set ShipMoving to 0
Set StartMoving to -1
Endif
Endif
Endif

;===========================================
;End Script
;===========================================

End
[color="#9ACD32"]How do you Skyrim? Show Us in TES Alliance's [url="http://tesalliance.org/forums/index.php?/forum/112-official-skyrim-contest/"]Salute to Skyrim Contest[/url]![/color]
Reply
04-22-2008, 11:14 AM,
#13
 
Thanks, but I already have an ESP with the framework for the boat scripting. Smile It works to get the boat to move too. I'll post it later in the day.

I'm not sure if you knew, but "setPos X 10" will give the boat an x-coordinate of 10 in the worldspace.
Reply
04-22-2008, 11:16 AM,
#14
 
Yes but the way its set up it should move along the axis, anyway X was just in there temp.. :yes:

Oh i did not know you had a script, would like to see it, if you need any scripting help or whatever, let me know. :goodjob:
[color="#9ACD32"]How do you Skyrim? Show Us in TES Alliance's [url="http://tesalliance.org/forums/index.php?/forum/112-official-skyrim-contest/"]Salute to Skyrim Contest[/url]![/color]
Reply
04-22-2008, 11:41 PM,
#15
 
This is how it is right now, no changes at all. When state is set to 0, nothing will happen because of the return. When it is 1, it will move in a stright line. State == 2 doesn't work yet because the boat is supposed to turn. I think what will happen there is the boat will accelerate along one axis while it deccelerates along the other. State == 3 resets it. I have a text file where I intend on keeping the boat coordinates at each individual state.

Code:
scn StIdRowboatEbbedinToAldNiumScript
; This is going to be a very messy script.

short state
float timer
float yvalue        ; y axis
float xvalue        ; x axis
float rvalue        ; rotation

Begin OnActivate
if ( state == 0 )
    set state to 1
    set timer to 4
endif
End

Begin GameMode
if ( state == 0 )
    return
elseif ( state == 1 )
    set yvalue to ( 234995.8173 + ( -136.6965 * timer ) )
    setpos y yvalue
    set xvalue to ( 209876.4840 + ( 53.144625 * timer ) )
    setpos x xvalue
    set timer to ( timer - GetSecondsPassed )
    if ( timer <= 0 )
        set state to 2
        set timer to 8
    endif
elseif ( state == 2 )
    set yvalue to ( 235330.0248 - ( 6.8205612244898 * ( ( timer - 1 ) * ( timer - 1 ) ) ) )
    setpos y yvalue
    set xvalue to ( 209876.4840 + ( -759.3645 / ( timer * timer ) ) )
    setpos x xvalue
    set timer to ( timer - GetSecondsPassed )
    if ( timer <= 1 )
        set state to 3
        set timer to 0
    endif
elseif ( state == 3 )
    setpos y 234449.0313
    setpos x 210089.0625
    set state to 0
endif
End

Writing this post gave me a strange idea. Instead of doing it all in one big circle, why don't find the slope of the boat (y/x) and then use a bit of calculus (I knew that would be useful!) to find out where on the circle it enters! Then it travels from there until the top, then continues on another state value. Same calculus as for when it exits! Big Grin I think. I would need to work a bit on paper before I knew for sure if this would help and what would be needed.
Reply
04-23-2008, 08:20 AM,
#16
 
What you have looks good, but with me living in the UK I have no knowledge of calculus, so I cannot help on that part.
[color="#9ACD32"]How do you Skyrim? Show Us in TES Alliance's [url="http://tesalliance.org/forums/index.php?/forum/112-official-skyrim-contest/"]Salute to Skyrim Contest[/url]![/color]
Reply
04-23-2008, 10:49 AM,
#17
 
I'm not 100% sure if calculus would be needed, and it might only be for a small section. I'd need to find time to sit down with pencil and paper before it'd really make a lot of sense.

EDIT: Obviously the script will have more state values for different parts of the journey. What you see is just the beginning.
Reply
04-23-2008, 10:55 AM,
#18
 
Well it looks as if it will work, everything so far seems to be there, Have you tried the script?
[color="#9ACD32"]How do you Skyrim? Show Us in TES Alliance's [url="http://tesalliance.org/forums/index.php?/forum/112-official-skyrim-contest/"]Salute to Skyrim Contest[/url]![/color]
Reply
04-23-2008, 11:18 PM,
#19
 
Yes, the boat moves but the player didn't. I should probably have mentioned that the boat collision moved along with the boat model SACarrow sent me.

The problems outlined in the OP are the only ones I'm aware of that need to be addressed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)