| View previous topic :: View next topic |
| Author |
Message |
Chad
Joined: 13 Jun 2004 Posts: 152
|
Posted: Sun Jun 13, 2004 9:31 pm Post subject: V for Victory |
|
|
Hello, for several months I have been trying to learn to program with Blitz3d with minimum sucess. I have been programming however for several years, but have not mastered the language. I would like to create a Virtual World and trade routes from Country to Country and the player be able to control a Merchant Ship or tanker. To make it challenging, it's during World War 2. At first, as an American Cargo ship running between the United States and Great Britain by yourself. A little bit later, while running trade routes up and down the East Coast of the United States, watch out for U-boats in the shallow water and very minumum protection from the U-boats. Later on in the war, then you travel in convoys, with protection from Escort Carriers, Destroyers, Battleships, and other forms of Warships.
I know at first it might seem a bit boring, but it's just for me to learn the code one step at a time.
Well, my $0.02 worth. I'll have some screenshots and other misc. things coming soon.
Thanks,
Chad |
|
| Back to top |
|
 |
Chad
Joined: 13 Jun 2004 Posts: 152
|
Posted: Mon Jun 14, 2004 10:35 pm Post subject: |
|
|
I began rewriting some of the code for the water when I ran into this problem. I don't know what the problem is, but if you guys could point something out that'd be great. The error statesL
| Quote: | | Entity does not exist |
With this highlighted:
| Code: | water=LoadMesh("water.3ds")
PositionEntity water,0,0,0
|
I'm wondering if it has something to do with my camera, so here's my camera code:
| Code: | Graphics3D 1024,768,16,1
SetBuffer BackBuffer()
HidePointer
View1=CreateCamera()
AmbientLight 12,12,12
player=CreatePivot()
floorpivot=CreatePivot()
camera=CreateCamera(player)
CameraClsMode camera,False,True
CameraRange View1,1,10000
MoveEntity camera,0,1.2,0
PositionEntity player,0,0,0
CameraFogMode camera,1
CameraFogColor camera,100,200,255
FXCamera=CreateCamera()
CameraClsMode FXCamera,False,True
CameraProjMode FXCamera,0
CameraViewport FXCamera,0,0,WaterMapSize,WaterMapSize
|
Any suggestions would be appreciated!
Thanks,
Chad |
|
| Back to top |
|
 |
Deamon
Joined: 30 Apr 2002 Posts: 2302 Location: Germany
|
Posted: Tue Jun 15, 2004 3:55 am Post subject: |
|
|
No it's not the camera.The error must be looked for in the highlited lines.As the error message states,the compiler cannot finde the object that you have listed in the water=LoadMesh("water.3ds") line.This compiler looks for your listed object in the exe folder and cannot finde it there.So either the name of the object that you want to load doesn't match the name that you have listed in the water=LoadMesh("water.3ds") line or the object that you want to load isn't in the same folder as the exe.If your water object is in a subfolder,for example,than you must typ in the path to the subdirectory where your model is stored.If you have an subfolder called models than your LoadMesh line should look like this:
water=LoadMesh("models\water.3ds")
BTW: A typical bloody beginner error LOL
Deamon |
|
| Back to top |
|
 |
Bertgang
Joined: 17 Mar 2004 Posts: 1031 Location: Italy
|
Posted: Tue Jun 15, 2004 9:37 am Post subject: Re: V for Victory |
|
|
| Chad wrote: |
I know at first it might seem a bit boring, but it's just for me to learn the code one step at a time.
|
Not boring at all, from my point of wiew.
Once I edited some similar mission for novalogic's wolfpack: a lone ship, or a small unescorted convoy, who has to evade U-Boats.
A desperate task quite amusing; fast runs at zig-zag, ramming attempts, and a lot of gunfire towards periscopes.
Not really a battle simulation, but a diversion to be experienced. |
|
| Back to top |
|
 |
Chad
Joined: 13 Jun 2004 Posts: 152
|
Posted: Tue Jun 15, 2004 11:05 am Post subject: |
|
|
Arg, my bad.. After 3 hours of programming I guess that you go brain dead Thanks Deamon!
~Bertgang
If you have some idea's or would like to help out I'd be really grateful. I want the most out of this, and would appreciate if you'd help  |
|
| Back to top |
|
 |
Bertgang
Joined: 17 Mar 2004 Posts: 1031 Location: Italy
|
Posted: Tue Jun 15, 2004 11:56 am Post subject: |
|
|
Thank you for the invitation, but I haven't competences at all.
I was able to write some missions only because old Wolfpack had a simple mission editor inside.
Playing as unescorted merchant was amusing; I had to be very vigilant, and to try a lot of course/speed changes; gunfire was useful to keep the enemy submerged, but rarely did damage.
If you wish more effective artillery duels, the opponent should be german merchant raiders; but the hope to survive is very little, without a cruiser on your side. |
|
| Back to top |
|
 |
Chad
Joined: 13 Jun 2004 Posts: 152
|
Posted: Tue Jun 15, 2004 9:07 pm Post subject: |
|
|
See another great idea! Battling against other German Merchant ships If you ever change your mind or come up with more ingenious idea's please let me know  |
|
| Back to top |
|
 |
Bertgang
Joined: 17 Mar 2004 Posts: 1031 Location: Italy
|
Posted: Wed Jun 16, 2004 8:23 am Post subject: |
|
|
Now I haven't further suggestions for your current job.
But, if you are looking for more small surface battles, a good topic could be the german steam cruiser EMDEN in WWI.
This ship acted in Pacific alone, starting from a german colony soon fallen; sunk or captured, pirate style, a lot of enemy merchants; built a small support fleet by captured ships; attacked some land target as well; got coal and provisions by enemy, sometimes by ruse; at last, was sunk by an australian cruiser.
Should be available a romance issued from historical facts. |
|
| Back to top |
|
 |
Deamon
Joined: 30 Apr 2002 Posts: 2302 Location: Germany
|
Posted: Wed Jun 16, 2004 10:55 am Post subject: |
|
|
| Chad wrote: | See another great idea! Battling against other German Merchant ships If you ever change your mind or come up with more ingenious idea's please let me know  |
What about a Q-Ship simulator
Would make the escort less convoy missions a little more spicey,when one of the "merchant" is actualy a Q-Ship.A convoy without escorts would maybe let the U-Boat attack surfaced and then when he's close enough... WHHHAAAAAA
Deamon |
|
| Back to top |
|
 |
Chad
Joined: 13 Jun 2004 Posts: 152
|
Posted: Wed Jun 16, 2004 11:25 am Post subject: |
|
|
Well, instead of the Emden idea, I've came up with something similar. The 'Seeadler' a German 3 masted ship that was disguised as a Norweigan Lumber ship. I think that would be pretty cool to play as the 'Seeadler' with Cound Felix von Luckner aka 'the Sea Devil' and boarding British and French ships and placing bombs and getting back on your ship before the bomb went off.
I don't know though, I'll just keep working programming and as I get further I might change it. |
|
| Back to top |
|
 |
Bertgang
Joined: 17 Mar 2004 Posts: 1031 Location: Italy
|
Posted: Wed Jun 16, 2004 1:08 pm Post subject: |
|
|
Good choice.
Don't abandon your first work, anyway, if you have the time to do both. |
|
| Back to top |
|
 |
Chad
Joined: 13 Jun 2004 Posts: 152
|
Posted: Sat Jun 19, 2004 12:45 am Post subject: |
|
|
Ok, this one is for the programmers I've been trying to get the free look system going, like move your mouse and wherever you move your mouse that's where you'll be looking, like first person shooters basically. However, there must be something I'm doing wrong either in the camera work OR in programming the free look. There are no errors in the debug log, so that's why I came up with those conclusions. Here is what I have for you guys to look at:
| Code: |
;==========
;Camera
;==========
Global campiv= CreatePivot()
Global cam = CreateCamera(campiv)
CameraRange cam,1,1000
CameraFogMode cam,1
CameraFogRange cam,60,500
EntityType campiv, 11
EntityRadius campiv,1.5
PositionEntity campiv, -.9,2.7,75
;=========
;Main Loop
;=========
Repeat
UpdateOcean()
UpdateWorld
RenderWorld
Flip
Until KeyHit(1)
End
;=========
;Mouse movements and Arrow keys
;=========
Function CopyObject(objecttoCopy$,sx#,sy#,sz#,x#,y#,z#,pitch#,yaw#,roll#)
Local objectScene = CopyMesh(objecttoCopy$)
ScaleEntity objectScene,sx#,sy#,sz#
PositionEntity objectScene,x,y,z
RotateEntity objectScene,pitch#,yaw#,roll#
Return objectScene
End Function
Function BuildObject(objecttoload$,sx#,sy#,sz#,x#,y#,z#,pitch#,yaw#,roll#)
Local objectScene = LoadMesh(objecttoload$)
ScaleEntity objectScene,sx#,sy#,sz#
PositionEntity objectScene,x,y,z
RotateEntity objectScene,pitch#,yaw#,roll#
Return objectScene
End Function
Function freelook()
;Else
; Strafing..
If KeyDown(203) MoveEntity CamPiv,-.1,0,0
If KeyDown(205) MoveEntity CamPiv,.1,0,0
; Move the player backwards and forwards...
If KeyDown(200) MoveEntity CamPiv,0,0,.3
If KeyDown(208) MoveEntity CamPiv,0,0,-.1
; Smoothing...
x_speed#=(MouseXSpeed()-x_speed)/13+x_speed
y_speed#=(MouseYSpeed()-y_speed)/13+y_speed
TurnEntity campiv,y_speed,0,0,0;global false
TurnEntity campiv,0,-x_speed,0,1;global true
; Lock the mouse in the middle of the screen so that MouseX/YSpeed() work properly
MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
;gravity
xx#=EntityX(campiv)
yy#=EntityY(campiv)
zz#=EntityZ(campiv)
terra_y#=TerrainY(terrain,xx#,yy#,zz#)+3
PositionEntity campiv,xx#,terra_y#,zz#
PositionEntity sky,EntityX(campiv),EntityY(campiv),EntityZ(campiv)
End Function |
If you spot anything, or have your custom made free look code, I'd be much obliged for your help. Also, I'm sorry for it not being quite 'clean' as most would say, but whatever works I guess.
Thanks,
Chad |
|
| Back to top |
|
 |
Deamon
Joined: 30 Apr 2002 Posts: 2302 Location: Germany
|
Posted: Sat Jun 19, 2004 5:25 am Post subject: |
|
|
Chad,you forgot to tell me what the problem is with your camera ?
So what should i look for ?
Deamon |
|
| Back to top |
|
 |
Chad
Joined: 13 Jun 2004 Posts: 152
|
Posted: Sat Jun 19, 2004 11:54 am Post subject: |
|
|
| Oops, my bad. The freelook isn't working, it loads but when I move my mouse there is no movement. |
|
| Back to top |
|
 |
Deamon
Joined: 30 Apr 2002 Posts: 2302 Location: Germany
|
Posted: Sat Jun 19, 2004 4:08 pm Post subject: |
|
|
As fare as i can see it right the problem seems to be in the lines below
x_speed#=(MouseXSpeed()-x_speed)/13+x_speed
y_speed#=(MouseYSpeed()-y_speed)/13+y_speed
TurnEntity campiv,y_speed,0,0,0;global false
TurnEntity campiv,0,-x_speed,0,1;global true
Use MousX and MouseY functions instead of MouseSpeed once.The MouseSpeed functions return the mouse position values only if move the mouse and press a mouse button.
And use RotateEntity instead of TurnEntity.
Anyway here's what i hacked together quickly:
Function RotatePlayerView()
If MouseX() <> mouse_x
mouse_x=MouseX()
End If
If MouseY() <> mouse_y
mouse_y=MouseY()
End If
If mouse_y < 370
vyr#=vyr# + (mouse_y - 370)/4
Else If mouse_y > 370
vyr#=vyr# - (370 - mouse_y)/4
End If
If mouse_x < 500
vxr#=vxr# - (mouse_x - 500)/4
Else If mouse_x > 500
vxr#=vxr# + (500 - mouse_x)/4
End If
RotateEntity View1,vyr#,vxr#,0
MoveMouse 500,370
mouse_x=MouseX
mouse_y=MouseY
End Function |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|