llSetPayPrice question.
|
BronYAurStomp Lightworker
Beep Boop Boop Bop
Join date: 11 Dec 2005
Posts: 25
|
01-03-2006 16:49
i'm trying to define the allowed prices in SetPayPrice by a variable, but it doesn't seem to change accordingly...here's the relevant script: money(key id, integer amount) { price = (2*count); llSetPayPrice(PAY_HIDE, [price, 2*price, 5*price, 8*price]); llSay(0, "Thank you."); }
(The variable is a valid integer) I'm beginning to think it's not possible to dynamically change the prices (not sure if i used the right terminology)...and if it's not possible, is there any sort of work around you guys can think of? Thanks.
|
Myspoonistoobig Laxness
Registered User
Join date: 3 Nov 2005
Posts: 15
|
01-03-2006 17:02
I think the problem is that this function is inside the money event handler. try moving it out of it I was able to use this sucessfully in my own quick test: integer price = 1;
default { state_entry() { llSetPayPrice(PAY_HIDE, [price, 2*price, 5*price, 8*price]); }
money(key id, integer amount) { } }
this worked, the pay options displayed were "1,2,5,8"
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
01-03-2006 17:08
i might not be on the correct frame of mind but are you setting the pay prices before the money event? cause that only fires once the object is actually paid
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
01-03-2006 17:25
I think the idea is to dynamically change the pay price options each time the object is paid. I haven't tried this, so I don't know if it'll work or not. But if it works, it could be used to do some interesting games. Not sure what though  Some kind of variable betting game maybe.
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
01-03-2006 20:20
You need to set the pay price BEFORE the money event is called...as choosing the "pay" option will bring up a pay-screen before prices can be set from within the money event.
_____________________
--AeonVox--Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
01-03-2006 21:26
So you can do this; integer price = 1;
default { state_entry() { llSetTimerEvent(0.1); } money(key id, integer amount) { price = 2*price; llSay(0, "Thank you."); llSetTimerEvent(0.1); } timer() { llSetTimerEvent(0); llSetPayPrice(PAY_HIDE, [price, 2*price, 5*price, 8*price]); } }
_____________________
 Seagel Neville 
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
01-03-2006 21:38
im sry but that timer event make me stand up and walk away for a moment .... heres a progressive gadget, its not fully functional it just multiplys X 2 5 and 8 each time its paid but it might be a point in the right direction integer price = 1;
integer one; integer two; integer three; integer four;
set_money() {llSetPayPrice(PAY_HIDE,[one,two,three,four]);}
set_values() { two = two * 2; three = three * 5; four = four * 8; set_money(); }
default { state_entry() { one = price; two = price *2; three = price *5; four = price *8; set_money(); } money(key id, integer amount) { set_values(); llSay(0, "Thank you."); } }
|
BronYAurStomp Lightworker
Beep Boop Boop Bop
Join date: 11 Dec 2005
Posts: 25
|
01-04-2006 12:44
thanks, i figured out the problem (i was a little too quick to post, sry), which was that the money event is triggered once money is paid to the object, and thus the values would change only after the user would pay. Thank you for the quick and informative replies!!
|