Making a working rowboat?

Post » Tue May 17, 2011 3:36 pm

Now, I wanted to make a boat, and have it so that you turn like you naturally do in a boat when you click the "Move Left" and "Move Right" keys, as in a "swooping" sort-of turn. The thing I'm running into isn't making the thing move back and forth, the issue is making it move in the direction it's facing if you press Forward or Backward. I looked into some things that let you move in the direction you're facing, like a rowboat mod (I'm planning on making one with somewhat realistic movement, rocking back-and-forth, controlling the rowing speed by pressing down shift, adding player animations, maybe even add some texture animations on objects on the side of the boat to simulate waves), but I realized that the person had to use Sine and Cosine formulas to make it work.

I was going to ask my Math Teacher today about finding the exact X-Y Coordinates to have a distance equal to 1 on any given angle, but I got sick in the middle of the night and I'm probably not going to school for a few days.

The only thing (that I can find) that can place something in front of the player is "PlaceAtMe" which makes a new object and I could see that causing issues when you're making a new object every frame at 40 FPS for 1 minute, and not being able to delete them. (That'd be 2,400 Objects per minute, and if you felt like canoeing around in an ocean... it'd end up being new 144,000 objects per hour).

Also, another question: Every time I get out of the boat, I fall through it after I've made it go back and forth, and I can't get in the seat anymore.

Is there any reason as to why that happens?

( I know it's obvious but I'm using OBSE. :] )

Thank you so much for reading! :)
User avatar
Lifee Mccaslin
 
Posts: 3369
Joined: Fri Jun 01, 2007 1:03 am

Post » Tue May 17, 2011 7:05 am

There's already a boat mod like that's been made. I forget what's it's called though, it's been awhile since I tried it out. It did have a few problems, which is why I stopped using it.
User avatar
ruCkii
 
Posts: 3360
Joined: Mon Mar 26, 2007 9:08 pm

Post » Tue May 17, 2011 6:45 am

There's already a boat mod like that's been made. I forget what's it's called though, it's been awhile since I tried it out. It did have a few problems, which is why I stopped using it.

I know, I just like trying to make things more "hands-on" than having menus pop up (not that I have anything against menus!), like running up to a boat, pressing space, and pressing the "Forward Button" and you're off, sailing towards a distant shore, or away from a group of people chasing you. Without having to worry about anchors or having it turn in whatever direction your camera is facing.

Basically, super-realistic boats... that almost work the same way as horses.
User avatar
Rudy Paint fingers
 
Posts: 3416
Joined: Sun Nov 11, 2007 1:52 am

Post » Tue May 17, 2011 3:39 am

Now, I wanted to make a boat, and have it so that you turn like you naturally do in a boat when you click the "Move Left" and "Move Right" keys, as in a "swooping" sort-of turn. The thing I'm running into isn't making the thing move back and forth, the issue is making it move in the direction it's facing if you press Forward or Backward. I looked into some things that let you move in the direction you're facing, like a rowboat mod (I'm planning on making one with somewhat realistic movement, rocking back-and-forth, controlling the rowing speed by pressing down shift, adding player animations, maybe even add some texture animations on objects on the side of the boat to simulate waves), but I realized that the person had to use Sine and Cosine formulas to make it work.

I was going to ask my Math Teacher today about finding the exact X-Y Coordinates to have a distance equal to 1 on any given angle, but I got sick in the middle of the night and I'm probably not going to school for a few days.

The only way to get that is with sine and cosine and their approximations. So that's the way to go if you want the same speed for each direction.

The only thing (that I can find) that can place something in front of the player is "PlaceAtMe" which makes a new object and I could see that causing issues when you're making a new object every frame at 40 FPS for 1 minute, and not being able to delete them. (That'd be 2,400 Objects per minute, and if you felt like canoeing around in an ocean... it'd end up being new 144,000 objects per hour).

MoveTo moves references to a point relative to something else (ie the player). By looking at the z rotation of the player and using the sine and cosine, you can make something stay in front of the player.

Also, another question: Every time I get out of the boat, I fall through it after I've made it go back and forth, and I can't get in the seat anymore.

Is there any reason as to why that happens?

Afaik Oblivion doesn't like it when you move stuff that doesn't normally move (like activators). It'll move to visible part of your rowboat and leave the collision stuff at the original position. The only remedy I know of is to have the cell reloaded, which does break immersion, and there are also some problems while sailing.
I don't know how the current sailing mods solve these problems (I think they do, Nehrim didn't seem to need to reload if I remember correctly), but maybe it'd be easier to just make a rowboat-shaped horse.
User avatar
James Potter
 
Posts: 3418
Joined: Sat Jul 07, 2007 11:40 am

Post » Tue May 17, 2011 11:51 am

Afaik Oblivion doesn't like it when you move stuff that doesn't normally move (like activators). It'll move to visible part of your rowboat and leave the collision stuff at the original position. The only remedy I know of is to have the cell reloaded, which does break immersion, and there are also some problems while sailing.
I don't know how the current sailing mods solve these problems (I think they do, Nehrim didn't seem to need to reload if I remember correctly), but maybe it'd be easier to just make a rowboat-shaped horse.

It was actually pretty easy.

float timerfloat fQuestDelayTimebegin gameMode     set fQuestDelayTime to 0.001     if ( timer < .0001 )         set timer to timer + getSecondsPassed     else                                                                         	if TestCanoe.GetDisabled == 1		TestCanoe.enable		CanoeTestingChair.enable		endif     endifend


And I used this to disable the chair and the boat.

if ( IsControlPressed 5 ) && ( UsingCanoe == 1 )		TestCanoe.disable		CanoeTestingChair.disable		set UsingCanoe to 0		set timer to 0	endifend

And this is where UsingCanoe is used.

	if ( player.GetSitting == 3 ) && ( player.IsCurrentFurnitureRef CanoeTestingChair )			set UsingCanoe to 1			CanoeTestingChair.setpos x, CanoeCoordinateX			player.setpos x, CanoeCoordinateX			CanoeTestingChair.setpos y, CanoeCoordinateY			player.setpos y, CanoeCoordinateY			CanoeTestingChair.setangle z, CanoeAngleZ			player.setangle Z, CanoeAngleZ


The only way to get that is with sine and cosine and their approximations. So that's the way to go if you want the same speed for each direction.

MoveTo moves references to a point relative to something else (ie the player). By looking at the z rotation of the player and using the sine and cosine, you can make something stay in front of the player.

I don't know what I have to do with it though... maybe I should just look into some scripts of other things. Thanks for the help though. :)
User avatar
Sabrina Schwarz
 
Posts: 3538
Joined: Fri Jul 14, 2006 10:02 am

Post » Tue May 17, 2011 3:44 am

A little intro to game http://cs.elderscrolls.com/constwiki/index.php/User:QQuix/Distances_and_Angles that may help you get started.
User avatar
Hilm Music
 
Posts: 3357
Joined: Wed Jun 06, 2007 9:36 pm

Post » Tue May 17, 2011 10:02 am

A little intro to game http://cs.elderscrolls.com/constwiki/index.php/User:QQuix/Distances_and_Angles that may help you get started.

Perfect! Exactly what I needed! Thank you so much! :)

The one that I looked at didn't use Sin and Cos... they used a big code to define both, so I felt swamped.

...Then again it was from 2008. :facepalm:
User avatar
Amy Smith
 
Posts: 3339
Joined: Mon Feb 05, 2007 10:04 pm


Return to IV - Oblivion