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 (TipmyPip, AndrewAMD, NewbieZorro), 16,055 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
Simple man game ! #268513
05/29/09 19:03
05/29/09 19:03
Joined: Apr 2009
Posts: 15
Algeria
Y
Y200Corp Offline OP
Banned / Warez
Y200Corp  Offline OP
Banned / Warez
Y

Joined: Apr 2009
Posts: 15
Algeria
hi everyones,
i would know how to creat a simple game which we have a man and the camera and he can walk but without jumping.
can anyone help
pS: i have seen many exemple but it doesn't look like i want

Re: Simple man game ! [Re: Y200Corp] #268518
05/29/09 19:29
05/29/09 19:29
Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
slacer Offline
Expert
slacer  Offline
Expert

Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
That you should describe what you want to see.
You could tell the name of a similar game.

Re: Simple man game ! [Re: slacer] #268540
05/29/09 21:14
05/29/09 21:14
Joined: Apr 2009
Posts: 298
Southern Oceans
KiwiBoy Offline
Member
KiwiBoy  Offline
Member

Joined: Apr 2009
Posts: 298
Southern Oceans
Here ya go smile
Should just plug straight in with a couple of modifications.

Click to reveal..
#include <acknex.h>
#include <default.c>
//==============================================================>>



action players_code()
{
VECTOR VecTo;
VECTOR VecFrom;
var anim_percentage;
var camera_distance = 20;
var camera_height = 10;
wait(1);
c_setminmax(my);//must follow a wait instruction
vec_fill(my.scale_x,0.100);
vec_set(my.min_x,vector(-10,-10,-25));//rebuild Bounding Box to lift off floor/ground
vec_set(my.max_x,vector(12,12,35));
player = me;
while(1)
{
vec_set(camera.x, player.x);
camera.x = player.x - camera_distance * cos(player.pan); // keep the camera behind the player
camera.y = player.y - camera_distance * sin(player.pan); // at the distance given by camera_distance
camera.z = player.z + camera_height + 0.4 * sin(my.skill46 * 3.6); // and above the player
camera.tilt += mouse_force.y * 4 * time_step; // and can tilt freely
camera.pan = player.pan; // the camera has the same pan angle with the player
c_trace(my.x,vector(my.x,my.y,my.z-4000),IGNORE_ME | USE_BOX);
if(result > 0 )
{
vec_set(VecFrom,my.x);
vec_set(VecTo,my.x);
VecTo.z -= 8* time_step * result; // place player on floor
my.z -= c_trace(VecFrom.x,VecTo.x,IGNORE_ME | USE_BOX)-1;
}
c_move (my, vector(3 * (key_w - key_s) * time_step, 3 * (key_a - key_d) * time_step, 0), nullvector, IGNORE_PASSABLE | GLIDE);
c_rotate(my,vector(mouse_force.x * -6 *time_step,0,0),GLIDE);

if (!key_w && !key_s) // the player isn't moving?
{
anim_percentage += 2 * time_step; // 2 = "stand" animation speed
ent_animate(my, "stand", anim_percentage, ANM_CYCLE);
}
else // the player is moving?
{
ent_animate(my, "walk", anim_percentage, ANM_CYCLE); // play the "walk" animation
anim_percentage += 6 * time_step; // 5 = "walk" animation speed
}
if ((key_w ==1) && (key_r ==1))
{
anim_percentage += 3 * time_step; // 2 = "stand" animation speed
ent_animate(my, "run", anim_percentage, ANM_CYCLE);
c_move (my, vector(5 * (key_w - key_s) * time_step, 0, 0), nullvector, IGNORE_PASSABLE | GLIDE);
}
if ((key_a) && (key_d))
{
anim_percentage += 3 * time_step; // 2 = "stand" animation speed
ent_animate(my, "walk", anim_percentage, ANM_CYCLE);
// c_move (my, vector(0, 6 * (key_a - key_d) * time_step, 0), nullvector, IGNORE_PASSABLE | GLIDE);
}
wait(1);
}
}

////////////////////////////////////////////////////////////////////////////
void main()
{
//VARS...
//SET SCREEN SIZE
var video_screen = 2;//set game screen in windowed mode...1 = full screen
//WINDOW BACKGROUND COLOURS...
vec_set(screen_color,vector(8,8,8));//blue, green, red.Create a background color for fog use and clip debugging
vec_set(sky_color,vector(8,8,8));//create a background color
//WINDOW MODE CONTROL...
video_switch(8,0,2);//1024x768 window mode
video_window(vector(150,200,0),vector(1024,648,0),48,"Example starter main scrript");//set window pos and give it a unique title
//POLYCOLLISION...place before level load
enable_polycollision = 1;//sets OBB (object oriented bounding box)collision detection system
//LEVEL LOAD...
level_load("smallMain.wmb");//load the level
//ENGINE LOAD TIME...
wait(3);//Give time to load all elements. increase as neccessary.
//CLIP RANGE...
camera.clip_far = 5000;//dont show objects beyond this range. Tweak as needed.
camera.clip_near = 0;//Dont clip near objects
//C_MOVE...
move_friction = 0.45;//gliding modifyer, 0 = smooth glide, no friction, 0.25 = default
//DYNAMIC CREATION...
ent_create("cbabe.mdl",vector(0,0,3),players_code);// create the player entity[insert your own names between quote marks "" ""]
ent_createlayer("scifi1b+6.tga", SKY | CUBE | VISIBLE, 0); // create the sky layer[ditto as above]
//FPS...
fps_max = 60;//limit fps (time variable relies on this setting, 100 = default)
//STENCIL SHADOW...
// shadow_stencil = 2;//4 =quick sorting for faster fps on Pro, 2 = fast z sorting.
//SUNLIGHT...
// sun_light = 0;//helps to see light effects, then comment to enrich lights and activate shadow
//FOG...
d3d_fogcolor1.red = 8;
d3d_fogcolor1.green = 8;
d3d_fogcolor1.blue = 8;
fog_color = 1;

fog_color = 5;//default fog values, 1 = white, 2 = blue, 3 = red, 4 = black
camera.fog_start = 0.01 * camera.clip_far; //vary to suit level but uses clip_far range
camera.fog_end = 0.6 * camera.clip_far; //so make it dense near the end

//...
}

//////////////////////////////////////////////////////////////////////////////////
//Test functions
//------------------------------------------------------------------------->>

action im_static()//apply to models with no actions to them
{
my.emask &= ~DYNAMIC;

}
//-------------------------------------------------------------------------<<


No jump and no strafe animation but its in good working order.

Change level_load in 'Main' to your level and your model character in ent_create character as well.


Use the 'manual' Luke, the manual is your friend. 'Self reminder' smile

My WebPage
Re: Simple man game ! [Re: KiwiBoy] #268619
05/30/09 10:05
05/30/09 10:05
Joined: Apr 2009
Posts: 15
Algeria
Y
Y200Corp Offline OP
Banned / Warez
Y200Corp  Offline OP
Banned / Warez
Y

Joined: Apr 2009
Posts: 15
Algeria
i don't think your code is working it say me vec_fill unknown
and i don't know what mean vec_fill
and i would a man like in GTA. but it's not a GTA game it's a school you understand??
anyway thanks for your help


Moderated by  HeelX, Spirit 

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