3 registered members (NewbieZorro, TipmyPip, 1 invisible),
19,045
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
HELP NEEDED URGENTLY
#322691
05/08/10 21:39
05/08/10 21:39
|
Joined: Apr 2010
Posts: 59 Lagos, Nigeria
gameaddict
OP
Junior Member
|
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
Serious User
|
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  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
OP
Junior Member
|
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
Serious User
|
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  ) 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: gameaddict]
#322701
05/08/10 22:36
05/08/10 22:36
|
Joined: Apr 2010
Posts: 59 Lagos, Nigeria
gameaddict
OP
Junior Member
|
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: Ottawa]
#322704
05/08/10 22:44
05/08/10 22:44
|
Joined: Apr 2010
Posts: 59 Lagos, Nigeria
gameaddict
OP
Junior Member
|
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
OP
Junior Member
|
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
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi! Can you add these lines before level_load in your 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);
Then if it doesn't work show us your corrected code. Try to place your code in code box ....[code]
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
|