| 
		
	
		| bagmanpt   Junior Member
 
 Posts: 9
 Threads: 4
 Joined: Mar 2012
 Reputation: 
0
 | 
			| Creating a Random variable 
 
				hi guys, im new in the forums.
 im trying to figure out how to create a random variable, but honestly i havent got much time to script anything yet, im creating a CS with new models and textures, and its driving me crazy all time, i did not wasted any time yet with programming.
 so if you guys could help i'll appreciate.
 
 thank you in advance
 |  |  
	| 03-31-2012, 08:54 AM |  |  
	
		| SilentStriker   Posting Freak
 
 Posts: 950
 Threads: 26
 Joined: Jul 2011
 Reputation: 
43
 | 
			| RE: Creating a Random variable 
 
				Is it RandFloat or RandInt your looking for?
 could you explain it a bit more?
 
 
 
 |  |  
	| 03-31-2012, 10:15 AM |  |  
	
		| Linus Ågren   Senior Member
 
 Posts: 309
 Threads: 58
 Joined: Jan 2011
 Reputation: 
5
 | 
			| RE: Creating a Random variable 
 
				I made a random push on rocks when a corridor caves in so they won't go in the same path all the time. I did this: float spX = RandFloat(3.0f, 6.0f);float spY = RandFloat(2.0f, 5.0f);
 float spZ = RandFloat(3.0f, 5.0f);
 
 
 AddPropImpulse("dungeon_small01_5", spX, spY, spZ, "");
 AddPropImpulse("dungeon_small01_6", spX, spY, spZ, "");
 AddPropImpulse("stone_small01_brown_2", spX, spY, spZ, "");
 AddPropImpulse("stone_small01_brown_3", spX, spY, spZ, "");
 
If this is not what you're looking for, be more specific please. (:
			
 Creator of The Dark Treasure. |  |  
	| 03-31-2012, 11:11 AM |  |  
	
		| bagmanpt   Junior Member
 
 Posts: 9
 Threads: 4
 Joined: Mar 2012
 Reputation: 
0
 | 
			| RE: Creating a Random variable 
 
				 (03-31-2012, 11:11 AM)junkfood2121 Wrote:  I made a random push on rocks when a corridor caves in so they won't go in the same path all the time. I did this:
 
 float spX = RandFloat(3.0f, 6.0f);float spY = RandFloat(2.0f, 5.0f);
 float spZ = RandFloat(3.0f, 5.0f);
 
 
 AddPropImpulse("dungeon_small01_5", spX, spY, spZ, "");
 AddPropImpulse("dungeon_small01_6", spX, spY, spZ, "");
 AddPropImpulse("stone_small01_brown_2", spX, spY, spZ, "");
 AddPropImpulse("stone_small01_brown_3", spX, spY, spZ, "");
 
If this is not what you're looking for, be more specific please. (:
 thank you,  
its that i am looking for, its for integer but i will manage to do what i want   
i just need to know this line "float spZ = RandFloat(3.0f, 5.0f);" which later i'll translate to "int X = RandInt(1, 5);"
 
thank you very much both of you
			 |  |  
	| 03-31-2012, 11:14 AM |  |  
	
		| SilentStriker   Posting Freak
 
 Posts: 950
 Threads: 26
 Joined: Jul 2011
 Reputation: 
43
 | 
			| RE: Creating a Random variable 
 
				Your welcome   
 |  |  
	| 03-31-2012, 11:22 AM |  |  |