Multibutton puzzle

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Re: Multibutton puzzle

Postby D'Lanor » Tue Mar 02, 2010 5:18 am

GPNMilano wrote:
D'Lanor wrote:
Justintime9 wrote:Now comes the animation, which I'm not sure exactly how to do. The doors that I want to animate are double doors, so both sides of the door will open at the same time, but be classified as one animation (unless I have to animate them separately and classify them in the same place.)

I don't know how Blender handles IPOs when you join 2 objects which both have an IPO attached but my guess is that things could go horribly wrong. So you are probably better off keeping the two animations separate.



Of note. Plasma has a class (Not yet available in the trunk but it's in my contrib in the svn) called plMsgForwarder. what this class does is really quite simple. when creating complex responders with multiple animations that need to play at once, you give all those animations the same name. So for instance in this case you have a double set of doors that are being animated, you'd give each of them the animation names of "DoorOpen" and "DoorClose" for it's opening and closing animations. Then you'd make two plMsgForwarder's, one for opening, and one for closing, and it would contain references to both object's animations. So in a responder's animcmdmsg instead of calling the individual door's animation, you'd call the plMsgForwarder and script it out just like an animcmdmsg.

Good tip, but actually it is easier to put the two animcmd messages in one responder with no waitons between them...

Edit: I guess this could come in handy for cross responder events. Until now I have been able to schedule any complex chain of events I needed with the tools available in plain vanilla PyPRP 1.6. And I mean really complex... like responders with 13 messages, 4 of which containing event callbacks. And that is just one of the 6 responders that I need to sort on the click of a single object, depending on a combination of 4 SDL states. :shock: Yep, that's where Python comes into play. ;)

However, these 6 responders now in part contain identical sections. This could perhaps have been simplified with the plMsgForwarder. Ideally I would like to be able to jump between smaller responders which contain only the relevant chunks. If for example each of my current responders starts with the same oneshotmsg I would like to use just one responder for that, but still keep the callback for for the avatar animation when I jump to another responder.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Multibutton puzzle

Postby D'Lanor » Tue Mar 02, 2010 6:01 am

Justintime9 wrote:Can you guys see any error in my scripts, SDL, or Python files?

Sorry for the thread hijacking. Back on topic now.

I see no obvious errors. But did you realize that buttons which are clicked are supposed to become disabled until all buttons are clicked? Unfortunately ametist used a stripped down version of my script which was not meant for buttons so there are no button animations. That means you cannot see which buttons are already pressed.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Multibutton puzzle

Postby Justintime9 » Tue Mar 02, 2010 5:11 pm

Well I noticed that when I linked in, and afterward deleted the .sav file, and the 3 buttons were still not clickable. Perhaps I'll have to send the blendfile, I'm stumped.
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: Multibutton puzzle

Postby Justintime9 » Sun Mar 07, 2010 2:17 pm

Here's the blendfile, I tried checking again if I could see anything wrong but didn't find anything.

http://www.mediafire.com/?sharekey=2776 ... f5ae0c10e8
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: Multibutton puzzle

Postby DanTheMystFan » Tue Mar 09, 2010 11:12 am

I'm not sure if this is your problem or not, but you don't seem to have an object named SMpainting6. I can't export your Age either to test it. Also, can you identify the buttons that aren't working?
User avatar
DanTheMystFan
 
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

Re: Multibutton puzzle

Postby Justintime9 » Tue Mar 09, 2010 12:53 pm

Oh geez, you're right, guess I forgot to make a 6th button :P
To fix that I just turned the object "P20" into "SMpainting6" and deleted the entry for "P20" in the AlcScript. When I exported and linked there the 6th button was clickable and made the right sound.

Unfortunately I'm still in the same boat I was in though, because three buttons still absolutely refuse to be clickable, even after I delete the .sav file to make sure they haven't been pushed already. These buttons are: "SMpainting2" , "SMpainting5" and "SMreset" (the reset button)

The reason it's not exporting though is probably because you don't have all the python and SDL files.
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: Multibutton puzzle

Postby Justintime9 » Wed Mar 17, 2010 12:35 pm

I Think I see what's wrong, I have a reset button, and as far as I know the kinekulle button puzzle doesn't have one, and since I based it off that, it's not correctly mentioned in the AlcScript.

I saw that it said "reset" somewhere in the script, and originally took that to mean that that's the name of my reset button (in kinekulle it's defined as "Kinekulle_reset" and in Shinlight Manor I named it "SMreset_reset" and named my reset button that.) but now I've realized that the reference to reset in the AlcScript is just telling it to reset when all the buttons are pushed. :P

If that's the case, how would I set up the script to recognize the reset button, and reset when it's pushed? (and close the doors if it was already solved.)
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: Multibutton puzzle

Postby DanTheMystFan » Sat Mar 20, 2010 6:20 pm

There is no reset button in the code. The reference is to a responder, which you have in your AlcScript as SM_reset_reset. This responder, however, only makes it possible to click the buttons again after the door is open. Clicking any button after the door is open will cause it to close.

If this isn't what you want, I could try to rewrite it later on--I just wanted to make sure you knew that it was possible to re-close the door.
User avatar
DanTheMystFan
 
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

Re: Multibutton puzzle

Postby Justintime9 » Wed Mar 24, 2010 2:03 pm

Hmm... well I deleted the button object to see if without that it would just reset when one of the buttons is pushed, but that didn't do anything. Would you mind re-writing it? Hope it's not too much trouble.
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: Multibutton puzzle

Postby DanTheMystFan » Thu Mar 25, 2010 6:04 pm

I'll rewrite it, but I'm not entirely sure what you want for the reset button. Do you still want the normal buttons to be able to close the door once it's opened? In addition, do you want the reset button to reset partially completed combinations as well as the door?

Thanks,
Dan

EDIT: I figured out how to fix the buttons. You need to set the Bounds to "Triangle Mesh" for the two buttons that don't work (Box actually might work too, I didn't try that. Use that if you can). Not sure why they don't work otherwise. I tested it with the old code and it seems to work OK. If you want me to rewrite it, I still can.
User avatar
DanTheMystFan
 
Posts: 24
Joined: Sat Aug 09, 2008 9:42 am

PreviousNext

Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests

cron