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.

2D All the way! / RPG Problems

Author
Message
Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 27th Jul 2005 01:00
I need help with the get image function for DBC. How do you slow down get image without messing with sync time or wait time?
ArcAngel
22
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 27th Jul 2005 12:58
put it outside the loop and make it a sprite so it can be used in the loop.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 27th Jul 2005 13:18 Edited at: 29th Jul 2005 01:24
Why would you want to slow down get image? Post some code into snippets so everybody can see what your trying to do.

With get image you load the bitmap you want to use first then get image. The syntax: get image #,x,y,x2,y2

#=Image number
<----x---->
x,y----------| ^
|------------| |
|------------| Y
|------------| |
|------------| v
|----------x2,y2

(The above is my primitive way of showing an image) X goes left and right. Y is up and down)

Here's a snip using a graphic from my first game.

Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 28th Jul 2005 00:06
This is what my get image is for the rightkey()...
Instead of inc rightframe should I do rightframe = rightframe +.5 or something like that?
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 28th Jul 2005 09:16
The Source didn't work... always use code snips.



You have to use whole numbers for image numbers. If you want to use decimal points you have to use real numbers. A real number is represented by a # sign after the variable name.



But again... as far as images are concerned... you only use whole numbers.

Post that code again using code snips so I can see exactly what you mean.
NanoBrain
21
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 28th Jul 2005 21:55
Psycho Joker,

If I understand you correctly, try this:



This will increment the value in rightframe by one whole unit, each time the program checks the state of the right key.


+NanoBrain+
Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 29th Jul 2005 00:23
Is this how you make a code snippet?

Thats the smaller version of the code for just the right key.
The animation is to fast to see the actual movement of the character. Right now I'm working on an RPG and eventually going onto a Metal Slug remake. The RPG game is to make sure I can do everthing correctly. The code works great for explosions and background images but not for the actual player.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 30th Jul 2005 06:28 Edited at: 30th Jul 2005 06:30
Yup you got it. One other thing... you can attach any media that's loaded up in any code you need help with. If you upload media you'll be helped by more people (a lot of us hate making media to help people).

Since your image capture is all relatively the same you can use a for next loop to get all the images. The images in my example were all over the place. Since I don't have the image you're working with the following code is a "best guess"... but if it doesn't fit just right you can change it.



To slow down anything you can add a timer. Change the 100 to increase/decrease the delay.



Maybe you should use sprites instead of a plain. Is the character being anti-aliased?. Is that why it's not good for the player? The ,1 at the end of get image in the first snip takes the image exactly the way it is (so doesn't anti-alias).

Hope this helps.
Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 2nd Aug 2005 15:54
I put sleep 20 after the sync and it slowed down the animation of the character. I then ajusted the speed of the character and it works great. I don't know if its the best way to have a better animation but it works. Thanks Grog Grueslayer for the get image advise. I'll try to implament it into the code. For each character animation their is the same spacing between them. I made a wire frame grid in the called image so I could get the exact pixel so they come out centered.
I decided to lay off on the RPG and see what I can do with the Metal Slug remake for a bit. I switch back in forth so I don't get bored with myself. I have all the animation to work like the RPG and I have the side scroller to work also. I just need to work on some AI(if you want to call it that) and basic concept of the enemy appearing when the character reaches a checkpoint.

I can make the enmey attack if your in a certain distance of it. Else it just idles untill your in distance. I have to work on the shoot gun and throwing grenade function for both the character and the enemy. I put the camera above the plains and rotated them 90 degrees so they face the camera. This changes the y axis to the z axis. Confusing sometimes if you know what I mean. For the shoot function I want it so the character can only shoot at 0,45, and 90 degrees. I use the arrow keys to move so it'll just be the combination of them to shoot at the correct angles.

Thanks for the ideas and if you know AI or grenade functions in 2d, I sure could use the help.
Psycho Joker
Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 3rd Aug 2005 21:35 Edited at: 3rd Aug 2005 21:35
Does anyone know how to have multiple enemies have the same get image texture. For some reason only the first enemy uses all the images correctly and the others only use the first image. Any ideas?
D Ogre
22
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 4th Aug 2005 02:57 Edited at: 4th Aug 2005 03:18
If I understand you currectly, Psycho Joker, you want to use the same animation image set for each sprite used for the enemies.

You will will have to set it up inside of a loop of some sort. You will want to use arrays to keep track of each enemy and its animation. Calculate the movement and frames of animation for each enemy before the SYNC command. I am using this technic in another thread for a Space INVADER game that I am helping with.

This snippet is part of the code worked out so far for the space invader game. I know your trying to do a RPG, but the basic principles still apply. It includes explosion animation and collision.



If the snippet above is too confusing, I have a generic code snippet I wrote months ago for an explanation for moving multiple enemies. It doesn't do animation, but it does make use of the same image for each.

Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 4th Aug 2005 17:11
I think I got the animation to work for each enemy. I'm using plains instead of sprites. Do you know how to position each enemy at a certain position according to the x axis because I can't see each enemy clearly. Look at the pick if it loads. Do you know object collision so they dont overlap on the same x and z position?

Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 10th Aug 2005 20:03
This is for the RPG:
I've been working with the collision and I decided to go with tile Collision. Have collision for each image was to slow to work with. Does anyone know how to save old position on level so when Player comes back from the battle engine he is in that position?
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 11th Aug 2005 05:49
Right before going into the battle do something like "OldX=PlayerX" and "OldY=PlayerY"... then before going back do the opposite "PlayerX=OldX" and "PlayerY=OldY".
Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 11th Aug 2005 19:26
I tried doing something like that but it places me back at the position you start the game with. I'll see if I can figure it out tonight. It probably just a simple mistake. If I cant figure it out I'll paste the code on here.
Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 15th Aug 2005 18:10
Ok.. I have the return from battle to put you back in the right position on the map. I guess thats how I do the same thing for the town people and monsters. I want to make it so that every so many steps you get attacked by an enemy. How do I count steps for the player or should I just figure out some code so that when I subtract old x from new x and old y from new y, they = a number that then calls the battle engine? Any ideas?
Darkbasic MADPSP
21
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 15th Aug 2005 19:52
That's one sweet rpg

Love games go to http://www.freewebs.com/halorc
or
http://www.freewebs.com/gamersmad
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 16th Aug 2005 02:42
Quote: "Ok.. I have the return from battle to put you back in the right position on the map. I guess thats how I do the same thing for the town people and monsters. I want to make it so that every so many steps you get attacked by an enemy. How do I count steps for the player or should I just figure out some code so that when I subtract old x from new x and old y from new y, they = a number that then calls the battle engine? Any ideas? "


If you make it after so many steps it'll get annoying to the player. It needs to be random. You just use something to hold the movement. Put "moves=0:attack=rnd(14)+1" before the do loop... every time the player moves to another square (not counting blocked movement) "inc moves:if moves=attack then goto Battle". At the end of the battle "moves=0:attack=rnd(14)+1" to start the cycle over again.
Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 16th Aug 2005 23:23 Edited at: 16th Aug 2005 23:24
Thanks Grog GrueSlayer, I'll see what I can do with the code. I thought about using a timer() and increasing it when the player moves. When the player moves a certian amount then use the code you gave me so the player won't have a chance to fight every step.
Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 26th Aug 2005 15:42
I'm Working on getting the buildings to load onto the map with the tile collision. There are going to be two building images. One of them you can't walk over but in some areas you can walk under it. The other one allows you to walk over it. This way of placing the images allows it to have a 3D effect. It looks like what Final Fantasy used on SuperNES.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 27th Aug 2005 06:36
Cool Can you post a screenshot?
Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 30th Aug 2005 23:52


This shows how you can walk over the trees untill you reach the trunk. I'm still working on how to place them on the map. I have it so that when you walk a certain distance from them they disapear but I forgot to count for image size so I have to mess with that for a bit. Any Ideas on how to move town people? I have an idea on how to do it but I want to get some more ideas.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 31st Aug 2005 01:53 Edited at: 31st Aug 2005 01:54
You place them on the map the same way you did the squares and the ground (unless that's just a picture and not a tiled map). The only thing you really need to do is change that white background on the plants to black... to make it a transparency.

If you want npcs to just keep repeating the same movements all the time (like guards going over the same area like their on patrol) you need to keep 3 sets of x and y locations... where they are now... where they started... and where you want them to go. You also need to keep which way their going (to the start or to the end). I haven't worked that much with npcs so somebody else might have better ideas.
Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 1st Sep 2005 19:24
The map has its own tiled map and the objects will have their own tile map. Their will be three tile maps total. One for collision and two for the things you can and cant walk over. Placing them is a little harder because they will be a bigger size then the tile collision. I know how to make the trees tranparent, I just have to make them the size of the collision box first. What I thought about doing was rotating the tiles a little on the y axis so that they can show a 3d effect. Like when you pass through the tree, the part that you were on top of, now covers you. Just some ideas I'm throwing around to think about.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 2nd Sep 2005 02:18
Cool. You're on the right track then.
Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 9th Oct 2005 02:02
I have most of the first town done. You can walk into the shops and it transfers you to a diffrent map for the forground and a black background so you can see just the building your in. When you come back "walk out the door" it brings you back to the position you left. The battle engine works with the gif spells, health, multiple enemies, multiple players, but I cant get the character to go back to the main map after the battle is over. You have an inventor thats all text animated with no pictures minus the picture of the item/attack/magic you select with the mouse or arrow keys. I'll try to give the dialogue of the characters a typewriter effect but for now it just diplays the whole thing at once in one big box. That's all i've done with that lately. I'm working on a 3d fps engine also so that takes up some time.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 9th Oct 2005 04:09
Cool! Can you post some new screenshots. I love RPG's.
UnderLord
22
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 9th Oct 2005 08:04
Quote: "typewriter effect but for now it just diplays the whole thing at once in one big box."


To get the type writer effect i believe you could do sleep 100 that will slow down the print command and thus give you a typewriter effect although im not sure if it will work but you can always test it out.

When we talk to god, we're praying. When god talks to us, we're schizophrenic.
http://dbworlds.darkuniverse.net/
Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 10th Oct 2005 06:37
I'll post some screenshots in a couple days when I get back into the RPG game. The typewriter effect cant use the sleep command because I already have sleep at 20 for the animations to work right. I think I found out a way that uses a typing timer that counts the letters and adds a sencond after it types a letter to slow it down. The letters don't align right so I'll look at the code some more. It just might be the font or something stupid like that.
Oraculaca
23
Years of Service
User Offline
Joined: 6th Jan 2003
Location: Scotland
Posted: 10th Oct 2005 10:56
could you not just have a counter running in your main loop that calls a text printing function after so many counts? You could use the same for your animations to avoid slowing the actual program.




UnderLord
22
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 10th Oct 2005 18:27
Quote: "could you not just have a counter running in your main loop that calls a text printing function after so many counts? You could use the same for your animations to avoid slowing the actual program."


Yeah i just thought about that using sleep 100 would slow the whole game down just not the text.

But then you know there is a whole world of code at the code base

Its what darth vader woulda done if he was a programmer.

When we talk to god, we're praying. When god talks to us, we're schizophrenic.
http://dbworlds.darkuniverse.net/
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 10th Oct 2005 20:45 Edited at: 10th Oct 2005 20:48
Quote: "could you not just have a counter running in your main loop that calls a text printing function after so many counts? You could use the same for your animations to avoid slowing the actual program."


It would be better to use a timer instead of increasing a number... because that loop would go VERY fast.

Psycho Joker
20
Years of Service
User Offline
Joined: 13th Jul 2005
Location:
Posted: 12th Oct 2005 03:41
I think I'm going to use a timer similar to what Grog Grueslayer was talking about. I have most of it coded already. It calls text from a .txt file to print out on the screen. The whole text file is encrypted so you can't change it. I learned how to do that with Visual Basic C++ and the games I programmed in that language.


Here is a picture of FPS that I'm working on with a friend.

Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 12th Oct 2005 06:00 Edited at: 12th Oct 2005 06:01
Cool screenshot!

Login to post a reply

Server time is: 2026-07-06 15:44:19
Your offset time is: 2026-07-06 15:44:19