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
7 registered members (clonman, TipmyPip, Niels, dBc, Ed_Love, 3run, 1 invisible), 18,869 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 2 of 3 1 2 3
Re: random question [Re: MrGuest] #358434
02/11/11 10:40
02/11/11 10:40
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
hello mr. guest, i'm glad you answered my question. can you check on the code that i posted if its correct? i changed a bit from yours and changed "bmap" to "questions". the picture file are in the same folder with the script. pls help me.thanks.

Last edited by carla_mariz; 02/11/11 10:46.
Re: random question [Re: MrGuest] #358439
02/11/11 10:55
02/11/11 10:55
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
hey!! it worked now..thanks for your help mr. guest.. ^_^..xbox and logan laugh

now my problem is, how to show the models which represents the answer. and it should be found at the maze(proper game). frown

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

Joined: Jul 2008
Posts: 1,178
England
i've already mentioned that in my 1st post
Code:
//rnd_q[int_rndQuestionSelected].model; //stores the model name


use
Code:
ent_create(rnd_q[int_rndQuestionSelected].model, vector(-10, 0, 0), NULL);

to create it, obviously change the position to where you want it created and add an action should it need one.

Make syoure you're creating it AFTER you've set the random number

Re: random question [Re: MrGuest] #358445
02/11/11 11:54
02/11/11 11:54
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
ooooohhh..now it worked! laugh
it perfectly run and randomly shows question and its answer at the same time. thanks for your help. laugh thank you thank you thank you very much!!! grin

Re: random question [Re: MrGuest] #359031
02/15/11 02:43
02/15/11 02:43
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
hi mrGuest laugh

i have a little problem with this..when i include this script to mine, the question and answer are not showing. even if i place it to my script,still the same but there is no error. thats why i don't know whats wrong frown

Re: random question [Re: carla_mariz] #359032
02/15/11 03:45
02/15/11 03:45
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 come it becomes syntax error when i put it inside another script?

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

Joined: Jul 2008
Posts: 1,178
England
without seeing your code and how you're including the file it'd be hard to comment on what the error is and why you have a syntax error

Re: random question [Re: MrGuest] #359101
02/15/11 17:37
02/15/11 17:37
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
oopss..sorry laugh

i first run the menu:
Code:
#include <acknex.h>
#include <default.c>

#include "level1.c"

......
function main()
{
	screen_size.x = 800;
	screen_size.y = 600;
	mouse_map = cur;
	mouse_mode = 4;
}


function redlevel1()
{
	selectchar.flags &= ~SHOW;
	level1();
	wait(-2);
	level_load("maze1.wmb");
	wait(3);
	gui.flags = SHOW | OVERLAY;
	health_pan.flags = SHOW | OVERLAY;
	left_bar.flags = SHOW | OVERLAY;
	media_stop(soundtrack_handle);
}

function bluelevel1()
{
	selectchar.flags &= ~SHOW;
	level1();
	wait(-2);
	level_load("maze1.wmb");
	wait(3);
	gui.flags = SHOW | OVERLAY;
	health_pan.flags = SHOW;
	left_bar.flags = SHOW | OVERLAY;
	media_stop(soundtrack_handle);
}



next is the level 1

Code:
#include <acknex.h>
#include <default.c>

#include "mainmenucode.c"
#include "structq.c"

.....

function main()
{
	screen_size.x = 800;
	screen_size.y = 600;
	sun_light=100;	
}

/////some functions here..



i want the struct file to run when the level is loaded so i include it in level1 code. but nothing shows. frown

when i try to put the script to menucode,
it becomes like this:

Code:
#include <acknex.h>
#include <default.c>

#include "level1.c"

typedef struct RND_Q {
	BMAP* questions;
	char* model;
} RND_Q;

RND_Q* rnd_q;
int int_rndQuestionCount;
int int_rndQuestionSelected;

PANEL* pnl_question = {
	layer = 4;
	pos_x = 673;
	pos_y = 490;
	flags = SHOW | OVERLAY;
}


void question_add(char* questions, char* model)
{
	int i = int_rndQuestionCount;
	int_rndQuestionCount++;
	
	rnd_q = realloc(rnd_q, sizeof(RND_Q) * (int_rndQuestionCount));
	
	rnd_q[i].questions = bmap_create(questions);
	rnd_q[i].model = model;
}

function main()
{
	screen_size.x = 800;
	screen_size.y = 600;
	mouse_map = cur;
	mouse_mode = 4;
	
        wait(1);
	question_add("tanong1.tga", "paccherry.mdl");
	question_add("tanong2.tga", "bilog.mdl");
	question_add("tanong3.tga", "heart.mdl");
	question_add("tanong4.tga", "strip.mdl");
	
	random_seed(0);
	
	int_rndQuestionSelected = random(integer(int_rndQuestionCount)); 	
	
	pnl_question.bmap = rnd_q[int_rndQuestionSelected].questions;
	ent_create(rnd_q[int_rndQuestionSelected].model, vector(-240, -16, 48), NULL);

}



and then a syntax error appears on "typedef struct" line. frown

Re: random question [Re: carla_mariz] #359228
02/16/11 11:03
02/16/11 11:03
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
can you send me your project, zip it and send to jks_here@hotmail.com i'll take a look tonight.

btw... you haven't added in the question_add function the correct answer...

Re: random question [Re: MrGuest] #359400
02/17/11 12:00
02/17/11 12:00
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
hi again mrguest laugh

everything is ok now, and its working! thanks to you!!! :*&#9829;

Page 2 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