Jump to content
IGNORED

RB+ Questions and help


Recommended Posts

Hello all.

I need some help with some things and am starting this post in hopes to get said help. I have ran into a few issues that I have not been able to overcome and hopefully somebody here can help me shed some light on my issues.

I would like more in depth help vs "go read the manual" or "just like try stuff man" If you feel the urge to say something similar to that, just don't reply.

Here goes nothing:

 

Problem A: R_sprite_gfxbase----- From what I understand about this function this SHOULD allow you to load a separate sprite for said object. What I don't understand is how to get it working properly, in most cases all that happens is I still have the same sprite but the colors are distorted (perhaps pulling the colors from the sprite I want to load?) Does a separate object need to be set up that is inactive which uses the sprite I want to pull? Can somebody please explain how to properly use this function?

 

Problem B: .MOD files not playing correctly. Although this is not a huge problem I did notice that some of the .mod files I have been using don't sound right. Some play just fine, but a few are cut short at their looping point and others sound like they are missing bits of audio. I'm curious as to why? Some of the ones that do not play correctly are very small in size so I find it odd that they don't load entirely.

 

Problem C: Projectiles. Let's say you have a horizontal scrolling shooter similar to Defender 2000 or Protector SE. Lets say hypothetically I have a projectile set up as an inactive object that a horizontal speed of 3. the way I would make it actually fire is by checking the position of the players ship and setting the projectile to match the X and Y coordinates and making it active all at once. The problem is if one projectile is already on the screen and I press fire again it won't create another projectile until the original one has left the screen and hit the edge kill zone. There has to be an easier way to do this! Do I set the number of projectile objects in the object list to something like 6? If I did that then I would need to set up a subroutine telling it to go to the next projectile down the list wouldn't I? There has to be a MUCH EASIER way to fire a projectile, I refuse to believe there isn't.

 

Problem D: Random spawning objects. Anybody been able to do this? every object on the screen has an X,Y coordinate, so how could you make lets say an enemy pop up in a random spot each time?

 

Any help would be great and much appreciated

 

Thanks in advance

:)

post-45896-0-60301200-1492643685_thumb.gif

Edited by Jeffrey_Bones
Link to comment
Share on other sites

Problem A: R_sprite_gfxbase----- From what I understand about this function this SHOULD allow you to load a separate sprite for said object. What I don't understand is how to get it working properly, in most cases all that happens is I still have the same sprite but the colors are distorted (perhaps pulling the colors from the sprite I want to load?) Does a separate object need to be set up that is inactive which uses the sprite I want to pull? Can somebody please explain how to properly use this function?

 

Problem B: .MOD files not playing correctly. Although this is not a huge problem I did notice that some of the .mod files I have been using don't sound right. Some play just fine, but a few are cut short at their looping point and others sound like they are missing bits of audio. I'm curious as to why? Some of the ones that do not play correctly are very small in size so I find it odd that they don't load entirely.

 

Problem C: Projectiles. Let's say you have a horizontal scrolling shooter similar to Defender 2000 or Protector SE. Lets say hypothetically I have a projectile set up as an inactive object that a horizontal speed of 3. the way I would make it actually fire is by checking the position of the players ship and setting the projectile to match the X and Y coordinates and making it active all at once. The problem is if one projectile is already on the screen and I press fire again it won't create another projectile until the original one has left the screen and hit the edge kill zone. There has to be an easier way to do this! Do I set the number of projectile objects in the object list to something like 6? If I did that then I would need to set up a subroutine telling it to go to the next projectile down the list wouldn't I? There has to be a MUCH EASIER way to fire a projectile, I refuse to believe there isn't.

 

Problem D: Random spawning objects. Anybody been able to do this? every object on the screen has an X,Y coordinate, so how could you make lets say an enemy pop up in a random spot each time?

 

Any help would be great and much appreciated

 

Thanks in advance

:)

attachicon.gifBizzar Bee.gif

 

A - No, it just changes the graphics pointer. It doesn't 'load' anything. It isn't a function, it is a field in the sprite object definition.

B - Not all .MOD files play correctly. Use SoundTracker compliant files and you'll be fine.

C - Yes, that is how you do it. No, there isn't any easier way to do it. It's called programming. Otherwise it'd be scripting.

D - Set it's X/Y position as required and make it active. Simple as that.

E - I thought 'Beez' was a JS3 exclusive you didn't want anyone outside of the 'truth detectives' to see? You could try asking there for help.

  • Like 2
Link to comment
Share on other sites

E - I thought 'Beez' was a JS3 exclusive. You could try asking there for help.

yeah.... that group...... hmmmm.... Let's just say that group is not my favorite group anymore. Not feeling it lately. As for Beez 64, I wasn't aware you knew about that.

 

well thanks anyway for the help.

  • Like 1
Link to comment
Share on other sites

I know you said not to say 'go read the manual' - but there is an example of bullet spawning in the invaders example :)

 

If you get stuck, post some code and we'll take a look. It's a bit difficult to assess/help with nothing to look at.

  • Like 2
Link to comment
Share on other sites

wait wait wait wait..... I just thought of something. If I did want to change the sprite entirely I SHOULD be able to change the offset of R_sprite_obj and then change the bit depth (if applicable) and sizes and CLUT (if applicable)

 

Basically what I mean is say you have a variable that counts the levels.

 

If worldnumber =2

" Change all Variables of object platform here"

" "

" "

 

I am going to try this and see if it works

 

Link to comment
Share on other sites

i dont know why i am giving this out considering the previous dealings we have had with my game but you need something like this to get the next available object

 

 

C:

function get_unused_explosion() as UBYTE
local counter as UBYTE
for counter = 0 to ubound(explosion)
if rlist [explosion[counter]].active = R_is_inactive then
function = counter
exit for
end if
next counter
end function

 

this is set up using the object list editor, if you don't use that you will need to sort this out to your own needs if your copying and pasting

Edited by omf
  • Like 1
Link to comment
Share on other sites

One strategy the O.P. could take is to make his object list and stick with it. Don't make a new bullet: swap out a blank sprite until you need a bullet again. When a "new" one is needed swap in the bullet image and re-position the sprite where needed.

 

This limits your game engine to a finite amount of objects/sprites. The advantage is you avoid allocating and de-allocating things which can get sub-optimal fast.

Link to comment
Share on other sites

You can change the bitmap and CLUT - but not the depth,width,height.

 

That functionality is already in the next RAPTOR API release, but not yet available outside of BetaTesters.

But you COULD change the scaling which would in turn change the size. Interesting. I could use this trick to swap out some moving platforms for a certain project that already has a list of 118 objects.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...