Author Topic: OnMeCheck can't see the forest for the trees  (Read 4666 times)

0 Members and 1 Guest are viewing this topic.

Offline Kawa

OnMeCheck can't see the forest for the trees
« on: October 26, 2015, 05:13:28 AM »
Picture this: a T-split in a road, leading east-west in the foreground and northbound into the background. At the far end is a building. Tall trees surround the roads, leaving open sky in the middle above the building. The player's car sits on the road in the foreground with an interesting pool of fluid around one wheel. The car, pool, trees and building each have their shapes drawn out on the control screen in red, cyan, and brown respectively, with a little silver box for the building in the distance.

In rm110::init:
Code: [Select]
(trees:init() setOnMeCheck(omcCOLORS ctlBROWN))
(aShop:init() setOnMeCheck(omcCOLORS ctlSILVER))
(aCar:init() setOnMeCheck(omcCOLORS ctlRED))
(aPuddle:init() setOnMeCheck(omcCOLORS ctlCYAN))

Later on:
Code: [Select]
(instance aPuddle of Feature
(properties
sightAngle 40
approachX 132
approachY 172
_approachVerbs V_LOOK
onMeCheck ctlCYAN
noun N_PUDDLE
)
//doVerb omitted, confirmed to work.
)
(instance aCar of Feature
(properties
approachX 160
approachY 160
_approachVerbs V_DO
onMeCheck ctlRED
noun N_CAR
)
//doVerb omitted, confirmed to work.
)
(instance aShop of Feature
(properties
onMeCheck ctlSILVER
noun N_SHOP
)
//These two don't ever trigger.
(method (handleEvent theEvent)
DebugPrint("aShop::handleEvent()")
(super:handleEvent(rest theEvent))
)
(method (doVerb theVerb)
DebugPrint("aShop::doVerb()")
(super:doVerb(rest theVerb))
)
)
(instance trees of Feature
(properties
onMeCheck ctlBROWN
noun N_TREES
)
//testing doVerb and handleEvent omitted, equally dead.
)

I can click anywhere on the actual car (not in a hot rect, but on the actual shape) or puddle to verb them, having played through the little puzzle as far as its implementation allows me to so far. Looking at the trees or shop is supposed to remark that they're "just some trees" and "probably a gas station", but all I get is the room's description.

And I say hey, what's going on?



Offline troflip

Re: OnMeCheck can't see the forest for the trees
« Reply #1 on: October 26, 2015, 12:52:32 PM »
Works for me.

I would start putting some DebugPrints in Feature::onMe and see where it's going wrong.

It looks like, since your nsLeft, nsResult, nsTop and nsBottom are all zero (presumably), it should call OnControl and compare the result to the tree/building's onMeCheck.

The only thing I can think of is that you have a cast member or feature somewhere that is also returning TRUE for onMe, and it has a larger y value.
« Last Edit: October 26, 2015, 01:38:49 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: OnMeCheck can't see the forest for the trees
« Reply #2 on: October 26, 2015, 02:09:50 PM »
Here's an annotated log:
Code: [Select]
Debugger enabled
-- Clicked the sky, there is no feature.
-- (146 18) is what was passed; [146 18] is where I clicked, temp0 and temp1.
Feature::onMe(146 18) [146 18]: doing nsRect check
Feature::onMe(27322 146) [146 18]: (& state $0004)
Feature::onMe(27322 146) [146 18]: doing OnControl check -- onMeCheck is $40, (& onMeCheck OnControl(CONTROL x y) = $0 -- Trees?
Feature::onMe(27322 146) [146 18]: (& state $0004)
Feature::onMe(27322 146) [146 18]: doing OnControl check -- onMeCheck is $80, (& onMeCheck OnControl(CONTROL x y) = $0 -- Shop?
Feature::onMe(27322 146) [146 18]: (& state $0004)
Feature::onMe(27322 146) [146 18]: doing OnControl check -- onMeCheck is $1000, (& onMeCheck OnControl(CONTROL x y) = $0 -- Car?
Feature::onMe(27322 146) [146 18]: (& state $0004)
Feature::onMe(27322 146) [146 18]: doing OnControl check -- onMeCheck is $800, (& onMeCheck OnControl(CONTROL x y) = $0 -- Puddle?
-- Final result: default handler is called, room is described.
-- Clicked on the car, onMeCheck is RED, $1000.
Feature::onMe(99 139) [99 139]: doing nsRect check
Feature::onMe(27320 99) [99 139]: (& state $0004)
Feature::onMe(27320 99) [99 139]: doing OnControl check -- onMeCheck is $40, (& onMeCheck OnControl(CONTROL x y) = $0
Feature::onMe(27320 99) [99 139]: (& state $0004)
Feature::onMe(27320 99) [99 139]: doing OnControl check -- onMeCheck is $80, (& onMeCheck OnControl(CONTROL x y) = $0
Feature::onMe(27320 99) [99 139]: (& state $0004)
Feature::onMe(27320 99) [99 139]: doing OnControl check -- onMeCheck is $1000, (& onMeCheck OnControl(CONTROL x y) = $1000 -- Hit on the car!
Feature::onMe(27320 99) [99 139]: (& state $0004)
Feature::onMe(27320 99) [99 139]: doing OnControl check -- onMeCheck is $800, (& onMeCheck OnControl(CONTROL x y) = $0
Feature::onMe(27320 99) [99 139]: (& state $0004)
Feature::onMe(27320 99) [99 139]: doing OnControl check -- onMeCheck is $1000, (& onMeCheck OnControl(CONTROL x y) = $1000 -- why twice?
-- Final result: car's doVerb is called.
-- Clicked on the puddle, onMeCheck is CYAN, $0800.
Feature::onMe(113 170) [113 170]: doing nsRect check
Feature::onMe(27320 113) [113 170]: (& state $0004)
Feature::onMe(27320 113) [113 170]: doing OnControl check -- onMeCheck is $40, (& onMeCheck OnControl(CONTROL x y) = $0
Feature::onMe(27320 113) [113 170]: (& state $0004)
Feature::onMe(27320 113) [113 170]: doing OnControl check -- onMeCheck is $80, (& onMeCheck OnControl(CONTROL x y) = $0
Feature::onMe(27320 113) [113 170]: (& state $0004)
Feature::onMe(27320 113) [113 170]: doing OnControl check -- onMeCheck is $1000, (& onMeCheck OnControl(CONTROL x y) = $0
Feature::onMe(27320 113) [113 170]: (& state $0004)
Feature::onMe(27320 113) [113 170]: doing OnControl check -- onMeCheck is $800, (& onMeCheck OnControl(CONTROL x y) = $800 -- Hit on the puddle!
Feature::onMe(27320 113) [113 170]: (& state $0004)
Feature::onMe(27320 113) [113 170]: doing OnControl check -- onMeCheck is $800, (& onMeCheck OnControl(CONTROL x y) = $800
-- Final result: puddle's doVerb is called.
-- Clicked on the trees, onMeCheck is BROWN, $0040.
Feature::onMe(89 55) [89 55]: doing nsRect check
Feature::onMe(27320 89) [89 55]: (& state $0004)
-- vvvvvv
Feature::onMe(27320 89) [89 55]: doing OnControl check -- onMeCheck is $40, (& onMeCheck OnControl(CONTROL x y) = $0 -- MISSED hit on the trees!
-- ^^^^^^
Feature::onMe(27320 89) [89 55]: (& state $0004)
Feature::onMe(27320 89) [89 55]: doing OnControl check -- onMeCheck is $80, (& onMeCheck OnControl(CONTROL x y) = $0
Feature::onMe(27320 89) [89 55]: (& state $0004)
Feature::onMe(27320 89) [89 55]: doing OnControl check -- onMeCheck is $1000, (& onMeCheck OnControl(CONTROL x y) = $0
Feature::onMe(27320 89) [89 55]: (& state $0004)
Feature::onMe(27320 89) [89 55]: doing OnControl check -- onMeCheck is $800, (& onMeCheck OnControl(CONTROL x y) = $0
-- Final result: default handler is called, room is described.
-- Clicked the shop, onMeCheck is SILVER, $0080.
Feature::onMe(151 72) [151 72]: doing nsRect check
Feature::onMe(27322 151) [151 72]: (& state $0004)
Feature::onMe(27322 151) [151 72]: doing OnControl check -- onMeCheck is $40, (& onMeCheck OnControl(CONTROL x y) = $0
Feature::onMe(27322 151) [151 72]: (& state $0004)
-- vvvvvv
Feature::onMe(27322 151) [151 72]: doing OnControl check -- onMeCheck is $80, (& onMeCheck OnControl(CONTROL x y) = $0 -- MISSED hit on the shop!
-- ^^^^^^
Feature::onMe(27322 151) [151 72]: (& state $0004)
Feature::onMe(27322 151) [151 72]: doing OnControl check -- onMeCheck is $1000, (& onMeCheck OnControl(CONTROL x y) = $0
Feature::onMe(27322 151) [151 72]: (& state $0004)
Feature::onMe(27322 151) [151 72]: doing OnControl check -- onMeCheck is $800, (& onMeCheck OnControl(CONTROL x y) = $0
-- Final result: default handler is called, room is described.

Offline Kawa

Re: OnMeCheck can't see the forest for the trees
« Reply #3 on: October 26, 2015, 02:15:27 PM »
It gets better. Alt-D, C reveals why nothing works. And looking at the command list in the picture at about that point we do indeed see some nonsense, like "Line: 3900x4095 - 3903-4003".

PROBLEM SOLVED :D
« Last Edit: October 26, 2015, 02:18:09 PM by Kawa »

Offline troflip

Re: OnMeCheck can't see the forest for the trees
« Reply #4 on: October 26, 2015, 02:27:33 PM »
Well... not problem solved. Did you use SCI Companion to make that pic? If so, then there's a bug somewhere...
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: OnMeCheck can't see the forest for the trees
« Reply #5 on: October 26, 2015, 02:35:50 PM »
Well... not problem solved. Did you use SCI Companion to make that pic? If so, then there's a bug somewhere...
Well I certainly didn't use SCI Studio lol~

no really what other choices are there?

Offline troflip

Re: OnMeCheck can't see the forest for the trees
« Reply #6 on: October 26, 2015, 02:42:36 PM »
I dunno, maybe it was exported from some Sierra game. At any rate, if you made this in SCI Companion, then SCI Companion has a bug - it's generating bad data. Not acceptable!

Do you have a copy of the pic that still had the problem before you fixed it? If so can you send it? (you can remove the visual background if you're trying to keep things secret.. I just want to see which line command was corrupt to see if I can figure out what you were drawing at the time, and what might have caused the bug).
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: OnMeCheck can't see the forest for the trees
« Reply #7 on: October 26, 2015, 02:50:20 PM »
Do you have a copy of the pic that still had the problem before you fixed it?
I'm afraid not. But I'll keep this in mind in case it happens again. Until then, perhaps detect warn and remove?

As for secrecy...

Offline troflip

Re: OnMeCheck can't see the forest for the trees
« Reply #8 on: October 26, 2015, 03:02:01 PM »
Very nice! Is that rendered out from a 3d scene?
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: OnMeCheck can't see the forest for the trees
« Reply #9 on: October 26, 2015, 03:23:04 PM »
Heavily altered GMod screenshot. I don't even have GMod.

Offline Cloudee1

Re: OnMeCheck can't see the forest for the trees
« Reply #10 on: November 29, 2015, 01:03:51 AM »
I am not sure how it managed to slip in there, but for the life of me I couldn't figure out why a snippet of code I had used in a few other rooms without issue wouldn't work in this room. Then by shear frustration I remembered this thread and decided to look over the pictures command list...

Here you go Troflip, a broken pic resource. It looks fine when you view it in any of the screens. I would have never went looking for it if it wasn't for the control color on me's not working when I absolutely knew that they should be.

By the way, that should have read something like line:1x137 - 3x137
« Last Edit: November 29, 2015, 01:05:32 AM by Cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline troflip

Re: OnMeCheck can't see the forest for the trees
« Reply #11 on: November 29, 2015, 02:14:53 AM »
I may have fixed this at some point, not sure (github doesn't let you search commit comments via their web UI, unfortunately). I know I addressed some issues with negative coordinates in pics, but I forget if I ever figured out how they could be created by SCI Companion. I *think* it was just by end lines outside the top or left edges of the pic, but I'm not sure. Does that work? i.e. does that repro the bug?
« Last Edit: November 29, 2015, 02:12:58 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.101 seconds with 24 queries.