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
3 registered members (AndrewAMD, Ayumi, NewbieZorro), 13,972 guests, and 6 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 5 1 2 3 4 5
Re: HELP NEEDED URGENTLY [Re: Ottawa] #322710
05/08/10 23:02
05/08/10 23:02
Joined: Apr 2010
Posts: 59
Lagos, Nigeria
gameaddict Offline OP
Junior Member
gameaddict  Offline OP
Junior Member

Joined: Apr 2010
Posts: 59
Lagos, Nigeria
ok. I'll add it now.


I know I can.
Re: HELP NEEDED URGENTLY [Re: Ottawa] #322713
05/08/10 23:25
05/08/10 23:25
Joined: Apr 2010
Posts: 59
Lagos, Nigeria
gameaddict Offline OP
Junior Member
gameaddict  Offline OP
Junior Member

Joined: Apr 2010
Posts: 59
Lagos, Nigeria
Still didn't work. Windows just says not responding and I have to close it via the task bar. Here's the sructure and code.

Folder:
...........player.mdl
...........main.c
...........player.c
...........moving.wmb

I added too hollow cubes, textured them added a camera and it was working before I began coding.


here's the edited codes

main.c:

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

#include "player.c";

function main()
{
   video_aspect = 1.333; // enforce 4:3 mode if you do not want widescreen in effect
	video_mode = 7; // start resolution 800 x 600
	video_screen = 1; // start in fullscreen mode 	
	video_depth = 32; // otherwise 32 bit mode
   wait (1);
	
	level_load("moving.wmb");
}



////////////////////////////////////////

Here's player.c:

Code:
//////////////////////////////////////////////////////////////////////

#define move_x skill22  // movement skills
#define move_y skill23
#define move_z skill24
#define force_x skill25
#define force_y skill26
#define force_z skill27
#define velocity_x skill28
#define velocity_y skill29
#define velocity_z skill30

#define animate skill31  ///animation skills
#define animate2 skill32
#define animblend  skill33
#define currentframe skill34
#define blendframe  skill35


#define z_offset skill50 //gravity and jumping skills
#define jumping_mode skill51
#define gravity  skill52
#define movement_mode skill53 //4 various movements, mainly combat
#define moving skill54

#define hit_by_player skill55
#define entity_type skill56

VECTOR* temp;


function handle_movement() {
	temp.x = -1000;
	temp.y = 0;
	if(key_w ==1) { temp.x = camera.pan; }
	if(key_s ==1) { temp.x = camera.pan + 180; }
	if(key_a ==1) { temp.x = camera.pan + 90; }
	if(key_d ==1) { temp.x = camera.pan - 90; }
   if(temp.x != 1000) { temp.y = 15 * time_step; }
   my.move_x = fcos(temp.x, temp.y);
   my.move_y = fsin(temp.x, temp.y);
   c_move(my, nullvector, my.move_x, USE_AABB | IGNORE_PASSABLE | GLIDE);
   
}


function handle_camera() { 
    //place cam behind player
    vec_set(camera.x, vector(my.x + fcos(my.pan, -200), my.y + fsin(my.pan, -200), my.z + 80));
    vec_diff(temp.x, my.x, camera.x); //make cam look towards player
    vec_to_angle(camera.pan, temp.x);
}

action player_action()
{
	set(my, SHADOW);
	while(1); {
		handle_movement();
		handle_camera();
		wait(1);
	}
}




I don't really know how to use the code tags.... dunno if I got it.


I know I can.
Re: HELP NEEDED URGENTLY [Re: gameaddict] #322714
05/08/10 23:29
05/08/10 23:29
Joined: Apr 2010
Posts: 59
Lagos, Nigeria
gameaddict Offline OP
Junior Member
gameaddict  Offline OP
Junior Member

Joined: Apr 2010
Posts: 59
Lagos, Nigeria
found an error: if(temp.x != 1000) { temp.y = 15 * time_step; } supposed to be -1000. I've corrected it in my code but it doesn't help.


I know I can.
Re: HELP NEEDED URGENTLY [Re: gameaddict] #322715
05/08/10 23:30
05/08/10 23:30
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

remove the ; after #include "player.c"


You got the code boxes all right.
For the other coded boxes and...look in FAQ under
What UBBCode can I use in my posts?

edit : change the name of the temp variable to tempmine or something like that. The temp could be used elsewhere in GS.

Last edited by Ottawa; 05/08/10 23:33. Reason: added info

Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: HELP NEEDED URGENTLY [Re: Ottawa] #322716
05/08/10 23:37
05/08/10 23:37
Joined: Apr 2010
Posts: 59
Lagos, Nigeria
gameaddict Offline OP
Junior Member
gameaddict  Offline OP
Junior Member

Joined: Apr 2010
Posts: 59
Lagos, Nigeria
Still same problem. It just shows black screen and hangs.


I know I can.
Re: HELP NEEDED URGENTLY [Re: gameaddict] #322718
05/08/10 23:41
05/08/10 23:41
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

Now look at your main.

It's the most important function of your game.
It does one thing ...it loads the level.
Then it does nothing.

How will the other function start?
You have to start the game with a call to functions.


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: HELP NEEDED URGENTLY [Re: Ottawa] #322719
05/08/10 23:46
05/08/10 23:46
Joined: Apr 2010
Posts: 59
Lagos, Nigeria
gameaddict Offline OP
Junior Member
gameaddict  Offline OP
Junior Member

Joined: Apr 2010
Posts: 59
Lagos, Nigeria
Will change it now.


I know I can.
Re: HELP NEEDED URGENTLY [Re: gameaddict] #322720
05/08/10 23:51
05/08/10 23:51
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!
Been looking at your code.

Your action to
player_action()

Is it assigned to an entity in your world?
It should start the game if it is.


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: HELP NEEDED URGENTLY [Re: gameaddict] #322722
05/08/10 23:53
05/08/10 23:53
Joined: Apr 2010
Posts: 59
Lagos, Nigeria
gameaddict Offline OP
Junior Member
gameaddict  Offline OP
Junior Member

Joined: Apr 2010
Posts: 59
Lagos, Nigeria
It always sends crash message of whatever function I call. I've tried handle_movement and even player_action() but it keeps crashing.

eg

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

#include "player.c"

function main()
{
   video_aspect = 1.333; // enforce 4:3 mode if you do not want widescreen in effect
	video_mode = 7; // start resolution 800 x 600
	video_screen = 1; // start in fullscreen mode 	
	video_depth = 32; // otherwise 32 bit mode
   wait (1);
	
	level_load("moving.wmb");
	player_action();
}




I know I can.
Re: HELP NEEDED URGENTLY [Re: gameaddict] #322723
05/08/10 23:56
05/08/10 23:56
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

No for player action in main. It's an action and action start right away
with your main if they are assigned to an entity in your world.

I got in a message while you were working on the solution.


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Page 2 of 5 1 2 3 4 5

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