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 / Adding guns to a game

Author
Message
the angry programmer
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location: lost in the code of DBP
Posted: 28th Apr 2010 06:45
hi, i need some help adding guns to a quick game, i went on the TGC store and got the DUAL_Elite (11502) (the free ones) and now i want to test the gun, how would i do that? can someone give me a code snippit or a tut? thanks

i WILL make pigs fly!
/ragequit
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 28th Apr 2010 13:31
Have a look here....there´s a good example.

cheers.

http://forum.thegamecreators.com/?m=forum_view&t=169266&b=7

I'm not a grumpy grandpa
the angry programmer
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location: lost in the code of DBP
Posted: 28th Apr 2010 18:09
can you tell me what i do, your example is named bala for the gun, how do i find out the model for my gun?

i WILL make pigs fly!
/ragequit
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 28th Apr 2010 20:15
Quote: "how do i find out the model for my gun?"


I don´t understand what you mean...
In that example, the gun is number 20 and the bullet is 21.
You can load in that code any gun you want as number 20.

cheers.

I'm not a grumpy grandpa
the angry programmer
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location: lost in the code of DBP
Posted: 28th Apr 2010 22:02
so what you are saying is, i put the gun and type gunnumber 20 in it and it magicly appears in it? what part would i have to load, in the gun file? can you possibly create a mini tut or somthing, sorry if i come off ramballing.

i WILL make pigs fly!
/ragequit
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 29th Apr 2010 03:43 Edited at: 29th Apr 2010 03:43
Have a look at the LOAD OBJECT filename , object number command. It allows you to load models into your game, which can then be manipulated like any other object. LOAD OBJECT requires a filename and an object number, so if you wanted to load your gun, say it was called "DUAL_ELITE.X", into object number 20, you would type the following:

LOAD OBJECT "DUAL_ELITE.X",20

Make sure you know the actual filename of your model and its extension, so you can load it. Also make sure that you have your model and your EXE in the same directory in this case. If you wanted to load it from a subfolder of your main directory (where your EXE is), you would do the following. Say the folder was called "EPIC GUN FOLDER". You would do this. Keep in mind it's not case-sensitive:

LOAD OBJECT "EPIC GUN FOLDER/DUAL_ELITE.X",20
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 29th Apr 2010 03:58 Edited at: 29th Apr 2010 04:01
When you have an 3D object...(your own object made in any 3D program)....and you would like to use it as your gun in a first person shooter, you will have to write some comands:

Load object "my_gun.x",1 That will load your object(your gun....the one you like more...whatever...)

Position object 1,camera position x(),camera postion y(),camera position z()

Those commands position object number 1 (refering your gun....the one you created...the one your friend gave at....)

so....knowing that we can load our objects (using comand LOAD OBJECT ,"my_object.x",1) we can put the object where we want....and just answering your cuestion about adding a gun...I supposed that you meant to use a gun in a first person shooter....I even ask my self now....mmmmmh let me think....

We can load our objects...
we can place this objects where we want
we can do a lot of things with Dbpro.

The example I posted here is to little advanced for a beginner sorry...but if you just read it little by little, you will notice, that this is the best tutorial you will find for this purpose.

I would like to help you somehow...I would like to hear about you about learning to programm with darkbasic and that examples around the forum where good for you....just let me know if you learn with us.


cheers.

I'm not a grumpy grandpa
the angry programmer
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location: lost in the code of DBP
Posted: 29th Apr 2010 04:38 Edited at: 29th Apr 2010 05:47
well, thanks for the remarks on that snippet you gave me, helped a LOT with OTHER things in that catagory, but, when i look at my main file in project, were i copyed the gun to, witch thing do i load? would i say


load object "DUAL_Elite (11502)",1
or
load object "DUAL_Elite",11502

or something else?
theres a lot of documents inside this folder, i just do not know what one, thanks MILLIONS for what you said already, and for being so knowing and not getting mad! thumps up!

i WILL make pigs fly!
/ragequit
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 1st May 2010 14:57
Use the one that ends with ".x" or ".dbo" or maybe even ".3ds", as those are the actual models that you can load. If you don't see any file extensions when looking at folders with windows explorer, go to TOOLS->Folder Options->View and uncheck "Hide file extensions". The other files you see (".bmp" , ".jpg", etc.) are textures. Make sure you load the ".x"/".dbo"/".3ds" version and include the file extension when you type in the filename.
the angry programmer
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location: lost in the code of DBP
Posted: 2nd May 2010 09:08
thanks 60 squares, could you possibly make a small code snippet if you could please?

i WILL make pigs fly!
/ragequit
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 6th May 2010 02:23
I could, but I'd need to know what the filename of your gun is. If you don't know, could you take a screenshot of the gun folder and post it here? It's really simple, just use LOAD OBJECT on the gun model's filename to load it into your game. If you can't see it, try scaling it to different sizes using SCALE OBJECT.
GreenDixy
16
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 6th May 2010 19:05 Edited at: 6th May 2010 19:05


Here yah go m8

======================================
the angry programmer
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location: lost in the code of DBP
Posted: 7th May 2010 05:43
thanks, too bad now that i downloaded the full version, i lost the gun file, can't install the plugins I PAID FOR and can't get my old projects back im doing just peachy, still waiting for a reply on a ticket i sent them yesterday about the plugin problem, thinking of just switching to c++ or GUD or whatever its called, thanks for the help, ill tell ya if it works.

i WILL make pigs fly!
/ragequit
GreenDixy
16
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 7th May 2010 11:17
I have been learning C++, And GDK as well. It's not to bad, But can be over whelming sometimes.

======================================
the angry programmer
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location: lost in the code of DBP
Posted: 9th May 2010 10:42 Edited at: 9th May 2010 10:42
sixty squares, heres that screenshot, sorry for the sloppy editing! MAKE SURE TO HIT VIEW AT BOTTOM RIGHT TO SEE!!!!

Attachments

Login to view attachments
the angry programmer
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location: lost in the code of DBP
Posted: 28th May 2010 05:35
error ill post pictures to show my error please help
ERROR #1 hit the red view button at the bottem right to view it....

Attachments

Login to view attachments
the angry programmer
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location: lost in the code of DBP
Posted: 28th May 2010 05:38
and the code i used to try it, and the files

Attachments

Login to view attachments
the angry programmer
14
Years of Service
User Offline
Joined: 19th Apr 2010
Location: lost in the code of DBP
Posted: 17th Jun 2010 08:33
bump---^
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Jun 2010 18:02
You haven't saved a project. You need to make a project, as the exe is created in the same folder as the .dbpro file, and the filepaths are relative to that .exe.

Or if you have created a project, it doesn't look like it. Sorry.

Rawwrr. Sig Fail.
Newcastle is awesome

Login to post a reply

Server time is: 2024-11-23 13:54:40
Your offset time is: 2024-11-23 13:54:40