Help Scripting Please
|
|
Damian Sixpack
Registered User
Join date: 27 Jul 2006
Posts: 3
|
01-08-2007 01:48
Hello all, I'm trying to script a camping bonus station. I have a slot machine scripted out and working. I have a camping chair built. What I need help with is, how do make a camping script that will talk to the slot machine. And when certain combos are hit on slot machine it tell the chair to add 1 to payout or 1 to mins. and set up a bonus cycle system that only pays for a certain cycle period and when cycles run out they get booted from chair. Any help at all on this is greatly appreciated. Anything that will get me started.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
01-08-2007 01:59
From: Damian Sixpack Hello all, I'm trying to script a camping bonus station. I have a slot machine scripted out and working. I have a camping chair built. What I need help with is, how do make a camping script that will talk to the slot machine. And when certain combos are hit on slot machine it tell the chair to add 1 to payout or 1 to mins. and set up a bonus cycle system that only pays for a certain cycle period and when cycles run out they get booted from chair. Any help at all on this is greatly appreciated. Anything that will get me started. You can set up a listen between the camping chair and the slot machine just as you would to listen to the owner. Then the slot machine would say/whisper the relevant win message when the combinations are displayed. The camping chair would hear the message and react accordingly.
|
|
Damian Sixpack
Registered User
Join date: 27 Jul 2006
Posts: 3
|
01-08-2007 12:57
Could you please give me an example of how to do that. I'm new to scripting still trying to figure stuff out. Thank you
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
01-08-2007 14:21
From: Damian Sixpack Could you please give me an example of how to do that. I'm new to scripting still trying to figure stuff out. Thank you Yet you have managed to get a fruit machine working? in both objects add a listen on a channel. Each unit will then say/whispher their commands/results on that channel for the other to hear. Really noddy example, drop this script into 2 prims then touch one of them. they will start chatting backwards and forward. integer Channel = -999; integer counter;
default { state_entry() { counter = 0; llListen(Channel,"","",""); }
touch_start(integer num_detected) { llSay(Channel,"PING"); } listen(integer channel, string name, key id, string message) { if(counter < 9) { if("PING" == message) llSay(Channel,"PONG"); else if("PONG" == message) llSay(Channel,"PING"); } } }
Obviously that is artificailly simple but thats how easy communication is.
|
|
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
|
01-08-2007 14:37
Might I suggest a more secure thing and to link them all together if you can, then use linked messages. Any type of say communication can be snooped and spoofed, unless you want to add in some encryption, and even then it's not totally secure. A linked message, if you can't modify the object, you can't see the message.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
01-08-2007 14:39
From: Lazink Maeterlinck Might I suggest a more secure thing and to link them all together if you can, then use linked messages. Any type of say communication can be snooped and spoofed, unless you want to add in some encryption, and even then it's not totally secure. A linked message, if you can't modify the object, you can't see the message. The OP did state they where seperate objects. Adding encryption etc would be easy enough but didnt want to clutter the basic's.
|
|
RaH Wollongong
Registered User
Join date: 11 Jul 2006
Posts: 19
|
01-08-2007 17:14
Why encrypt the message and give the script the overhead of cyphering the message. Just encrypt the initial password. Or better yet. Set a var that holds the UID of the object the chair is listening for and if detects a message from a source other than that UID its ignored.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
01-09-2007 00:44
From: RaH Wollongong Or better yet. Set a var that holds the UID of the object the chair is listening for and if detects a message from a source other than that UID its ignored. We are clouding the original issue here, but yes I would use a paired system.
|