Gamestudio Links
Zorro Links
Newest Posts
Icon "OP"
by JeyKey II. 10/27/26 07:03
No connection to MT4
by JeyKey II. 10/26/26 22:59
ZorroGPT
by TipmyPip. 10/26/26 08:09
Chat Room for Zorro Programmers
by Haitao_Ren. 10/25/26 03:14
Trading Journey
by Haitao_Ren. 10/25/26 03:14
Algorithmic trading course with Zorro
by Haitao_Ren. 10/25/26 03:12
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (JeyKey II, AndrewAMD), 4,634 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Haitao_Ren, JimSimons, julienp, julienper, KelleyAbbey
19247 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