right kilk problems

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

right kilk problems

Post by darksmaster923 »

k i want if the right mouse button is pressed, a variable changes
but there glitches with this code

Code: Select all

              	if(self.rbutton_pressed) // right button press
                {
                       	if(zoomed = true)
                        {
                              	zoomed = false;
				return 0;
                        }
			else
			{
                            	zoomed = true;
				return 0;
			}
                }
it doesnt seem to change the var when i want it to
Herp derp.
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

You wrote:

Code: Select all


if(self.rbutton_pressed) // right button press 
{ 
   if(zoomed = true) 
   { 
      zoomed = false; 
      return 0; 
   }
   else 
   { 
      zoomed = true; 
      return 0; 
   } 
}
I just wrote it again because from the code you wrote (the visualization) it is very hard to see what it actually does. Please try to write it better next time. If you want the poeple to help you then you should also make it as easy as possible for them, becuase then also more poeple will try to help you. :wink:

Now for your problem:
I had this problem once too, i think, i made a workaround by writing the values in ""s.

maybe like this:

Code: Select all

if(self.rbutton_pressed) // right button press 
{ 
   if(zoomed = "true") 
   { 
      zoomed = "false"; 
      return 0; 
   }
   else 
   { 
      zoomed = "true"; 
      return 0; 
   } 
}
Somehow simkin seems to have problems with xxx = true and xxx = false, but xxx = "true" and xxx = "false" do work.
Everyone can see the difficult, but only the wise can see the simple.
-----
Post Reply