Hi guys,
I'm trying to work out the best way to allow ego to ride a bike in certain rooms in the game. I'm trying to do it in a way that is optimised as not to screw with heapspace too much.
I want to archive the following:
Riding of bike in only allowed rooms
Using/initialising the bike view when changing between allowed rooms on the bike
Define control areas in allowed rooms that will make ego fall off bike and die
At present I'm using the following code in my main.sc where I'm using the OneOf procedure to block rooms where I don't want bike riding. It might be using up too much memory as my main.sc is pretty full already. Not sure if this is the best way?
This brings up other questions like, what's the best way to check if ego is on the bike and initialising it when switching between rooms where the bike is allowed? Because most rooms I have configured :(gEgo init: ) which will use my standard ego view.
I also wanted to have room specific control area where ego falls off the bike and dies if crossing. I'm not sure the best way to globally control these. I won't be able to use the same control colour for each room as some rooms would be already using that control colour for something else.
((Said 'use,mount/bike')
; Check if already on bike
(if (== (gEgo view?) 719)
(Print 0 163) ; "You're already on your bike."
(return TRUE)
)
(cond
((not (gEgo has: 15))
(Print 0 158) ;You don't have a bike.
)
((OneOf gRoomNumber 6 7 8 11 14 15 16 17 18 19 29 21 22 24 30 31 33 35 36 39 40 41 42 43 44 45 46 47 48 50 51 52 53 55 56 90 91 92 93 94 95 97 98 100 101 102 103 104 111 120 121 122 123) ;rooms not allowed to ride bike
(Print 0 159) ;Sorry, you can't ride your bike here.
)
(else
(gEgo view: 719)
(Print 0 160) ; You mount the bike.
)
)
(return TRUE)
)
((Said 'dismount,(get<off)/bike')
(if (== (gEgo view?) 719)
(gEgo view: 0) ; Back to normal view
(Print 0 161) ; You get off the bike and stuff it into your pocket.
else
(Print 0 162) ; You're not riding anything.
)
(return TRUE)
)
Thanks,