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
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 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 1 of 5 1 2 3 4 5
HELP NEEDED URGENTLY #322691
05/08/10 21:39
05/08/10 21:39
Joined: Apr 2010
Posts: 59
Lagos, Nigeria
gameaddict Offline OP
Junior Member
gameaddict  Offline OP
Junior Member

Joined: Apr 2010
Posts: 59
Lagos, Nigeria
Hi guys. I'm trying to learn animation and blending from the khmovement tutorial but it's giving me a hard time because I'm using the free version and it doesn't support wdl scripts. I'm now in the process of converting it to .c format but I keep running into problems. I'm still a beginner and don't know much about the engine so some things just seem impossible at the moment. Does anyone know if it has been converted already? Are there alternative tutorials for A7?

Here's one of the place I'm stuck on now.

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);

}


The engine keeps complaining about the temp. I decided to make it a vector using VECTOR* temp but then the engine is now complaining about my.move_x which is a synonym for skill22 not being a member of an entity.

Please, how do I modify this code? Where can I find movement tutorials meant for A7?


I know I can.
Re: HELP NEEDED URGENTLY [Re: gameaddict] #322693
05/08/10 21:45
05/08/10 21:45
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
For your temp use a VECTOR (if you wnat to use it global)

VECTOR* name;

Is just a declaration of a pointer without memory(NULL at the beginning, causes random read/write into memory).

And for your skill use:

#define move_x skill2

that should work(if not, post more code pls)

And Lite-c is a better choice than wdl, it has more possibilities wink

Greets
Rackscha

Last edited by Rackscha; 05/08/10 21:46.

MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: HELP NEEDED URGENTLY [Re: Rackscha] #322694
05/08/10 21:56
05/08/10 21:56
Joined: Apr 2010
Posts: 59
Lagos, Nigeria
gameaddict Offline OP
Junior Member
gameaddict  Offline OP
Junior Member

Joined: Apr 2010
Posts: 59
Lagos, Nigeria
Thanks for replying. I'm posting all the code. It's actually little because I just started trying to convert it. I've defined temp as a vector but its complaining about skill22 not being a member of an entity.

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

#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 know I can.
Re: HELP NEEDED URGENTLY [Re: gameaddict] #322695
05/08/10 21:59
05/08/10 21:59
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
ofcourse it doesnt work with your skill statement

you have to write

skill22
instead of
SKILL22

In lite-c

A is not a(but in wdl A is a, keep an eye on it when you use capital letters wink )


and NO
";"
at the end of a "#define" declaration.


that should do it.

Greets
Rackscha

Last edited by Rackscha; 05/08/10 21:59.

MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: HELP NEEDED URGENTLY [Re: Rackscha] #322699
05/08/10 22:11
05/08/10 22:11
Joined: Apr 2010
Posts: 59
Lagos, Nigeria
gameaddict Offline OP
Junior Member
gameaddict  Offline OP
Junior Member

Joined: Apr 2010
Posts: 59
Lagos, Nigeria
Thanks. I'll edit now.


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

Joined: Apr 2010
Posts: 59
Lagos, Nigeria
I've edited everything and it's compiling and running but crashes at black screen before even showing level.


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

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

Where's your main?
And
can we see it?

Re: HELP NEEDED URGENTLY [Re: Ottawa] #322704
05/08/10 22:44
05/08/10 22:44
Joined: Apr 2010
Posts: 59
Lagos, Nigeria
gameaddict Offline OP
Junior Member
gameaddict  Offline OP
Junior Member

Joined: Apr 2010
Posts: 59
Lagos, Nigeria
Here it is

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

#include "player.c";

function main()
{
level_load("moving.wmb");
}

It is exactly the same with the khmovement except I'm trying to convert to lite-c since free doesn't support wdl.


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

Joined: Apr 2010
Posts: 59
Lagos, Nigeria
Here's the edited 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 know I can.
Re: HELP NEEDED URGENTLY [Re: gameaddict] #322708
05/08/10 22:59
05/08/10 22:59
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

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

Can you add these lines before level_load in your main?
Code:
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);



Then if it doesn't work show us your corrected code.
Try to place your code in code box ....[code]


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Page 1 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