⌂ YolkfolkThe Dizzy Fansite
Community discussion

DizzyAGE General Coding Queries

Started by delta on 9 February 2008 • 258,915 views

721 posts
#82210
Thanks Grandad :)

After much fiddling and faffing I've managed to get it all into the game and it works extremely well. The only problem is in the CloseRoom function because I get a badtype error every time I try to leave. Any ideas why it'd be objecting?

Other than that it works great :tup:

Edit: Don't worry, I've sorted it. For some reason it didn't like how it was written. I changed the layout of the code in that function slightly and made everything a bit more specific each time a new "set" was made.

Eggsample:

idx = ObjFind(5678);
ObjSet(idx,O_TARGET,790);

It takes longer to write the code by doing that for each object but it now functions absolutely perfectly. And we've ticked one more problem off our list. Grandad, you are a star!!!
👍 0
#82211
No idea why the CloseRoom function was acting silly, but glad that it's working.
👍 0
#82748
Can someone point me in the right direction for the coding I need for dizzy to hold his breath (and end up drowning in the water) please? I've looked in the books and here on the forum but can't find it anywhere.

Thanks in advance!
👍 0
#82749
Not sure what you mean Boo. The behaviour in water is automatic depending on whether he has a scuba or not. It's all dealt with in the Player.gs file (towards the end in the section titled waterplay) and called into play by the HandlerUpdatePlayer section in the Handlers.gs file when 'the material inside the 'player' box is 'water.

You can change how long he survives in water before drowning in the Def.gs file by changing the number in the #def AIR_LEVEL define.

The only extra bit some coders add is to add some extra defines to ensure that Dizzy respawns back to where he entered the water if he drowns rather than respawning in the water where he died.
👍 0
#82750

[quote data-userid="279" data-postid="82749"]

Not sure what you mean Boo. The behaviour in water is automatic depending on whether he has a scuba or not. It’s all dealt with in the Player.gs file (towards the end in the section titled waterplay) and called into play by the HandlerUpdatePlayer section in the Handlers.gs file when ‘the material inside the ‘player’ box is ‘water.

You can change how long he survives in water before drowning in the Def.gs file by changing the number in the #def AIR_LEVEL define.

The only extra bit some coders add is to add some extra defines to ensure that Dizzy respawns back to where he entered the water if he drowns rather than respawning in the water where he died.

[/quote]

Ahh right. I must have painted the brush/es wrong or something then. Thanks Grandad, I'll go check that out.

👍 0
#82755
Water should be a static brush and generally placed on the map last with a lower layer number than objects that need to be seen.
👍 0
#82978
Hi everyone,

I'm trying to understand parallax scrolling. I downloaded the brilliant Dizzy and the Jewel Thief, which does this very well, and the coding seems very complex. It has been smoothed, and has 4 layers. I'm just looking for a simple example (no smoothing; 2 layers a la Fantastic Dizzy) to get me started. Does anyone know of any other games that use this technique? (Besides Last Hero, which is also too complex for me :cry: ).

By the way, how do people feel about scrolling in general? I disable the Y axis, but even so (possibly due to Dizzy's frame rate, which I may consider altering if I can) it makes me feel just a little sick. I want to persevere though! I think the map can be made smaller with scrolling, as you don't have to worry about the layout of each individual room.
👍 0
#82979
In the games "Fantastic Dizzy - Home Alone" and "Dizzy - The Last Hero" identical engine. Dizzy goes more smoothly, as on Amiga computers.
👍 0
#82980

I noticed that :smile: . I gather you helped to modify Noggin's coding to make it smoother. It works really well! I'd like to implement that myself but I think I need to start with the basics so I can understand it, rather than just copying and pasting (which didn't work for me anyway, haha!) I noticed you left notes in your coding but maybe they were written in Russian? Because it shows up in Notepad as just symbols.

EDIT: Sorry, I thought you meant to say Last Hero and Jewel Thief had identical coding. They do though right? I forgot all about Home Alone, which I completed but never looked into.

👍 0
#82981

[quote data-userid="1205" data-postid="82980"]

EDIT: Sorry, I thought you meant to say Last Hero and Jewel Thief had identical coding. They do though right? I forgot all about Home Alone, which I completed but never looked into.

[/quote]

The author of the game Jewel Thief took a scrolling from the game Dizzy - Night at the Museum. It is old engine, it is simple with a scrolling. Comments are written in Russian. New exactly so far in two games about which I told. Though the Night at the Museum 1.04 version is already ready, on new engine. Game became a little bit more difficult.

👍 0
#82982

So I should have downloaded this before it was updated with complex scrolling! {yolkfolk}:sob: Well thanks anyway. It looks really nice so I guess I'll just play this for a while

👍 0
#82983
Yes, the scrolling in the game Jewel Thief became smoother. But the movements Dizzy didn't change. Smoother movements I already answered, in what two games.
👍 0
#82987

[quote data-userid="1205" data-postid="82978"]

Hi everyone,

I'm trying to understand parallax scrolling. I downloaded the brilliant Dizzy and the Jewel Thief, which does this very well, and the coding seems very complex. It has been smoothed, and has 4 layers. I'm just looking for a simple example (no smoothing; 2 layers a la Fantastic Dizzy) to get me started. Does anyone know of any other games that use this technique? (Besides Last Hero, which is also too complex for me :cry: ).

By the way, how do people feel about scrolling in general? I disable the Y axis, but even so (possibly due to Dizzy's frame rate, which I may consider altering if I can) it makes me feel just a little sick. I want to persevere though! I think the map can be made smaller with scrolling, as you don't have to worry about the layout of each individual room.

[/quote]

Hi Andy, when you say 2 layers, you mean just Dizzy's layer and a sky background? You can find that in Pirate's Life Dizzy and it's very easy to do.

If you want to add more layers without the smooth scrolling, I can tell you how to do that - it's not that hard if the scrolling is only horizontal.

I don't understand how the smooth scrolling works either - Dr Titus posted an edited version of Jewel Thief here:

https://www.yolkfolk.com/bb/showthread.php?2501-Dizzy-and-the-Jewel-Thief-v1-2-DOWNLOADABLE&p=28038&viewfull=1#post28038

The version you've got is that one with a few tweaks by me. If you want to see what the game looks like without the smooth scrolling, go into the game options and set the scrolling to stiff. The jerkiness is because Dizzy always moves horizontally in multiples of 4 pixels. There's no easy way round that - Dr Titus' technique is very complicated and my best effort, in Don't Panic Dizzy involved completely changing the player movement file so that Dizzy moves in multiples of 2 pixels - I don't recommend you try that. Even if you looked through my code, I had to make modifications all over the game code - I can't remember where they all were.

I'll have a look and see if I've still got an old 1.0 copy of Jewel Thief if that helps.

👍 0
#82988

Thanks a lot! Silly me, I forgot about Pirate's Life! I've been messing around with this for about an hour and I think I'm starting to understand {yolkfolk}:thumb:

EDIT: Yes, I meant Dizzy's layer + sky background. I probably should have figured it out for myself, as I've disabled vertical scrolling so it's just a case of matching the background to Dizzy's X coordinate (minus whatever number so it lines up). I guess adding extra layers is the real challenge. (I don't want to use smooth scrolling, although I can see it's great, just because the coding looks way beyond me.) I'll have a go at extra layers myself, and maybe pick your brain when I inevitably fail :smile:

👍 0
#82990
I thought Scrolling was built into the dizzyage engine it just need to be switched on?
👍 0
#82993

Parallax scrolling is different layers scrolling at different speeds to create illusion of depth. Or at my low level, just keeping the background screen static while the landscape scrolls (although I suppose it's technically the other way round). Maybe something for DizzyAGE 2.4? {yolkfolk}:raspy: I might abandon it because Noggin, you're right about the jerkiness. I've just given myself a headache after a few hours trying this out. This is what I have for now (in the handlers.gs):

// scrolling games support
if( GameGet(G_VIEWPORTMODE) )
{
roomw = GameGet(G_ROOMW);
//roomh = GameGet(G_ROOMH);
GameSet( G_VIEWPORTX, GameGet(G_ROOM X) *roomw - PlayerGet(P_ X) + roomw/2 );
//GameSet( G_VIEWPORTY, GameGet(G_ROOMY)*roomh - PlayerGet(P_Y) + roomh/2 );

dx=PlayerGet(P_ X) ;
dy=PlayerGet(P_Y);
sky = ObjFind(10);

ObjSet(sky,O_X,dx-120);
}

Hugely technical!! {yolkfolk}:yahoo:

👍 0
#82997

Yeah, it's a shame about the jerky scrolling.

It might be worth persevering with the smooth scroll code - I've incorporated it into games without understanding how it works.

If you're copying it from Jewel Thief, you'll have to cut out all the bits relating to the extra layers of parallax (a big long list of objects) - you should spot them easily enough, I used a variable called G_PARALLAX! And there's a second bit of code in the util.gs file to copy over as well.

I don't think there's much else you need to do to make it work actually... {yolkfolk}:scratch: You've just got to find the analog to your bit of code for the backdrop (probably tacked on the end) and change the object number.

Give it a go anyway - scrolling games are much better than flipscreen.

👍 0
#83001
Give it a go anyway - scrolling games are much better than flipscreen. Only for some people. I find that parrallax scrolling makes me feel somewhat nauseous after a few minutes.
👍 0
#83047
Is there a way to set a timer at a particular point and then display a message when the timer runs out. It would need to be global rather than to specific rooms as I'd like the timer to run for about 3 minutes. I can't really use the HandlerGameUpdate as it's only for non-latent stuff and although it could check the timing and display a message, you can't close it.
👍 0
#83048
The trick I use to get round that is to draw a big invisible collider and move it to Dizzy's coordinates when (say) the timer runs out. Then of course, you call the messages etc. from the CollideObject function.

BTW, what do latent and non-latent mean in DizzyAGE? I've wondered that for ages.
👍 0