Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Need help with code. First RPG Game.

Author
Message
Strider 911
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location:
Posted: 18th May 2007 01:55
This is a game that I have somewhat made. I have taken some things I have found in the code base and some of the stuff that came with my copy of DBPRO. The problem I am having right now is that I can not move my person/object the way I want. He will turn left and right but only goes up or down not foreword or backward. Any advice or suggests are welcome aswell but try and help me with the movement first. Thanks. If this doesnt work please let me know and I will post this without code thing. This is my first post like this.


Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 18th May 2007 02:47
Quote: "_make_hero:

rem make hero
`Load object "C:\Program Files\Dark Basic Software\Dark Basic Professional\Media\Models\Colonel Z\ColZ_Run.X",1
`load object "C:\Program Files\Dark Basic Software\Dark Basic Professional\Media\Models\Colonel Z\ColZ.3DS",1
`load image "C:\Program Files\Dark Basic Software\Dark Basic Professional\Media\Models\Colonel Z\Col_Z.jpg",43
load object "C:\Program Files\Dark Basic Software\Dark Basic Professional\Media\Models\Colonel Z\ColZ.X",1
load image "C:\Program Files\Dark Basic Software\Dark Basic Professional\Media\Models\Colonel Z\Col_Z.TGA",43
scale object 1,20,20,20
make object collision box 1,-40,0,-40,40,150,40,0
set object specular 1,0
fix object pivot 1
`xrotate object 1,90
set object speed 1,1200
rotate object 1,270,270,0
rem heros position before game
`Rotate object 1,270,270,0
rem postion player

`position player
posx#=500.0
posz#=500.0
`yrotate object 1,90
return
"


The problem lies here. You wrote "FIX OBJECT PIVOT" before you rotated the object. Just move the FIX OBJECT PIVOT to after you rotate the object. FIX OBJECT PIVOT makes the current rotation the normal rotation for that object.

Strider 911
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location:
Posted: 18th May 2007 03:43
Thank you. Now I can get on with the rest of the game. Why did the location of that line matter. I have been self teaching this to myself by taking demos and combining them so i am slowly learning what everything does.
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 18th May 2007 06:53
Quote: "Why did the location of that line matter."

You have to look at it from the computer's perspective. Sometimes the position of code matters, but sometimes it doesn't. In this case, it does. You are rotating the object by 270 degrees on the x and y axis to make it oriented in the correct direction. Then by the "fix object pivot" command, you are telling it to reorient itself to that rotation, so forward will be the way it is now facing. If you tell it to reorient itself before you rotate the object, you are telling it to reorient itself to it's default rotation, which it already is. Then after you rotate it, you don't ever fix it's pivot, or orientation, again. So you need to fix it's orientation AFTER you rotate the object. Make sense ?


Strider 911
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location:
Posted: 19th May 2007 00:13
Yes thank you. I have now loaded one enemy and i am trying to get his to move around randomly. I like to try and figure things out so ill look through a few tutorials and stuff see what i can figure out then I need to figure out how to attach weapons. I see this being difficult in that I did not make these characters i took them from other DB games(they were free and offered up)and do i take the character down to its wire frame then disable that to make limbs to attach the weapons to or what.

Login to post a reply

Server time is: 2024-11-25 17:56:15
Your offset time is: 2024-11-25 17:56:15