English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. AMOS (https://eab.abime.net/forumdisplay.php?f=119)
-   -   Manual priority setting (https://eab.abime.net/showthread.php?t=88778)

Brick Nash 25 September 2017 14:00

Manual priority setting
 
I've been reading through the manual and there only seems to be two ways to set a bob's priority on the screen, both of which are done somewhat automatically.

The "bob order" way, where higher number bobs get priority by default is tidy but somewhat useless for what I'm trying to do.

Priority On is great for general use depth perception, but even with it on, if two bobs have an equal Y coordinate on screen it goes back to the old "which bob has the higher number" method.

Since I generally store my player images first in the bank so I can add around it, the enemy bobs always seem to overlap the player when on equal Y footing, but I'd like it the other way around.

I've tried "Priority Reverse On" and it seemed to be what I was after as it makes the first set of images in the bank take priority, but unfortunately it also automatically reverses and affects how the depth is calculated by the Y coordinate and so now bobs more in the background appear in front of those more in the foreground

Is there a way to manually set a bob's priority by some custom code? Two rather limited methods doesn't seem that flexible.

As always many thanks!

volvo_0ne 25 September 2017 21:11

Pick your BOB numbers carefully, the IMAGE numbers are largely irrelevant...

From the manual.....
" Bob Priority It is important to understand that every Bob automatically possesses a priority of importance, and that this priority is based on the Bob's number. So a Bob carries a priority value from 0 to 63, and AMOS Professional uses this value to decide in which order Bobs are displayed and which Bobs barge their way in front of others when moving around the screen. The general rule is that a Bob with a higher priority number is displayed in front of one with a lower priority number. For example, Bob 5 would cut in front of Bob 4, but be obscured if Bob 6 crossed its path. So it is clear that this priority system should always be remembered when you number your Bobs. AMOS Professional allows changes in the priority system to suit your needs, this first system offers an alternative based not on Bob numbers, but on the position of Bobs on the screen. "

Your answer is in there, but it means you may have to re-think some concepts.

V1

Brick Nash 26 September 2017 14:21

Ahh ok, I've been assuming it's the image number which controls priority.

In saying that, I tried re-organising priority with the bob numbers and it doesn't make any difference with the "Priority On" instruction. Still, that's good to know about the numbers. I have some custom variables linked to bob numbers using player and enemy names so I only had to change two things for it to affect the whole code, so not much of a headache there.

Thanks for that! :)

Brick Nash 08 October 2017 17:21

Hey, I figured I'd post a new topic in this old thread since it's somewhat about the same thing.

In the manual it says that "Priority On" is governed by the Y coordinate, but in my game it seems to be activated somewhat by the X coordinate too.

Generally it works fine, but if my player and the enemy are on an equal Y coordinate plain and if my player's X is less then the enemy's X (if the player is to the left of the enemy) then the enemy will have priority, and vice verse. This happens even if its one pixel either way.

I turned Priority off to see what would happen and as expected my player took priority permanently.

It's a little annoying as I have some moves set up so that it's best if the player is in front of the enemy, but I don't know why the X coordinate is getting involved at all?

idrougge 09 October 2017 02:53

It makes perfect sense since that's the way the screen is drawn. From left to right, downwards.

Brick Nash 09 October 2017 16:55

Quote:

Originally Posted by idrougge (Post 1190795)
It makes perfect sense since that's the way the screen is drawn. From left to right, downwards.

Ok fair enough, but it doesn't mention that anywhere in the manual and it does affect to a small extent what's happening on screen.

idrougge 10 October 2017 01:59

Just be glad that it's not the Blitz Basic "manual".


All times are GMT +2. The time now is 18:27.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04123 seconds with 11 queries