Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,014 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Level load problem #258588
03/31/09 18:21
03/31/09 18:21
Joined: Mar 2009
Posts: 88
Walori Offline OP
Junior Member
Walori  Offline OP
Junior Member

Joined: Mar 2009
Posts: 88
Greetings all, it was about time I have to ask, and post, to these forums. My problem is maybe a simple one with better GS versions but in Lite-C I use (well, I do have 30d trial, but I can't count on that because I can't be too dependented of it when trial ends.) I have tried to attach my = NULL; to the functions without succes.

Basicly I'm looking a way to load a level, from one file to another so that the functions don't give you a error message. Here's some things I've done, and how the code works.

Code:
//////////////////////////////
// Create player model by gendre
//////////////////////////////
	switch (player_gendreC){
		case 1:
			player_warrior = ent_create("Data/Models/army.mdl",vector(223,-1105,0),NULL);
			player = player_warrior;
			break;
		case 2:
			player_warrior = ent_create("Data/Models/soldat.mdl",vector(223,-1105,0),NULL);
			player = player_warrior;
			break;
		default://Create female model by default (No difference yet!)
			player_warrior = ent_create("Data/Models/army.mdl",vector(223,-1105,0),NULL);
			player = player_warrior;
			break;
	}
	
//////////////////////////////
// Set player UI and all the neccesaery stuff
//////////////////////////////
	player_ui_mana_pan.flags = VISIBLE;
	player_ui_health_pan.flags = VISIBLE;		
	wait(1);
	player.pan = 0;
	melee_model(NULL);
	shield_model(NULL);
   ent_create (shield_mdl, player.x+9, move_shield);
   ent_create (melee_mdl, player.x+9, move_melee);
   pSpell =ent_create("", vector(0,0,-10000),0);//Create dummy spell to the field
	wait(1);
	ptr_remove(pSpell);//And remove dummy spell
	
	
wait(1);
//vec_set(mouse_pos.x,mouse_cursor.x);
//vec_set(mouse_pos.y,mouse_cursor.y);
mouse_pointer = 1;
//////////////////////////////
// Main loop
//////////////////////////////
while(player !=NULL){

		mouse_pos.x = mouse_cursor.x;
		mouse_pos.y = mouse_cursor.y;
	   if(key_f2){
	   	//player = NULL;
			//level_load("Data/Maps/02/demo_level.wmb");
				}
	//////////////////////////////
	// Load functions
	//////////////////////////////	
		controls();
		player_gravity();
		calc_player_stats();

...


That's the game void I'm using to handle the basics of the game, character creations, spell system and so forth. Everything works from this file, saved as game.c to my hard drive.

Code:
function controls(){
var dummy_alive = 0;
	if(mouse == 0){
	//////////////////////////////
	// General movement
	//////////////////////////////
		if(key_pressed(282) == ON){
			mouse = 1;
		}
	   if (key_w)
			c_move(player, vector(5*time_step,0,0),nullvector, GLIDE);
	   if (key_s)
			c_move(player, vector(-5*time_step,0,0),nullvector, GLIDE);
	   if(key_a)
			c_move(player, vector(0,5*time_step,0),nullvector, GLIDE);
	   if(key_d)
			c_move(player, vector(0,-5*time_step,0),nullvector, GLIDE);
	   if((key_shift) && (key_w))
			c_move(player, vector(7*time_step,0,0),nullvector, GLIDE);
	   if(key_f2){
	   	lvl_load = 1
			//level_load("Data/Maps/02/demo_level.wmb");
		}
		if((key_pressed(57)) == ON ){	
			c_move(player, vector(0,0,67*time_step),nullvector, GLIDE);
			wait(1);
		}	
	//////////////////////////////
	// Special commands
	//////////////////////////////
		if(key_f4){
			printC_game_info_pan.flags = VISIBLE;
			k_pan.flags = VISIBLE;
			//set(printC_game_info_pan, VISIBLE);
			//set(k_pan, VISIBLE);

...

And here we have a glance to a file that causes one of the problems: controls.c, basicly I've made "player" (defined earlier in void game) and move it, I haven't used any my, or me because I can't attach these to the player from WED when the trial ends (afaik)

So if I want to load let's say from map1.hmp to level1.wmb what should I put to these files? Or do I have to take a risk and attach these from WED (as action right?). I'd rather use this format though.

Thanks in advance,
Walori

Re: Level load problem [Re: Walori] #258805
04/02/09 09:09
04/02/09 09:09
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
why you can't put hmp in wmb and load only wmb files in whole project? Will be easier for you smile


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: Level load problem [Re: Jaxas] #258932
04/03/09 04:33
04/03/09 04:33
Joined: Jan 2009
Posts: 36
Philippines
U
unknown_master Offline
Newbie
unknown_master  Offline
Newbie
U

Joined: Jan 2009
Posts: 36
Philippines
is the level_load contains path to locate the wmb file? i think not!!! it should be a level_load(name of wmb) and the wmb file read in the same file...you dont need to locate the path just put in on the same file!!! it would be easier to load... smile





From: Anino Games Inc. Philippines

Re: Level load problem [Re: unknown_master] #259046
04/03/09 16:07
04/03/09 16:07
Joined: Mar 2009
Posts: 88
Walori Offline OP
Junior Member
Walori  Offline OP
Junior Member

Joined: Mar 2009
Posts: 88
THanks for your advices, but I've succesfully (fainlly -.-) succeded in this. Basicly now I create player again when the level loads with the equipment, not estetic but does it job.


Problem solved, thank you both

-Walori


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

Gamestudio download | chip programmers | 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