Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (AndrewAMD, dBc, clonman, TipmyPip), 18,763 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 3 1 2 3
Re: random question [Re: carla_mariz] #359402
02/17/11 12:36
02/17/11 12:36
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
uhm..very very last question mrguest, how can i make the entity answer be placed on random places? because i don't want it to be created on the same place every time i load the level. how can i do that? grin

Re: random question [Re: carla_mariz] #359503
02/18/11 01:15
02/18/11 01:15
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
lol, create an array of possible locations and randomly select one
use something similar to the the random questions
Code:
void position_add(VECTOR* pos){
VECTOR* vec_rndPos;
int int_rndPositionCount; //stores the number of random positions
int int_rndPositionSelected;

//function for adding position to the pool
void position_add(VECTOR* pos){
	
	int i = int_rndPositionCount;
	int_rndPositionCount++;
	
	vec_rndPos = realloc(vec_rndPos, sizeof(VECTOR) * (int_rndPositionCount));
	
	vec_set(vec_rndPos[i], pos);
}



use
Code:
position_add(vector(100, 200, 300));

for storing the positions
then
Code:
int_rndPositionSelected = random(integer(int_rndPositionCount)); //randomly generates a positions

will store selected positions id
and
Code:
//vec_rndPos[int_rndPositionSelected]; //stores the position

will give the positions you need


Re: random question [Re: MrGuest] #359509
02/18/11 03:09
02/18/11 03:09
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
geez..thanks..i will do it right away!! grin

Re: random question [Re: carla_mariz] #359986
02/21/11 07:29
02/21/11 07:29
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
how can i call the randomized position?? ?.?

Re: random question [Re: carla_mariz] #360065
02/21/11 18:13
02/21/11 18:13
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
either vec_set(vecToSet, vec_rndPos[int_rndPositionSelected]);

or ent_create("entname.mdl", vec_rndPos[int_rndPositionSelected], actionname);

depends what you're doing with it

Page 3 of 3 1 2 3

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1