Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Isegrim on Mon 16/02/2004 22:42:46

Title: RawDraw and Objects
Post by: Isegrim on Mon 16/02/2004 22:42:46
Hi!

Is it somehow possible to RawDraw over of Objects (without merging them)? Right now, the object stays on top of any lines or circles I draw...

Maybe I should describe better, in case you can help me work around that problem:

I am making a knight tournament game. One discipline is crossbow shooting from first person perspective. The flight path of the bolt is calculated in 3d coordinates and then projected on the screen.
My idea to check for a hit on the target was to make the target an object and check a GetObject when the bolt has reached the correct z-distance.
I tried with Regions earlier, but I want the target to be farther away from the player with every shot.

To give the player a clue where his bolts strike, the flight path is visualized by RawDrawCircles. As I said, they do not show where the object is, which is unfortunate, because the player cannot determine whether he has shot too far or too short.
(I have implemented a function that only draws Circles if the bolt is not behind the target, this works with regions)
Title: Re:RawDraw and Objects
Post by: a-v-o on Mon 16/02/2004 22:52:36
If you like the regions then maybe you can use multiple regions which are like rings with the same center one inside the other.

After the biggest target you show a smaller one and disable the region ring which is most outside... then only the remaining regions trigger the hit event.

This way you can make the target region smaller and smaller
Title: Re:RawDraw and Objects
Post by: Isegrim on Mon 16/02/2004 22:54:59
Yeah, maybe... that means a little more scripting, though ;), but I won't die of that...

Edit:

This solution will not work for a similar problem, however.
Another discipline is jousting, like in Defender of the Crown: The Opponent is riding towards the player and the player has to position his lance. I wanted to make the lance from RawDrawn lines...
Title: Re:RawDraw and Objects
Post by: Isegrim on Wed 18/02/2004 09:57:34
Please mark the edit of my previous post.
Title: Re:RawDraw and Objects
Post by: a-v-o on Wed 18/02/2004 20:51:16
I'd use 2 objects: One for the opponent which is automatically scalled when coming closer. And one for the lance which could be moved left, right, up and down.

Or why would you want to use rawdrawlines?
Title: Re:RawDraw and Objects
Post by: on Sun 29/02/2004 13:00:28
I want to have a correct perspective to the lance, in order to make it appear more realistic. The opponent however is made from sprites (although I wasted a thought or two on making him from projected polygons with RawDrawTriangle, but I don't think that a very sensible idea)
Title: Re:RawDraw and Objects
Post by: Scorpiorus on Fri 05/03/2004 22:43:09
What if you RawDrawImage the opponent sprite then? You can refresh the screen on every loop with the RawRestoreScreen() function the rawdraw the sprite and finally projected lance.
Title: Re:RawDraw and Objects
Post by: on Sat 06/03/2004 16:41:39
*Grmpf* Should have thought of that myself...
But thanks a big lot!

Btw. any way to scale that sprite, or do I have to use several sprites?
Title: Re:RawDraw and Objects
Post by: Scorpiorus on Sat 06/03/2004 17:03:42
QuoteBtw. any way to scale that sprite, or do I have to use several sprites?
Nope, I'm afraid. RawDrawImageEx(int slot, int x, int y, int width, int height) could be a good suggestion I think. :)
Title: Re:RawDraw and Objects
Post by: Isegrim on Sun 07/03/2004 20:52:23
Yeah, I remember someone suggested this a while ago, and if I remember correctly, Chris liked the idea... Maybe I should just have patience...