I want my C64 back

Robin_Gravel Here's my first sci game full complete. With intro and ending.

"Another DG game: I want my C64 back"

You'll find it at:
http://membres.lycos.fr/agisite/agisite.htm

Robin Gravel

Screenshot
http://www.fjord-best.com/robingravel/dgc64b.jpg

Lars Skovlund Very nice - keep up the good work!

The timer code could be simplified though - either by putting it in the game object (which will work because the game is so small),
or in a region (which would be better for larger games). Brian, will your new tutorials cover regions, or should I try to put some code together?
Robin_Gravel Thanks Lars.

What do you mean by "a region"?

Robin Gravel
Brian_Provinciano Great work! You've just completed the first full fan made game (other than my two room one)!

You've done a great job! I'll add it to my sites right away! Will you be making another SCI game?

Lars: I'm open to suggestions on tutorials to add to it. It won't be a fixed tutorial like the first. It will start off with a few chapters, then as people ask questions or recommend them, I will add more. Feel free to do tutorials as well though! The more the better! I'll be finishing the other ones first, so go for it!


PS. Thanks for giving me credit Robin!
AGI1122 Found 1 bug, while I was playing I restarted but when I started I didn't have the credit card in my inventory... but even though it wasn't in my inventory I could still buy the cola and the burger.
Robin_Gravel Hi Chris

Thanks for reporting this bug. I'll look for it.

Robin Gravel
Joe Very impressive Robin. The fact that you used your own graphics (well, mostly) makes the game more enjoyable. I haven't finished it yet, due to my computer having a faulty sound card that crashes after two minutes of being in a dos game, but I am sure it will be great. Nice work!
Robin_Gravel Thanks for compliments Joe.

In Resource.cfg file change this
soundDrv = GM.DRV
to
soundDrv = STD.DRV
to solve your problem.

Robin Gravel
Lars Skovlund The purpose of regions is to allow rooms to share common code - for instance, making ego swim whenever he steps into a lake (used in the beach scenes in Codename: Iceman) , or (as in SQ4) having droids/cyborgs/cops etc. appear in certain scenes.

A region that performs the countdown in your game would look like:


(script 700)

(include "game.sh")

(use "game")
(use "obj")
(use "main")
(use "controls")

(instance public TimeoutRegion of Rgn
(properties)
(method (newRoom room)
(= keep /* When ego leaves the region, this flag gets set to zero *(
(EqualsAny(room /* These rooms comprise the TimeoutRegion */
1 2 3 4 5 6 7)))
(super:newRoom(room))
)
(method (handleEvent event)
/* Put region-specific Said handling here */
(super:handleEvent(event))
)
(method (doit)
(var dyingScript)
(if(> gTimeMinutes C64die)
= dyingScript ScriptID(DYING_SCRIPT)
(send dyingScript:
caller(scriptNumber))
Print("The time is run out. It's too late to save your beloved computer Commodore 64. "+
"You must be quicker next time.")
(send dyingScript:
register("Game over! Thank you for playing \"DG: I want my C64 back\"."))
(self:dispose()) /* This avoids infinite loops */
(send gGame:setScript(dyingScript))
))
)


Then you add (self:setRegions(700)) to the relevant rooms, and remove the timeout code from them.

However, there is an implementation detail about regions that you may want to fix before you use this; for some reason, Sierra chose to remove all regions (also those that should be kept) - I don't know if this is a design decision or a bug, but all the games that I have looked at implement regions in this way. To make it easier to manage the code, the keep flag should be respected. To change this, open game.sc, and find the following chunk of code:


(send gRegions:
eachElementDo(#perform DNKR)
release(
)


Remove the call to release(), but leave the rest. Regions are now disposed of if the new room is outside the region. Thus, we only need to do the setRegions() thing in one room
Of course, if the rooms in the region are not adjacent, you will need to enable the region manually in every non-adjacent room. This also applies if the player can enter any room of the region, as opposed to being forced to enter through one specific room (which might be the case in games with a very linear storyline, for example) - in that case, this fix is somewhat redundant.
Robin_Gravel Cool. I should use theres codes to make my game better.

Thanks Lars.
Robin_Gravel Thanks Lars.

Not only your code works but DG can now eat burgers and drink colas everywhere in the game.

I'll give you credit for it.

Robin Gravel
Robin_Gravel Since I update my game, this topis is useless. Locked.


Robin Gravel