Page 1 of 1

Button Alcscript problem

PostPosted: Mon Sep 01, 2008 8:26 am
by boblishman
Ok guys... I really need your help... this is driving me insane ... I have spent about 6 hours on this already but to no avail ... :(

(I have previously made a (quite complex) animated "button", with synchronised sound and avatar animation, that opens a "door" ... and it works perfectly, so it's not like this is my first attempt.)

All I want to do now, is to make a simple "button" that animates and plays a sound without any avatar animation ... so ... I made the button (called button1), added the IPO animation and set it to loop and autostart ... checked it in game ... Works perfectly.

Then I added a generic logic region (called KeyPadRgn) to surround the button (to make it clickable), and added a sound emitter (called emit_but1snd) for the sound.

I then set about using "sections" of my previous Alcscript (and obviously changed the animation to not autostart or loop and changed the names of the various objects) ...

Now, I thought I had got my head around the Alcscript for animations ... but obviously not, ... :evil: ...

This SIMPLE button just refuses to animate or play the sound !

Sure, I get the hotspot ... but no "action" ... grrrrr ...



Now, can anyone spot where I am going wrong with the alcscript ...

buttonscript.jpg
buttonscript.jpg (41.57 KiB) Viewed 2048 times



Your help would be VERY much appreciated as I have 8 more of these simple buttons to create.

Once I can get one working ... then I´ll be ok ... ;)

Cheers

Re: Button Alcscript problem

PostPosted: Mon Sep 01, 2008 9:28 am
by D'Lanor
You used the $ character to reference a name. Names should be referenced with a : character. The $ character is reserved for tag references.

Referencing a name:
Code: Select all
actions:
  - type: responder
    ref: :butresp


As a note of interest, tag references only work within the same object which is the case here. So alternatively you could keep the $ and change "name: butresp" to "tag: butresp".

Re: Button Alcscript problem

PostPosted: Mon Sep 01, 2008 9:42 am
by GPNMilano
What D'Lanor said. Your script is making two responders upon export. A named one, and an autoclick referenced one.

Re: Button Alcscript problem

PostPosted: Mon Sep 01, 2008 11:24 am
by boblishman
AAAAAAAAAAAAARRRRRRRRRRRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHH !
6 hours of sweat and tears .... all for one single stupid $ character ... :twisted:

Thanks D'Lanor ... works perfectly ... now I can get the other 8 working ... :)

EDIT: All 9 buttons are now working ... Thanks again! :)