Page 1 of 1

clickable objects

PostPosted: Tue Jul 08, 2008 1:40 pm
by mar
First I didn't know of it is allowed to ask for help in the time I workat my shell for the RAD2 contest. If it is not allowed then tell me and I ask after the contest again. :?:
If it is OK, then I have the following question. I have in mind that a door is opening after you have click at four "clickable "objects in a definite sequence.
For example I have clickable objects A,B,C,D. and a door E
Then:
B AND C AND D AND A = E
Is this possible ? I think I must make a clickable region for each object and then there must be something written in python
that when all conditions are meet the door can opened.
Can someone help me with that. :P

Re: clickable objects

PostPosted: Tue Jul 08, 2008 2:17 pm
by GPNMilano
What you're looking for is a python script similar to The door in Kirel. I believe the python file is nb01GardenLights. I suggest taking a look at that to get an idea of what you want for your own puzzle door. You'll need your age to have an sdl and the variables set up in that sdl for it to work though. So if someone has an easier solution it would probably be better to use theirs.

Re: clickable objects

PostPosted: Wed Jul 09, 2008 12:49 am
by Grogyan
Take a peek at Roberts shell and it should give you a clue, he has only 1 click region but several clickable objects within it

as for getting the right sequence, you'll need to do a shift sequence
eg
Buttons = A, B, C and D
Data variables = a, b, c, d, temp

All data will be through SDL

initialize sequence to zero
while sequence does not equal DCBA
if D is pushed
copy d to temp
copy c to d
copy b to c
copy a to b
copy temp to a

if C is pushed
copy c to temp
copy c to d
copy b to c
copy a to b
copy temp to A

if B is pushed
copy b to temp
copy c to d
copy b to c
copy a to b
copy temp to a
etc

from the above example you can see that d is always over written, hence you copy any variable first

Does this help?

Re: clickable objects

PostPosted: Wed Jul 09, 2008 1:25 pm
by Jojon
Hmm, I really need to learn scripting... Why couldn't one have just a sequence_ok_so_far flag and a last_pressed variable and simply check those for each button press hook? Actually, I suppose the flag too could be swallowed by the variable. (..say by setting it to NULL, or "F", or something, whenever the sequence is broken.)

EDIT: Oh and another one: would I be correct or wrong, in observing that there is not really such a thing as a specific "click" region entity, but that it's just A region, plain vanilla, whose only purpose is to ensure you can't stand at the opposite end of the entire age and click the object? :7

Re: clickable objects

PostPosted: Thu Jul 10, 2008 6:59 am
by mar
Thks for answering all of you.
I have tried to look inNB01garden lights with Plasmashop but I can't get in. Have I used the wrong program :?:

Further I have looked in the SDL file from Robert and I saw what he has done, but I don't understand it. What I saw is that he have 6 sets with 4 variable. Robert make each variable 1 with a default also 1.
I don't understand the example you gave Groyan and can"t see what you have done if the good object with the right color
is clicked. But is this maybe a good version.
BDW where is INT and BOO standing for. I think BOO for Boolean but INT???????

Jojon what you suggest was also my thougt but maybe that is to simple.

After all I have decided to do this stuff after the RADcontest.Then I will going to stop my brains there in all that Pythonstuff!!!!!!! :twisted: :twisted: :twisted: :twisted:

Re: clickable objects

PostPosted: Thu Jul 10, 2008 8:58 am
by Jojon
Sounds like an INTeger - a number without decimals.

Re: clickable objects

PostPosted: Thu Jul 10, 2008 11:19 am
by Grogyan
I'm not sure what you're after.

The example above will loop until the condition are true, using just straight booleans

Unless you want to try and do something as complicated as what I am going to do with my shell where
you push a button and it changes colour and there are 3 buttons
after that you'll need to push them again for a period to "engage" that colour to the sequence.

effectively i'll be using the example above and one more.


My head is about to explode while i'm figuring out how to get an object to follow a bezier path with its local Y axis constrained to the path

Re: clickable objects

PostPosted: Thu Jul 10, 2008 1:09 pm
by Robert The Rebuilder
mar: I agree that it would be better to wait until the contest has finished before attempting the Python scripting for this button sequence. That way, we can give you actual Python code to do this without disqualifying you from the contest.

Re: clickable objects

PostPosted: Thu Jul 10, 2008 4:34 pm
by BAD
Moved. :)