Page 4 of 14

Posted: Fri Nov 08, 2013 11:25 pm
by SnTrooper
If you end up not being able to get the password, the versions of Magicland and Prince of the Yolkfolk I have are unlocked.

Posted: Sat Nov 16, 2013 3:10 pm
by Pogie
Thanks Noggin and SnTrooper, what you sent to me is going to be useful and I appreciate it! :say_yes:


Now, I've got a bit of a problem with the boulders in the mineshaft. I know how to code them, I know how to make them look like they did in the original but I'm relying on video walkthroughs to show me precisely what is what with this game but none of them seem to trigger the rocks as they play it so I don't know how they are meant to look as they fall! I just can't find a video of them falling. Can anybody point me in the direction of a video if one exists, or maybe take a few screenshots from an emulated version so I can see the sequence and number of rocks? I'd do it myself but I don't know much about emulators! As usual, any help is greatly appreciated my fellow Yolkfolkers!

Posted: Sat Dec 14, 2013 9:35 pm
by Adz.M
Pogie wrote:Now, I've got a bit of a problem with the boulders in the mineshaft. I know how to code them, I know how to make them look like they did in the original but I'm relying on video walkthroughs to show me precisely what is what with this game but none of them seem to trigger the rocks as they play it so I don't know how they are meant to look as they fall! I just can't find a video of them falling. Can anybody point me in the direction of a video if one exists, or maybe take a few screenshots from an emulated version so I can see the sequence and number of rocks? I'd do it myself but I don't know much about emulators! As usual, any help is greatly appreciated my fellow Yolkfolkers!
Image

That's about it really, the rocks don't animate, they just rain down as you walk into the tunnel. :)

Posted: Sun Dec 15, 2013 12:37 am
by Rindex
Pogie wrote:Now, I've got a bit of a problem with the boulders in the mineshaft. I know how to code them, I know how to make them look like they did in the original but I'm relying on video walkthroughs to show me precisely what is what with this game but none of them seem to trigger the rocks as they play it so I don't know how they are meant to look as they fall! I just can't find a video of them falling. Can anybody point me in the direction of a video if one exists, or maybe take a few screenshots from an emulated version so I can see the sequence and number of rocks? I'd do it myself but I don't know much about emulators! As usual, any help is greatly appreciated my fellow Yolkfolkers!
I made video.

[video=youtube;Asb7SQQa0fM]http://www.youtube.com/watch?v=Asb7SQQa0fM[/video]

Posted: Fri Dec 20, 2013 8:00 pm
by Pogie
Thanks guys! Those rocks have caused me some real headaches. As it stands I've got an animated tiles which I've coded to appear and disappear if the player hits a collider. It looks acceptable enough and is close to how the original rocks fall. But a while back Grandad gave me a bit of code that Delta had written which would have been better but I just couldn't get it working. I think I was missing some defines or something somewhere. But after looking closely at the original rockfalls and the rain Peter has already coded I can say that they are totally identical. But once again my puny Flufflebrain has let me down and I'm unable to duplicate Peter's rain code to successfully make my rocks fall. If any of you more intelligent sorts have a little time over the holidays maybe you could have a look into it? Like I said, I've done it and it's acceptable but it's not up to the standards of accuracy that Peter has set!


(edit: The code Grandad posted is in this thread http://www.yolkfolk.com/bb/showthread.p ... ling-rocks)

Posted: Sat Dec 21, 2013 6:10 pm
by delta
Grandad wrote:Pogie, this is the 'proper' way to code continually falling rocks. The rate of fall can be altered for each rock by either changing the 'delay' property in each rock, or the 'speed of the fall' in the actual function. It also takes into account a rock going 'past' the lower activation axis point so you don't have to worry about ensuring the axis co-ordinates are precisely divisable. You can 'set' the rocks on the map at any point in the 'cycle' as the roomupdate will move the rock down and the 'abot' co-ordinate is where the rock gets moved back up to the top position. It's also best to have the 'ledges' between the rocks as a higher layer than the rocks, so that they only show as falling from the ceiling and disappearing into the floor. Don't forget to set the 'death' property and respawn Dizzy outside the rockfall. Hope this helps. Thank Jamie for the original coding.

Code: Select all

func Rock1 (id,atop,abot) //set the 'numbers' in the room update
{
	idx = ObjFind(id);
	if (!IsUpdate(ObjGet(idx, O_DELAY))) return; //don't move rock on delay update

	y = (ObjGet(idx, O_Y); // y co-ordinate of rock at starting point on map
	y+=2; // sets speed of falling rock
	ObjSet(idx, O_Y, y); // sets new position of rock
	ObjPresent(idx); // only needed if rocks falling over two or more rooms

	if (y>=abot) // y co-ordinate of rock at lowest point
	{
		ObjSet(idx, O_Y, atop); // set rock back to highest position
	}
}
then set the room update for each rock

Code: Select all

func UpdateRoom_12_12() //or whatever the room positon is
{
	Rock1(248,1106,1197); // the id of the rock, the top and bottom y co-ordinates you're using
}
That code looks fine to me. It's pretty basic, but assuming the rocks aren't disabled then it'll be fine.

Generally for an on/off drop like you're wanting, you'd put a check in the UpdateRoom_12_12 function saying something like 'if Dizzy's X position is greater than [whatever] then make the rocks visible'. At the moment that code isn't checking the position of the player, so it'll just run through the code wherever the player is in the room. That's ok, but if the rocks are disabled, then you won't ever see them, because there's nothing turning them 'on'.

I'm sure one of my games will have had similar coding in it, but I can't think of which ones off the top of my head (the longer I go between coding, the harder it is to remember examples from my games).

Posted: Sat Dec 21, 2013 6:18 pm
by delta
I remembered one. It's a fairly simple one too: In Mystic Forest Dizzy, if you get too close to a Will-o'-the-Wisp, it disappears. This is done as described above, checking the player position, then if he's near it, changing the DRAW property.

I used the DRAW property because that kept the DISABLE property free for use when it was daytime - there's no Will-o'-the-Wisps during the day! For what you're wanting though, I'd probably the DISABLE property instead, but either should work fine.

Here's the code for one of them:

Code: Select all

func UpdateRoom_2_5()
{
	px = PlayerGet(P_ X) ;
	if(px>536&&px<624) { ObjSet(ObjFind(3006),O_DRAW,0); }
	else  { ObjSet(ObjFind(3006),O_DRAW,3); }

	Update_Wisp(3006);

Posted: Mon Dec 23, 2013 11:35 am
by Pogie
I've put a rock on the map at y coordinates 1433. It's set as a dynamic object and its id is 9950. The rock is not disabled. The map is saved.

I've got the code from above in game.gs copied and pasted and completely unaltered. I've altered the update room function to this:

func UpdateRoom_20_10()
{
Rock1(9950,1433,1492);
}


I run the game and I get a parse error on line 1618, which is this part of the code:

y = (ObjGet(idx, O_Y); // y co-ordinate of rock at starting point on map


I'm stumped and I have no hair left. Somebody help me! :v2_dizzy_confused3:

Posted: Mon Dec 23, 2013 2:00 pm
by Noggin the Nog
Er Pogie...

the parse error's because you've got an extra open bracket there.

You've got: y = (ObjGet(idx, O_Y);

When it should be: y = ObjGet(idx, O_Y);



Fluffle, kick thyself.

Posted: Mon Dec 23, 2013 2:22 pm
by Pogie
Noggin the Nog wrote:Er Pogie...

the parse error's because you've got an extra open bracket there.

You've got: y = (ObjGet(idx, O_Y);

When it should be: y = ObjGet(idx, O_Y);



Fluffle, kick thyself.

THANK YOU NOGGIN!!!! Oh how did I not notice that? I think it's down to me looking at it for so long! The code works great now and I can make those pesky rocks look 100% like the original ones did. :v2_dizzy_clapping: