Question about scripting.

Post » Tue Feb 23, 2010 2:27 am

Alright so if you can do + and - in scripting, like set XPosVar to GetXPos + 5 and same for -, can you do the same thing for Mult and Devide? If so how would it looks? Would it be, ... to GetXPos/5? and would Mult be *? Thanks to anyone who can answer this :D

Gunmaster95
User avatar
Captian Caveman
 
Posts: 3410
Joined: Thu Sep 20, 2007 5:36 am

Post » Tue Feb 23, 2010 8:55 am

Yup divide is / multiply is *
User avatar
JESSE
 
Posts: 3404
Joined: Mon Jul 16, 2007 4:55 am

Post » Tue Feb 23, 2010 2:23 am

You can Divide??!?

I somehow got it in my head that you could only add, subtract or multiply. Well this save me from having to multiply by ridiculous numbers like 0.0582352941
User avatar
Eliza Potter
 
Posts: 3481
Joined: Mon Mar 05, 2007 3:20 am

Post » Mon Feb 22, 2010 10:56 pm

Ok thanks :D
User avatar
Jessica Phoenix
 
Posts: 3420
Joined: Sat Jun 24, 2006 8:49 am

Post » Tue Feb 23, 2010 6:20 am

The available operators are:
+	Addition-	Subtraction*	Multiplication/	Division%	Modulo==	Equal to!=	Not equal to>	Greater than>=	Greater than or equal to<	Less than<=	Less than or equal to&&	And||	Or
In the absence of brackets, the operators will be evaluated in this order:
  • Division / Multiplication / Modulo
  • Addition / Subtraction
  • Less than / Less than or equal to / Greater than / Greater than or equal to
  • Or
  • And
Cipscis
User avatar
remi lasisi
 
Posts: 3307
Joined: Sun Jul 02, 2006 2:26 pm

Post » Tue Feb 23, 2010 7:28 am

Oh sweet, thats really helpful! However, whats modulo do?
User avatar
NEGRO
 
Posts: 3398
Joined: Sat Sep 01, 2007 12:14 am

Post » Mon Feb 22, 2010 5:27 pm

Correct me if I'm wrong, but I believe the modulo returns the remainder of a division equation. Like the modulo of 5/3 is 2 (3 goes into 5 1 time, with 2 left over).
User avatar
Catharine Krupinski
 
Posts: 3377
Joined: Sun Aug 12, 2007 3:39 pm

Post » Mon Feb 22, 2010 9:08 pm

That's correct. Here are a few examples:
5 % 3 = 26 % 2 = 09 % 4 = 115 % 4 = 3
A good use for this operator is checking if one number is evenly divisible by another, due to the fact that (x*y) % x = 0.

Cipscis
User avatar
james kite
 
Posts: 3460
Joined: Sun Jul 22, 2007 8:52 am

Post » Mon Feb 22, 2010 4:57 pm

Ahh ok, thanks alot! :D
User avatar
Erich Lendermon
 
Posts: 3322
Joined: Sat Nov 03, 2007 4:20 pm


Return to Fallout 3