Door doesn't open

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

Re: Door doesn't open

Postby Jonnee » Mon Jun 15, 2009 2:08 pm

Image

Dear D'Lanor. This cup of coffee is for you. :lol:
I want to prevent you again of getting some sleep. :D

1.) The script and the avatar animations work fine now. But I still can't hear the sound of the sound emitter. Hmmm, why does it happen? I still think that I have to add something to the script that tells that the sound emitter is a 3d sound and which soundfile has to be played in which distance...

2.) I was faking. :D The door is not a door. *muhaaahaaa*
It's a part of a machine. I have created a funnel. The "door" is a bar under the funnel. Inside of the funnel is a beachball.
My idea was that if I press the button the bar moves to the side and the beachball will fall down.
Now in Uru the bar moves to the side, but the ball doesn't fall down, it's still floating at the position. Ok, we already know this problem: If the avatar stands on a opening scuttle it doesn't fall down too as long as the avatar doesn't move too. << it's the same effect.
Hmmm, how can we change this? It's necessary that the ball will fall down.
Do you have any ideas?
User avatar
Jonnee
 
Posts: 266
Joined: Fri Nov 16, 2007 9:45 pm

Re: Door doesn't open

Postby ddb174 » Mon Jun 15, 2009 2:29 pm

I seem to remember something like this before, and I think calling physics.enable(0) then physics.enable(1) worked (or maybe it was to warp it a small or null amount), but that requires having Python code called when the button is pushed as well.
ddb174
 
Posts: 928
Joined: Thu Apr 10, 2008 7:28 pm

Re: Door doesn't open

Postby D'Lanor » Mon Jun 15, 2009 3:55 pm

No need to use Python. Another enablemsg should do the trick, a physical instead of a drawable this time. Add this to the open responder:

Sorry, Firefox has decided to no longer paste.... :x

Edit: trying again.

Code: Select all
                      - type: enablemsg
                        params:
                            receivers:
                              - scnobj:<beachball object>
                            cmds:
                              - physical
                              - enable
                        waiton: -1


And if needed you can first do the same with - disable

About the sound, did you add the minfdist and maxfdist flags to your 3d sound emitter? Without these 3d sounds won't play.
"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: Door doesn't open

Postby Jonnee » Mon Jun 15, 2009 10:27 pm

Ok, thanks again. Now I know what I have to do. The sound is fixed.
The ball is still annoying me. Sometimes it moves - and sometimes not. I think it's a matter of the properties, I will play a bit with them...

There is just one change that we need to do with the script:
1.) If I enter the age the position of the door always should be closed. So I don't want to save the position after leaving the age. How do I do that?
2.) The ball should also be on top if I enter the age. I have included the "resetpos" to the ball's properties, but it seems not to work as expected. Is it possible to pretent the ball's position in the script after loading the age?
User avatar
Jonnee
 
Posts: 266
Joined: Fri Nov 16, 2007 9:45 pm

Re: Door doesn't open

Postby diafero » Tue Jun 16, 2009 3:52 am

1.) If I enter the age the position of the door always should be closed. So I don't want to save the position after leaving the age. How do I do that?
We did that for wodan in his age of oolbahnneea by adding a file called "oolbAgeSDLBoolsRespondReset" which the Alcscript can use instead of "xAgeSDLBoolRespond" and which will reset the state of the "door" when you link in (and noone else is there). If you tell me where to send this, I can email you that file (I'll rename it to have the Breldur prefix, of course).
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Door doesn't open

Postby D'Lanor » Tue Jun 16, 2009 5:23 am

Yeah, but you might as well not use any sdl state then... which is going to suck in multiplayer mode.

Potential multiplayer issues: Should the "door" smack closed every time somebody links in? Even if people are near it? Did you use the self.sceneobject.isLocallyOwned() condition to ensure that only the first person linking in resets it? The age list length method tends to be rather unreliable for link in situations (it should only be used when the python file is an age sdl hook with no attachment to a scene object or in cases where events are "random" anyway).
"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: Door doesn't open

Postby Jonnee » Tue Jun 16, 2009 7:08 am

Ok, that doesn't sound good. Then I have to discard my idea.
Can we change the script in this way that if I press the button the second time (so the door = lock bar closes again) and that we also put the ball back on top (we define the position of the ball when the lock bar is closed)?
This would afford that we can repeat the puzzle as often as we want to do. We press the button, the ball falls down, we press it again and the puzzle gets reset.
User avatar
Jonnee
 
Posts: 266
Joined: Fri Nov 16, 2007 9:45 pm

Re: Door doesn't open

Postby D'Lanor » Tue Jun 16, 2009 7:21 am

Edit: Your idea could still work as long as diafero did what I recommended.

Hmm, but how would you explain that warping ball? Magic? If it is a ball people should be able to kick it back there. You could make that easier with a ramp and colliders to guide it.

Of course one can always repeat puzzles by deleting an age. Having a proper delete option will be a must for (personal) fan ages in OSMO.
"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: Door doesn't open

Postby diafero » Tue Jun 16, 2009 7:53 am

I am quite sure we can get this right, Jonnee, so you can keep the reset-if-linking-in idea (in multiplayer systems, it might just reset if noone is in the age at all - would that be ok?). So for the door which is not a door, it should work fine. You will just have to find a way to reset the ball as soon as the age gets empty... D'Lanor, can that be done without Python?
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Door doesn't open

Postby D'Lanor » Tue Jun 16, 2009 8:31 am

My first thought would be to make it a non saving kickable (Resetpos instead of Storepos) but I seem to remember from the dim past that it stopped all synching between clients for that kickable.
"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

PreviousNext

Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests

cron