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 apply an image (animated) to an object?

Author
Message
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 23rd Sep 2004 14:14 Edited at: 23rd Sep 2004 14:16
When I use a set of images to make up enemy movement, I try to apply them to an object so when I use that object in a FPS, it looks like the enemy is moving. However Ive had no luck...anyone know how I can accomplish this?

Comics and Games-Bread and Butter.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 23rd Sep 2004 14:40
Are you talking about animated textures?

There's a couple ways:

1:Use memblocks and swap textures repeatedly on objects, could be kinda slow.

2ut all your images in a slideshow format and use scroll texture and scroll it by an amount so that one frame moves up each time you scroll.

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 23rd Sep 2004 15:42
Slideshow format?
I just tried out memblock command--it needs enhanced mode to run.

I had been trying to do something like this:

for i = 1 to 4
load image str$(i)+".bmp",i+4 : `textures for FPS style sprites
next i
make object plain 1, 10, 10
do
Get image i, 0,0,29,47
Sprite 1, 5,5, i
texture object 1, i
loop

I get some blue fuzz and thats all. The fuzz looks like its animating itself though, so I cant be 100% wrong. Can I?

Comics and Games-Bread and Butter.
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 24th Sep 2004 10:07
Think I got something--
load an avi file with the animation and play/loop the animation. I found the example in the Dbtutor program. Theres some good stuff in there.

Comics and Games-Bread and Butter.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 25th Sep 2004 10:46
The only problem with animations is that they are slow, especially when you try to scale them and move them around as they're playing.

Another method:
Say you have a 10-frame animation for a sprite. Make 10 plains and texture them each with a frame then hide the last 9, and hide,unhide,hide,unhide,hide,unhide, flipping through the different plains with the various plains on them.

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 26th Sep 2004 07:23 Edited at: 26th Sep 2004 07:28
Wouldnt that slow the game down too?

EDIT: Not that Im complaining or anything...
EDIT again: But how would I get all of the plains to register as one object? Im using the animations for an enemy in a FPS.

Comics and Games-Bread and Butter.
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 26th Sep 2004 08:21
This is what I do for animated textures on objects (explosions, smoke, plasma...):

Create an image, say, 512x64. That gives you 8 images that are 64x64. Grab these eight images, like this:


Then, create your object, and animate it like this:


Get it?

Good Luck

Xander Moser - Bolt Software - Firewall
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 26th Sep 2004 13:50
tried it...doesnt work. Keep getting:
Runtime error at line 4. Images range from 1 to 65535

Comics and Games-Bread and Butter.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 26th Sep 2004 14:23
That means somewhere you gave it an image that did not exist.

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 8th Oct 2004 16:53
Ok ive been hackin at this, the image is there its just not...there? Is there no way to make simple enemies like in doom? I dropped 3D enemies, if I drop 2D enemies ill have nothing!!

Comics and Games-Bread and Butter.
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 9th Oct 2004 00:29
Calmness. As far as I can tell, Bolt's code works. If you copied and pasted it exactly, then make sure that you change "if frame>8 then frame=1" to represent the number of images you have.

something
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 10th Oct 2004 14:17
When you ran Bolts code (thanks by the way) was it smooth or did the image twitch a little bit when it moved from the last frame to the first? If not then I think its my computer..even though for a 400MHZ it runs RTCW, Q3, the deadly dozen...etc all at full power


Comics and Games-Bread and Butter.
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 10th Oct 2004 14:30
Ok I just tried like 4 different images and Im still getting the same error. Is this some kind of joke? The image is in the correct directory, ive copied the code-copy+paste-straight into Darkbasic and im stil getting the same g*d d*mn error. Forgive my language please...just so frustrating.

Comics and Games-Bread and Butter.
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 11th Oct 2004 12:45
Yes, I think everyone here can understand how frustrating coding can be And I assure you its no joke. I had no problems with the code whatsoever. No twitching when switching from the last to the first. If your still getting an error, I'm not sure what to say (besides making sure that you changed the name of the loaded in images to reflect your image names, but I doubt that's the problem)

If you would post some code, we might be able to help you some more.

something

Login to post a reply

Server time is: 2025-05-24 17:33:14
Your offset time is: 2025-05-24 17:33:14