Author Topic: I think I understand the click on control colors... but  (Read 10574 times)

0 Members and 1 Guest are viewing this topic.

Offline Cloudee1

I think I understand the click on control colors... but
« on: June 05, 2015, 01:07:57 PM »
I am trying to get the click on control colors thing down using the sci1.1 template. I think I have it all figured out but there is one piece that I don't know what it is... and it isn't quite working.

So in the message file, we add a new Noun. In this case N_PLATFORM and save it (in this case noun 3)

Then we go down to the Message details and select our noun, select the verb and enter the message text and hit commit. All other values condition, sequence, talker are left at their default.

Next we go to our room script. It looks like we need to use the cueobj script so that is done.

We need to create an instance of feature, and set a few values
Code: [Select]
(instance platform of Feature
    (properties
        x 140
        y 156
        noun N_PLATFORM
        onMeCheck $0002
    )
)
The x and y values give a point of reference, so if Ego isn't facing the looked at area, then he will turn. The noun is defined as our messages noun and the control color is set to Navy.

Now, all that is left is basically to init the platform instance.
Code: [Select]
(platform:init()setOnMeCheck(1 2)) // KQ6 init's the instances a bit differently, but that syntax causes an oops error. 
//(platform:init()setOnMeCheck(1 $0002))

Now looking at the feature class in the cueobj script, the first parameter is used by the setonmecheck method. It looks like $6789, 2, 1 are the available option. Everything I have seen in SQ5 source so far is showing param1 as 1 so that is what I used. But I don't really understand I guess what param2 does in all of this... and it makes me wonder if whatever it is I am missing is what is keeping this from working like it should

Code: [Select]
// From cueobj.sc
    (method (setOnMeCheck theOnMeCheck theOnMeCheck_2)
        (var temp0)
        (switch (theOnMeCheck)
            (case $6789
                = onMeCheck theOnMeCheck
                = state (& state $fffb)
            )
            (case 2
                = onMeCheck theOnMeCheck_2[0]
                = state (& state $fffb)
            )
            (case 1
                = temp0 (= onMeCheck 0)
                (while (< temp0 (- paramTotal 1))
                    = onMeCheck (| onMeCheck theOnMeCheck_2[temp0])
                    ++temp0
                )
                = state (| state $0004)
            )
        )
    )

« Last Edit: June 05, 2015, 02:26:17 PM by Cloudee1 »


Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline troflip

Re: I think I understand the click on control colors... but
« Reply #1 on: June 05, 2015, 01:42:00 PM »
CueObj is just a poorly-named script. It contains CueObj and Feature, but CueObj is just a helper class for Feature, it looks like. I should rename it to Feature.sc.

I think $6789 is just a sentinel value to indicate "unintialized". So you can do

setOnMeCheck($6789)   // "Uninitialize" I guess?
setOnMeCheck(2 someValue)   // onMeCheck becomes someValue... probably someValue is supposed to be an object?
setOnMeCheck(1 flag1 flag2 flag3)  // onMeCheck becomes the OR'd together values of all the flags

I'm curious why scripts seem to set both onMeCheck in the properties, and then again in code. For instance, leftDome in SQ5, room 200:

Code: [Select]
onMeCheck $0002

and then:
Code: [Select]
                (leftDome:
                    init()
                    setOnMeCheck(1 2)
                )


Anyway, in your case, you were setting onMeCheck to 64 ($40, brown). You should be doing:

Code: [Select]
(platform:init()setOnMeCheck(1 $400))
« Last Edit: June 05, 2015, 01:44:53 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline lskovlun

Re: I think I understand the click on control colors... but
« Reply #2 on: June 05, 2015, 02:16:03 PM »
Now looking at the feature class in the cueobj script, the first parameter is used by the setonmecheck method. It looks like $6789, 2, 1 are the available option. Everything I have seen in SQ5 source so far is showing param1 as 1 so that is what I used. But I don't really understand I guess what param2 does in all of this... and it makes me wonder if whatever it is I am missing is what is keeping this from working like it should
The onMeCheck property can be used for multiple things, that's why the setter function is a bit complicated.
As you have discovered, it can be used with control colors, but you can also stash a polygon object in there which then determines the borders of the view.
You can't do both for one object at the same time, but you shouldn't need to.

Offline Cloudee1

Re: I think I understand the click on control colors... but
« Reply #3 on: June 05, 2015, 02:25:53 PM »
I think something might be broken then. This seems pretty straight forward. Click on view and the general room look works... but not this.

I edited my first post and have changed all the control color references to Navy. I could find a specific example of that color in the sq5 source. In script 117, the bigmoon instance.

No matter what I try, I can not get the click to recognize that it has been made on the control color.

Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline troflip

Re: I think I understand the click on control colors... but
« Reply #4 on: June 05, 2015, 02:37:18 PM »
Works for me:

Code: [Select]
(instance theSign of Feature
(properties
x 245
y 54
noun N_SIGN
onMeCheck ctlFUCHSIA
)
)

Code: [Select]
(theSign:init() setOnMeCheck(1 ctlFUCHSIA))



Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Cloudee1

Re: I think I understand the click on control colors... but
« Reply #5 on: June 05, 2015, 02:57:59 PM »
Ugh, not for me  :'(

Script 253
« Last Edit: June 05, 2015, 03:42:42 PM by Cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline troflip

Re: I think I understand the click on control colors... but
« Reply #6 on: June 05, 2015, 03:17:47 PM »
So running it under Scumm reveals: pic-operation set pattern inside sci1.1+ vector data!

Apparently that is not allowed. Delete your pen things and replace them with lines, and then it should work. I'll have to update the pic editor to disable those commands for sci1.1+.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Cloudee1

Re: I think I understand the click on control colors... but
« Reply #7 on: June 05, 2015, 03:42:12 PM »
 ::)

And that was it. My control lines didn't span the section so I had used the pen to fill in the pixel or two that was missing. That's what was keeping it from working

Thanks Phil
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline troflip

Re: I think I understand the click on control colors... but
« Reply #8 on: June 05, 2015, 03:49:45 PM »
I might need a gutter around the pic in order to make it easier to extend lines to the edges....
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Cloudee1

Re: I think I understand the click on control colors... but
« Reply #9 on: June 05, 2015, 03:55:17 PM »
Well the zoomed in panel on the right helps a lot... Just sloppy on my part I guess.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline troflip

Re: I think I understand the click on control colors... but
« Reply #10 on: June 05, 2015, 03:58:13 PM »
Impressive what you've done with with this SQ2 remake just with this alpha version of SCI Companion though! So your goal is to transform it into a point'n'click?
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Cloudee1

Re: I think I understand the click on control colors... but
« Reply #11 on: June 05, 2015, 04:20:23 PM »
The long term goal is actually to make the first three of Sierra's as well as the 2 fanmade agi games into one long point and click remake. I have to tweak the endings and beginnings a bit to get them to flow into one uber long story. With the old companion I had sq1 pretty much done and coded and it flowed into the beginning of 0.

SQ2 seemed like a good place to start with testing out the new companion and the new scripting. Especially the asteroid fortress, for the most part, the rooms aren't overly complex but all included it would cover a lot of the main necessary scripting functionality, polygons, items, using items, combining items, death, doors, etc. So it gives a good opportunity to get some things sorted out.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition


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

Page created in 0.336 seconds with 22 queries.