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 / limbs- and some other stuff

Author
Message
MMORPG programs
19
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 20th Feb 2006 22:03
I'm making a game, and im using different ai with different limbs. First for my archer- how would you make a long arch from the archer to the player. 2nd, when using the for/next command, what would you do with the create mesh from object command? could you just do 9990+type? 3rd of all, why do you have to create a mesh, then delete it for the limb command? 4th, does anyone know of source code for any of my questions or for client/server connections? 5th, How do you make the ai "trees" for more complex ai than just modes? 6th. how do you use a dll in a dbpro file? can you make the dbpro into a dll and use it in c++?


(yes i know its alot of questions)
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 20th Feb 2006 23:37
1. If you're using a 3d object for the bullet, you could do something like:

Set VSpeed# to 1
Rotate Arrow to Bow X Angle and Bow Y Angle
Move Arrow Forward
Position Object Arrow, X, Y+VSpeed, Z
Decrease VSpeed# by .01
Repeat

So the Arrow will start off moving up and slowly begin moving down, forming an arch.

You could use maths aswell, or limbs, there's a lot of ways.

2. It doesnt sound like you understand how limbs work. MAKE MESH FROM OBJECT creates a mesh from the object specified that a limb can use to be created to look like the mesh, which ultimately looks like the object the mesh was created from. You could do something like this in a for/next loop if you wanted to add 10 limbs to object 1, each with a different mesh

FOR i = 2 TO 11

MAKE MESH FROM OBJECT i,i
ADD LIMB 1,i-1,i
DELETE MESH i

NEXT i

3. You dont have to delete the mesh at all. Its just the ADD LIMB command requires a mesh to know what the limb should look like, which is why you creat a mesh in the first place. Once the limb is created, the mesh isn't needed anymore. Think of it this way; an architect draws the entire design/blueprints for a building he's creating. When he's finished the blueprints, he gives them to a construction manager to create the building. Once the building is created, the blueprints can be thrown out as they wont be needed anymore. BUT, sometimes its wise to keep the blueprints incase you need to modify the building or use the blueprints again somewhere else. The same goes for meshes, sometimes its wise to delete a mesh when you know you wont need it again to reduce lag, but other times it isnt. For example, if you wanted to add a limb to everyone that joins an online game, and the limb is a sphere shape, it wouldn't be wise to delete the mesh and then remake it everytime someone logs in, you could just keep the mesh for the entire thing, less lag.

4. Search the newcommers forum for phrases like "limb" and "mesh" , I remember giving an indepth description of how limbs work and what they require, plus some hints on what they're useful for in one post. As for multiplayer client/server, check out Multisync from the Program Announcements thread, or once again do some searches on the forum.

5. This question is a little too broad/undescriptive, explain more.

6. Copy and paste the .dll file into the user plugins folder, usually found in Dark Basic > Dark Basic Professional > Compiler > User Plugins, once it's in there you're ready to use it's commands.

To my knowledge it's impossible to create .dlls in DBP, atleast for c++ because c++ doesn't have DBPs command interface.

MMORPG programs
19
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 5th Mar 2006 22:16
thanks that helps alot. 1 question though- instead of having 10 limbs on 1 object how would u do 1 limb on each of 10 objects
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 6th Mar 2006 04:46 Edited at: 6th Mar 2006 04:49
Then do this


Quote: "can you make the dbpro into a dll and use it in c++?"


That's called "DarkGAME SDK"

FunkyStickmen: Battle of the Races (1%)
MMORPG programs
19
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 8th Mar 2006 03:12

okay that code is what ive made so far. Its not really about limbs but it keeps saying object already exists at the make object box command.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 8th Mar 2006 04:38
Use the Tab button young padawan!



There were two problems, (well 3 if you count the crowded ugliness of the code ), 1. When you called the MAKE OBJECT SPHERE command you didnt specify an object number. Im assuming since its in that loop that you want it to be numbered e so that consecutive objects are created. 2. You were calling RETURN at the end of the subroutine, this was returning to where it left off, then following down the code and doing the startgame: subroutine again, thus creating the box object numbered 9999 twice, thus giving you the error of it already existing.

For now I removed the RETURN command as theres nothing after it, if you want to continue on after this I recommend 1 of two things. Either A) Learn to use functions as they're far more efficient and easier to use than subroutines, or B) use an if statement to cancel out the startgame: subroutine after it's been called once. The second one can be done a few ways, you could define a variable and set it to 1 and then check if it equals 1 and if so skip the subroutine, or you could check if one of the object's created in the routine already exists, or, er... Well theres more ways Im just tired right now.

There were two other things, not syntax errors but logic errors. Firstly, the second time you checked if astr > something then astr = something, instead of doing then astr = something you did then str = something. Im assuming you meant to have an "a" before the str and just mispelled it, but there ya go.

Also, I think your take on how limbs work is still way off. For some reason you're adding 10 to the limb number and creating a mesh numbered 998. Unless there is a specific reason behind numbering the mesh 998, number it 1. (MAKE MESH 1, 999). As for the 10+e thing, why are you adding 10 to the limb number? This will make the first limb number of the object 11, which will give an error because limbs must be added in chain sequence so the first limb added must always be 1 unless the object already has limbs. So, I changed the e+10 bit to just 1.

It works now, like I said you should really learn to use functions. If I have time I might convert the code to a function instead of a subroutine for you in a bit.

Goodluck,
- RUC'

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 8th Mar 2006 04:56
Alright I converted the code to be a little more efficient, but Im not sure if you'll understand how it works. It uses Types and a Function, for information on Types do a search in the Newcommers Corner and Dark Basic Professional Discussuon, theres a great tutorial by BatVink explaining them. Anyhoo I created a type called Settings, and gave it four parameters, Settings.enm, Settings.ali, Settings.str, and Settings.astr. Once it was defined inside a GLOBAL type it could be used inside the function I created called StartGame(). The function is basically exactly like your subroutine only no need for returning, no problems WITH returning, easier to call, and all around... better. Look over the code, if you dont understand a single thing then just leave it and work with your previous code, this is just to show you the power of Functions and Types. (I also took out the two DIMs you had in there because A) I didnt see a need for them and B) Now that the information is stored in a type it's global anyways so there's no real advantage of dimming them).



So, to access your previous variables called enm, ali, str and astr just add Settings. before them. You can change Settings to something shorter, I know its a hassle to write so do as you wish.

Goodluck,
- RUC'

MMORPG programs
19
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 23rd Mar 2006 03:45
1 thing i dont understand though, why cant you do type settings instead of type set, endtype, global settings as set?
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 23rd Mar 2006 21:30
You can. Just change Set to Settings... Unless the Settings variable is conflicting with the type since it has the same name, try changing the Settings variable to something else, maybe Set. Basically try reversing them.

Login to post a reply

Server time is: 2024-11-27 23:42:39
Your offset time is: 2024-11-27 23:42:39