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.

DarkBASIC Discussion / How do you place an enemy in a level, Im stumped?

Author
Message
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 24th Jul 2005 04:14
I got collision and stuff to work, Im still having some trouble with MS#D models but if they can do animation ill use it. I use Deled to do levels with and use NGC for collision.

BUT, how do you place enemies within a level? Is there some sort of enemy/entity placement program that can do this, or do I have to code them blind?
Curious.....

Comics and Games-Bread and Butter.
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 24th Jul 2005 04:18
Load the enemy object, position it. If you need help wit that, start your DBC life from scratch.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 24th Jul 2005 08:48
DBC won't do enemy AI for you, as Xenocythe said start with loading the enemy object, code it blind. You could always devise your own "insert enemy here" system if you've got a lot of guys to put in.


I'm going to eat you!
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 24th Jul 2005 13:23
Call me Xeno, matey. Xeno.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 24th Jul 2005 15:07
Alrighty then, Xeno.


I'm going to eat you!
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 25th Jul 2005 15:09
thats what i was worried about. and Xeno, your a regular riot , however, BearCDP you hit the nail on the head, im referring to loading multiple enemies into a level and I took a shot at making a system where I could load my level and color areas that arent walls so Id know only to place enemies there. But if coding blind is my only option then I guess ill be plugging away fro the next 4 years. Thanks, wish me a happy suicide

Comics and Games-Bread and Butter.
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 26th Jul 2005 20:07
Make a map with enemy spawnpoints. This way you're sure it won't spawn in a wall or something...

Immunity and Annihalation makes Immunihalation...
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 26th Jul 2005 21:11 Edited at: 27th Jul 2005 01:22
Well, you could do that or you could do one of these two things:

1.

Create a camera fly view mode where you can fly around your map going through the walls and whatnot. Then, set a text display on the screen for the camera's current x, y and z coordinates. Next, fly to where you want, get the coordinates, write them down, and that's your position for the enemy.

OR

2.

Create a basic map editor where you place the enemies and other entities down and save their positions to a .dat file, then just read the .dat file before the game starts for the positions and use a for/next loop to position them.

The first one is much simpler than the second, and now that I think of it you might not want the camera to fly incase you position the enemies in the air when you think you're on the ground, anyways that's how I'd do it. You might also want to get the user's rotation to rotate the enemies properly aswell.

Goodluck.

Jozers
20
Years of Service
User Offline
Joined: 19th Nov 2004
Location: If I knew I would tell you!!
Posted: 26th Jul 2005 22:13
RUCCUS, how do you save object positions to .dat files. Just interested because i was thinking about making a map editor.
Jozers
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 27th Jul 2005 01:20 Edited at: 27th Jul 2005 01:23
Well it's quite a broad subject and can take awhile to get used to the file commands but Ill explain how in words, the code however you'll have to do yourself.

Look up the read and write commands;

Use the write string command to write the x y and z position to a file,

Make sure each position is put on a new line

Then, use the read string command to get the positions and then store those positions in variables or just position the enemies as you read them.

But, the only problem is you're reading a string and you need it as an integer so you need to use the val command to change the string into an integer, then you can position the objects.

Try searching the forums there's a lot of discussion on the file commands.

Just a tip, start out basic by making a program that show's a number on the screen. And you can increase/decrease the number by pressing + or -. Then have a button like s save the number to a file, .txt will work. Then have the program load the variable using the read commands and update the variable at the start up.

From there move onto saving 3 variables, then move onto using the 3 variables to position objects, then move on to positioning more than one object. From there you should be starting to get used to the commands and will be able to work your way onto adding it to the map editor.

Goodluck!

Jozers
20
Years of Service
User Offline
Joined: 19th Nov 2004
Location: If I knew I would tell you!!
Posted: 28th Jul 2005 01:34
RUCCUS would the same thing apply to save character stats for a game??? And thats how you would save the character position as well!!
Thanks
Jozers
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 28th Jul 2005 17:29
You can store all sorts of fun stuff in files. You'll notice when editing in darkedit whenever you compile it saves a temporary file of your code (I forget if it's the replaced version or not), just in case.


I'm going to eat you!
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 29th Jul 2005 07:13
workin on it. Thank you all. Itll be a miracle if this project ever gets done, but if it does, theres gonna be a spot in the credits with your names in it. now to make a team request...**SIGH**

Comics and Games-Bread and Butter.
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 1st Aug 2005 23:44
Oh dear, oh dear, oh dear...

[Insert extremely witty comment here] :: Add me to MSN if you like, but don't expect any big favours [unless you like VB6]. ... IDK!!
r333
19
Years of Service
User Offline
Joined: 18th Jul 2005
Location:
Posted: 2nd Aug 2005 00:05
How WOULD you go about making a map with enemy spawnpoints? That would help greatly!

Thanks!(for..whatever it is you did...)
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 2nd Aug 2005 07:23
Use a text file to hold the level info. Here's an example->

Format:
Keyword "new" designates new object to keep track of. Once "new " (with space) is parsed, the next word after a space is parsed as one of the following:
object
matrix
enemy
spawn

There will be a sequence of values following each new declaration, defining the various attributes for each object. These are typically the ID number, x position, y position, z position, x angle, y angle, and z angle in that order. Though there are special cases, such as matrices where normal object transformation procedures do not apply.




I'm going to eat you!
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 2nd Aug 2005 16:33
If you want to load the same enemy more then once in different random positions, This would be the code:


That should work.

If you want four of two different enemies, I think this is the code:


There!
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 10th Sep 2005 06:38
still working on it.....
I tell you all, this games GONNA GET DONE!!
Its gonna look sloppy and its going to be sludge-slow, but once Ive got my proof-of-concept game on its feet, the projects that follow are going to look better.

Did I mention that im using sprites? No 3d models here. I want to make a doom-clone and all this time ive been scratching away at DB code, im getting closer and closer to making that game you aaaaaaall have been waiting for! Happy programming!

Comics and Games-Bread and Butter.

Login to post a reply

Server time is: 2025-05-22 08:42:27
Your offset time is: 2025-05-22 08:42:27