Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Changing integers inside a timer

Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-17-2006 09:47
The "brush" & "mod" integers inside the timer event will not reset to the new values set with the menu unless I reset the script, pick the options and then turn it on. Even tried turning it off and picking an option but it still keeps the original integer value. Any ideas?

CODE

list menu = ["On", "Lower", "Raise", "Level", "Noise", "Smooth", "Revert", "Brush Size"];
list brush_menu = ["Small", "Medium", "Large"];
list on = ["On"];
list off = ["Off"];
integer height = 21;
integer chan = -98;
integer mod;
integer brush;


show_dialog(){
llDialog(llGetOwner(), "Options", menu, chan);
}

default{
state_entry(){
llSetTimerEvent(0.0);
}
touch_start(integer touches){
llDialog(llGetOwner(), "Options", menu, chan);
llListen( chan, "", llGetOwner(), "" );
llListen( 0, "", llGetOwner(), "" );
}
listen( integer channel, string name, key id, string message ){
if(channel == 0){
height = (integer)message;
}
if(message == "On"){
menu = llListReplaceList(menu, off, 0, 0);
show_dialog();
llSetTimerEvent(0.1);
}
else if(message == "Off"){
menu = llListReplaceList(menu, on, 0, 0);
show_dialog();
llSetTimerEvent(0.0);
}
else if(message == "Lower"){
mod = LAND_LOWER;
show_dialog();
}
else if(message == "Raise"){
mod == LAND_RAISE;
show_dialog();
}
else if(message == "Level"){
mod == LAND_LEVEL;
show_dialog();
}
else if(message == "Noise"){
mod == LAND_NOISE;
show_dialog();
}
else if(message == "Smooth"){
mod == LAND_SMOOTH;
show_dialog();
}
else if(message == "Revert"){
mod == LAND_REVERT;
show_dialog();
}
else if(message == "Brush Size"){
llDialog(llGetOwner(), "Options", brush_menu, chan);
}
else if(message == "Small"){
brush == LAND_SMALL_BRUSH;
show_dialog();
}
else if(message == "Medium"){
brush == LAND_MEDIUM_BRUSH;
show_dialog();
}
else if(message == "Large"){
brush == LAND_LARGE_BRUSH;
show_dialog();
}
}
timer(){
float ground = llGround(ZERO_VECTOR);
//if(ground >= height){
llModifyLand(mod, brush);
//}
}
}
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
11-17-2006 10:07
You're using a double ==. That's for comparison, not assignment. Change them to single =s.

CODE
mod == LAND_RAISE;


Should be:

CODE
mod = LAND_RAISE;


Now you can kick yourself :)
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-17-2006 10:12
From: Ziggy Puff

Now you can kick yourself :)


GROAN and yes that is exactly what I am going to do!!! Thank you Ziggy!
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
Dammmmit!
11-19-2006 13:20
Newgy takes a couple of days holiday and misses out on Jesse noobing!
(second) Life is just soooo unfair *pout*
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-19-2006 16:43
From: Newgate Ludd
Newgy takes a couple of days holiday and misses out on Jesse noobing!
(second) Life is just soooo unfair *pout*

I revel in my noobness. For me even tiny little discoveries are sooo exciting and embarrasing mistakes aren't as embarassing!!!!
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum