NAG Online Forums  

Go Back   NAG Online Forums > Community > Game.Dev

Reply
 
Thread Tools
Old 07-08-2007 RedNax wrote:   #21
Default

Originally Posted by dislekcia View Post
Of course, it pretty much does what RedNax did manually. Although I'd recommend using a pointer to the object the healthbar is monitoring instead of a global variable: targetObj.health instead of global.health, then all you do is set targetObj to the id of the object the healthbar should track.

Thanx for that Dislekcia. And so the learning experience continues! =D

Last edited by RedNax; 07-08-2007 at 01:36 PM.
RedNax
Guest
 
__________________


Reply With Quote
 
Old 07-08-2007 Cyberninja wrote:   #22
Default

Originally Posted by dislekcia View Post
No worries, and I really don't mind directing people where to look in the helpfile, something that big and detailed takes a while to get to grips with.

In general it's more about approach and implementation of what you want to get done than knowing some nifty command or algorithm.

-D

Yep! So true. I have to say though, I'm really impressed with Game Maker's capabilities. I honestly didn't think that one could create a professional looking game in this program. But it has really suprised me over this past month. I really love this program. :-)
Cyberninja
Member
 
Cyberninja is on a distinguished road
__________________


Reply With Quote
Cyberninja is offline  
Old 07-08-2007 dislekcia wrote:   #23
Default

Originally Posted by Cyberninja View Post
Yep! So true. I have to say though, I'm really impressed with Game Maker's capabilities. I honestly didn't think that one could create a professional looking game in this program. But it has really suprised me over this past month. I really love this program. :-)

Don't worry, everyone comes around eventually ;) Now all I need to do is get GM on TV.

-D
dislekcia
Game.Dev Moderator
and bettar-rar game developer than Wea-sel
 
dislekcia has a spectacular aura aboutdislekcia has a spectacular aura aboutdislekcia has a spectacular aura about
__________________
[StarCraft II]StarCraft II Character name and code: dislekcia.325 [Xbox Live]
Send an XBL Friend Request


Reply With Quote
dislekcia is offline  
Old 07-08-2007 Gazza_N wrote:   #24
Default

This is quite a nasty one, but here goes!

Is there any way to create dynamic collision masks in Game Maker? I'm working with a complex object for which I want precise collision checking, but this involves having a different collision sprite for each step in its rotation, as well as masks for moving components (large turrets). Rather than manually creating 360+ bitmaps, is there any way that I can create and assign the mask dynamically?

Thanks in advance for any advice!
Gazza_N
s gonna find ya, he's gonna getcha getcha getcha
 
Gazza_N will become famous soon enoughGazza_N will become famous soon enough
__________________
[Xbox Live]
Send an XBL Friend Request
[Backloggery]

Reply With Quote
Gazza_N is offline  
Old 07-08-2007 dislekcia wrote:   #25
Default

Is this registered or unregistered?

Unregistered I'd simply use a bunch of invisible collision only objects tied to the complex object, each repositioning itself according to current rotation and animation data. Any collision with one of those "shadow collision" objects would be a collision normally.

Actually, re-reading your description, why can't you simply use precise collision checking on the object and each turret? Precise will always check against the current frame, transparency and all. Then all you do is have the collision event set a flag variable that you check in your step (or end-step) event on the main object. Easy.

If I misread you and there's some other reason why you can't simply spread the collision across multiple tester objects and you're using registered GM, then you could draw the object to a surface and create a sprite from that surface and assign it as a mask/sprite to the core object each frame, although it would probably be a tad inefficient.

-D
dislekcia
Game.Dev Moderator
and bettar-rar game developer than Wea-sel
 
dislekcia has a spectacular aura aboutdislekcia has a spectacular aura aboutdislekcia has a spectacular aura about
__________________
[StarCraft II]StarCraft II Character name and code: dislekcia.325 [Xbox Live]
Send an XBL Friend Request


Reply With Quote
dislekcia is offline  
Old 07-08-2007 Gazza_N wrote:   #26
Default

Registered.

Thanks Dis. I'll try drawing to an offscreen surface (first time I work with them). Fortunately I'm only looking at tracking two main components at the moment, so I doubt there'll be any major slowdowns. As for precisely why I need to do it this way... Well, hopefully you'll be seeing soon enough ;).
Gazza_N
s gonna find ya, he's gonna getcha getcha getcha
 
Gazza_N will become famous soon enoughGazza_N will become famous soon enough
__________________
[Xbox Live]
Send an XBL Friend Request
[Backloggery]

Reply With Quote
Gazza_N is offline  
Old 07-08-2007 Vexo wrote:   #27
Default

ok i have a weird problem.
I want to create the basic ground for my game.
So i made it in Photoshop.
http://www.pixilive.com/viewbig.php?...7/Untitled.jpg
Then i made a Sprite and a object but when i create a room and want to place my ground i does this.
http://www.pixilive.com/viewbig.php?...Untdfitled.jpg
some weird green stuff above.
Please help
Vexo
Member
 
Vexo is on a distinguished road
__________________
[Steam]Steam: Vexo69 [StarCraft II]StarCraft II Character name and code: 286

Reply With Quote
Vexo is offline  
Old 07-08-2007 Gazza_N wrote:   #28
Default

EDIT: Never mind. Better answer given by ninja master in next post ;). "Advice" removed to protect innocents from harm.

Last edited by Gazza_N; 07-08-2007 at 09:33 PM. Reason: See post.
Gazza_N
s gonna find ya, he's gonna getcha getcha getcha
 
Gazza_N will become famous soon enoughGazza_N will become famous soon enough
__________________
[Xbox Live]
Send an XBL Friend Request
[Backloggery]

Reply With Quote
Gazza_N is offline  
Old 07-08-2007 dislekcia wrote:   #29
Default

Vexo, that's happening because you're leaving an area transparent in the image when you save it. JPG doesn't support transparency, so it's using any old colour there, that's where the green is coming from.

In GM you can make a sprite have a transparent colour by checking the "Transparent" box in the sprite's properties. That will treat the colour in the bottom left pixel as transparent and not draw it at all... Be warned though, this is only that EXACT colour! Anything else will appear, so I suggest using bmp as your format for now, it doesn't compress colours at all. Otherwise use tga, which saves transparency information that GM can load.

-D
dislekcia
Game.Dev Moderator
and bettar-rar game developer than Wea-sel
 
dislekcia has a spectacular aura aboutdislekcia has a spectacular aura aboutdislekcia has a spectacular aura about
__________________
[StarCraft II]StarCraft II Character name and code: dislekcia.325 [Xbox Live]
Send an XBL Friend Request


Reply With Quote
dislekcia is offline  
Old 07-08-2007 Vexo wrote:   #30
Default

ok tanx allot.
My master piece continues 1 step at a time :)
Vexo
Member
 
Vexo is on a distinguished road
__________________
[Steam]Steam: Vexo69 [StarCraft II]StarCraft II Character name and code: 286

Reply With Quote
Vexo is offline  
Old 08-08-2007 RedNax wrote:   #31
Default

Uhh, its me again =P

How do I get GM to check whether there is no object relative to my object's current position? I might just be messing up with my if statements here so I'm just wondering. Do I use Check Object?

EDIT: Nvm that, I got it =)

Last edited by RedNax; 08-08-2007 at 07:32 AM.
RedNax
Guest
 
__________________


Reply With Quote
 
Old 08-08-2007 dislekcia wrote:   #32
Default

Originally Posted by RedNax View Post
EDIT: Nvm that, I got it =)

Grats! Now you can answer that question when someone else asks it :)

-D
dislekcia
Game.Dev Moderator
and bettar-rar game developer than Wea-sel
 
dislekcia has a spectacular aura aboutdislekcia has a spectacular aura aboutdislekcia has a spectacular aura about
__________________
[StarCraft II]StarCraft II Character name and code: dislekcia.325 [Xbox Live]
Send an XBL Friend Request


Reply With Quote
dislekcia is offline  
Old 08-08-2007 Gazza_N wrote:   #33
Default

Dynamic surface-drawn mask failed, sadly, because I'm working in 3D. 3D mode doesn't support surfaces without me turning it on and off all the time. Looks like I'll just have to stick to my functional but inelegant collision cylinder.
Gazza_N
s gonna find ya, he's gonna getcha getcha getcha
 
Gazza_N will become famous soon enoughGazza_N will become famous soon enough
__________________
[Xbox Live]
Send an XBL Friend Request
[Backloggery]

Reply With Quote
Gazza_N is offline  
Old 08-08-2007 dislekcia wrote:   #34
Default

What's wrong with turning it on and off? Technically all that's doing is setting up a different projection/view matrix combo, which isn't exactly an expensive operation... Provided you do it during a step and not a draw cycle, you should be happypants.

-D
dislekcia
Game.Dev Moderator
and bettar-rar game developer than Wea-sel
 
dislekcia has a spectacular aura aboutdislekcia has a spectacular aura aboutdislekcia has a spectacular aura about
__________________
[StarCraft II]StarCraft II Character name and code: dislekcia.325 [Xbox Live]
Send an XBL Friend Request


Reply With Quote
dislekcia is offline  
Old 08-08-2007 Gazza_N wrote:   #35
Default

It... er... seemed inefficient.

Please don't hurt me?
Gazza_N
s gonna find ya, he's gonna getcha getcha getcha
 
Gazza_N will become famous soon enoughGazza_N will become famous soon enough
__________________
[Xbox Live]
Send an XBL Friend Request
[Backloggery]

Reply With Quote
Gazza_N is offline  
Old 08-08-2007 dislekcia wrote:   #36
Default

Originally Posted by Gazza_N View Post
It... er... seemed inefficient.

Please don't hurt me?

Alright, I won't... For now...

-D

P.S. Most modern games have several render-mode/context switches per frame. Essentially all you're doing is setting up the graphics card with slightly different values for the next stream of vertices it gets squirted. See it as a tool waiting to be used, not a heavy mode-dependant dinosaur ;)
dislekcia
Game.Dev Moderator
and bettar-rar game developer than Wea-sel
 
dislekcia has a spectacular aura aboutdislekcia has a spectacular aura aboutdislekcia has a spectacular aura about
__________________
[StarCraft II]StarCraft II Character name and code: dislekcia.325 [Xbox Live]
Send an XBL Friend Request


Reply With Quote
dislekcia is offline  
Old 14-08-2007 CiNiMoDZA wrote:   #37
Default

Hmm, stupid problem! Trying to make a timer, this is what I've got:

Code:
Create:
time = 0

Alarm 0:
time +=1

Step:
Set alarm 0 to 2

Draw:
draw_text(10, 10, time)
Im not getting any errors, but all my text is saying is 0? Dont know what to do!!!
Please help!!!

Thanks guys!!!
CiNiMoDZA
Member
 
CiNiMoDZA is on a distinguished road
__________________
[Xbox Live]
Send an XBL Friend Request


Reply With Quote
CiNiMoDZA is offline  
Old 15-08-2007 cairnswm wrote:   #38
Default

Create

Time = 0

Step
Time +=1

Draw
draw_text(10,10,time)

(That should give you a count of 30 per second)
cairnswm
Member
 
cairnswm is on a distinguished road
__________________


Reply With Quote
cairnswm is offline  
Old 15-08-2007 cairnswm wrote:   #39
Default

Create

StartTime = current_time;

Draw

draw_text(10,10,(current_time-StartTime)/1000);

Shows you for how many seconds the game has been running.

Last edited by cairnswm; 15-08-2007 at 12:19 PM.
cairnswm
Member
 
cairnswm is on a distinguished road
__________________


Reply With Quote
cairnswm is offline  
Old 15-08-2007 dislekcia wrote:   #40
Default

cairnswm is made of win.

Also, the reason your alarm was never firing is because you were constantly setting it to 2 frames every frame... It would decrease to 1 frame and then get set back to 2 all the time.

-D
dislekcia
Game.Dev Moderator
and bettar-rar game developer than Wea-sel
 
dislekcia has a spectacular aura aboutdislekcia has a spectacular aura aboutdislekcia has a spectacular aura about
__________________
[StarCraft II]StarCraft II Character name and code: dislekcia.325 [Xbox Live]
Send an XBL Friend Request


Reply With Quote
dislekcia is offline  
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:14 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 2010 NAG Magazine