Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (henrybane), 1,246 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: KH Movement - Old and still on wheels [Re: DLively] #268531
05/29/09 20:37
05/29/09 20:37
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
action ent_player(){

player = my;
//wait(1);
//c_setminmax(my);
//c_updatehull(my,1);
my.POLYGON = on;
enable_polycollision = 2;
my.narrow = on;
while(1)
{wait(1);
camra();
gravity();

ent_cycle("stand", my.skill4);
my.skill4 += 5 * time; my.skill4 %= 100;

if(key_w){
ent_cycle("run", my.skill4);
my.skill4 += my.skill1 * time;
my.skill1 += 0.5;
}
else{
my.skill1 = 0;
}
my.skill1 = clamp(my.skill1,-4,4);
c_move(me,my.skill1,nullvector,glide);


vec_set(temp, my.x);
temp.z = -4000;
trace_mode = use_box + ignore_passable + glide; //glide \ignore_me
-trace(my.x, temp);
if(key_space && my.jump==0&&result<5){//JUMP
my.skill3 += jump_height;
my.jump = 1;
while(my.jump == 1){wait(1);

camra();

ent_cycle("jump", my.skill7);

if(my.skill7 < 100){
my.skill7 += 20; //20
}else{gravity();}

vec_set(temp, my.x);
temp.z = -4000;
trace_mode = use_box + ignore_me + ignore_passable + glide; // glide
-trace(my.x, temp);
if((my.skill7 >= 90) && (result < 7)){my.jump=0;}

c_move(me,my.skill1,nullvector, use_box + ignore_me + glide + ignore_sprites); //use_box \ -ignore_models \ignore_me

vec_set(checkuptemp,vector(0,0,35));
vec_rotate(checkuptemp,my.pan);
vec_add(checkuptemp,my.x);
result = trace(my.x,checkuptemp);
IF (result != 0) {gravity();my.skill3 = -2;}

}
my.skill7 = 0;

}

}

This is a bit a mission impossible, but i'm having some problems with models when i jump to them. The player enter a bit into the model and cannot move instead of walking on it.
I tryed to mess with traces, but everything stood almost the same.
If anyone can please help me.
Thanks

Re: KH Movement - Old and still on wheels [Re: Mythran] #268556
05/29/09 23:11
05/29/09 23:11
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Do you remember testDummy's advices?
They were the right ones.
Have a close look into the manual, even experienced programmers have to have a look into it from time to time, to remember the right use of the engine's functions.

As testDummy said - I don't know, why he removed his post - the flag 'my.POLYGON = on;' has to be set only for the NOT moving entities! Not for the player itself or any other moving entity!

From the online manual:(you make the most effective use of it, when you push CTRL + F(at least in firefox and netscape) and then search for a certain index)
http://www.conitec.net/beta/collision.htm

Quote:
POLYGON Use this for sprites or models that should act as polygonal obstacle. Don't use it for moving actors!


Another thing:
When you push F11 twice, you'll see the bounding box of the entities. Set and reset c_setminmax to see how it changes.
For moving it should be a bit above the ground, you can achieve this with the following combination:
A) set the bounding box slightly _above_ the ground, and
B) reduce the bottom part of the bounding box a bit with min_z = 0; for instance

In the manual it is the term c_move, where you find an example of a move code:

http://www.conitec.net/beta/ac_move.htm

Quote:
// determine the ground distance by a downwards trace
var dist_down;
if (c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE | USE_BOX) > 0)
dist_down = my.z + vFeet.z - target.z; // get distance between player's feet and the ground
else
dist_down = 0;


Completely other possible reason for your problems:
How big is your player entity, IMO a size of about 40 quants is a good size for such entities - but it is possible that others have different experiences.

Re: KH Movement - Old and still on wheels [Re: Pappenheimer] #268766
05/31/09 02:12
05/31/09 02:12
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
I tryed that, and i dont know why it doesnt work.
The bounding box is better without c_setminmax;
I kept trying changing the values in c_trace, like ignore_me + models etc...
but nothing seems to work...
If anyone please can tell me by looking in the script why i canīt walk or stand
in models i would really apreciate alot.
Thanks

Re: KH Movement - Old and still on wheels [Re: Mythran] #268793
05/31/09 06:52
05/31/09 06:52
Joined: Apr 2009
Posts: 298
Southern Oceans
KiwiBoy Offline
Member
KiwiBoy  Offline
Member

Joined: Apr 2009
Posts: 298
Southern Oceans
Try c_trace instead of trace mode.
Follow above advice.
remove my.polgon = on;
remove enable_polycollision = 2; that should be in main as far as I know (which isnt a lot smile )

Make an action for your model,
action models()
{
set(my, POLYGON);
}
...and you should be good to go.


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

My WebPage
Re: KH Movement - Old and still on wheels [Re: Mythran] #268811
05/31/09 09:24
05/31/09 09:24
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Originally Posted By: Mythran
I kept trying changing the values in c_trace, like ignore_me + models etc...

Kiwi Boy mentioned it, but I want to assure that you understand:

'trace' (as used in you code) is NOT the same as 'c_trace'. You have to change that. 'trace' is old syntax and it is unable to handle models as complex obstacles with polygon = on!
And, changing 'trace' to 'c_trace' means more than changing the word, look into the manual for this.

Re: KH Movement - Old and still on wheels [Re: KiwiBoy] #268833
05/31/09 11:16
05/31/09 11:16
Joined: Feb 2008
Posts: 36
Pesaro, Italy, Europe
MaximilianPs Offline
Newbie
MaximilianPs  Offline
Newbie

Joined: Feb 2008
Posts: 36
Pesaro, Italy, Europe
about KH Movement, i've seen that him use temp vector, but i can't find the temp definition anywayre O_o' where is it ? and which value is assigned to the temp at the start of the code ? player position, or what ?

/me really confused.

Re: KH Movement - Old and still on wheels [Re: MaximilianPs] #268836
05/31/09 11:50
05/31/09 11:50
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
In C-Script 'temp' is already a predefined vector, in Lite-C you have to define it. KHMovement was coded in C-Script.

Re: KH Movement - Old and still on wheels [Re: Pappenheimer] #268838
05/31/09 12:08
05/31/09 12:08
Joined: Feb 2008
Posts: 36
Pesaro, Italy, Europe
MaximilianPs Offline
Newbie
MaximilianPs  Offline
Newbie

Joined: Feb 2008
Posts: 36
Pesaro, Italy, Europe
thnx for the info smile
maybe, is time that someone convert KHMovement in Lite-C ? ^^

Re: KH Movement - Old and still on wheels [Re: MaximilianPs] #268878
05/31/09 16:10
05/31/09 16:10
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Originally Posted By: MaximilianPs
thnx for the info smile
maybe, is time that someone convert KHMovement in Lite-C ? ^^
It's already converted smile.
http://www.opserver.de/wiki/index.php/Original_Kingdom_Hearts_Movement

Re: KH Movement - Old and still on wheels [Re: Cowabanga] #268945
05/31/09 22:03
05/31/09 22:03
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
var video_mode = 8;
var video_depth = 32;
var video_screen = 1;
var fps_max = 100;

var camera_distance = 200;
var camera_pan;
var camera_tilt;
var camera_move_to[3];


var jump = 0;
var jump_height = 8;
var checkuptemp[3];

var dist_down;


define jump = skill21;


entity* player;

function main()
{
level_load("level.wmb");
enable_polycollision = 2;
}

function cam()
{
camera_pan -= mouse_force.x * 10 * time;
camera_tilt += mouse_force.y * 6 * time;
camera_tilt = clamp(camera_tilt,-45,20);
my.pan = camera_pan;
camera.pan = camera_pan;
temp = fcos(camera_tilt,-camera_distance);
vec_set(camera_move_to.x,vector(my.x + fcos(camera.pan,temp),my.y + fsin(camera.pan,temp),my.z + 20 + fsin(camera_tilt,-camera_distance)));
temp = min(1,0.5 * time);
camera.x += temp*(camera_move_to.x - camera.x);
camera.y += temp*(camera_move_to.y - camera.y);
camera.z += temp*(camera_move_to.z - camera.z);
vec_diff(temp.x,camera.x,my.x);
vec_normalize(temp.x,16);
vec_add(temp.x,camera.x);

trace_mode = ignore_me + ignore_passable + glide;
IF (trace(my.x,temp.x) > 0)
{
vec_diff(temp.x,my.x,target.x);
vec_normalize(temp.x,16);
vec_set(camera.x,target.x);
vec_add(camera.x,temp.x);
}

vec_diff(temp.x,my.x,camera.x);
vec_to_angle(camera.pan,temp.x);


}

function gravity()
{
vec_set(temp, my.x);
temp.z = -5000;
trace_mode = ignore_me + use_box + ignore_sprites + glide;
-trace(my.x, temp);

if(result > 25){my.skill3 -= 2 * time;}
else
{
my.skill3 = -trace(my.x, temp)* 0.5;
}
}

action ent_player()
{
player = my;
wait(1);
//c_setminmax(my);
my.narrow = on;
while(1)
{
wait(1);
cam();
gravity();
ent_cycle("stand", my.skill4);
my.skill4 += 5 * time; my.skill4 %= 100;

if(key_w)
{
ent_cycle("run", my.skill4);
my.skill4 += my.skill1 * time;
my.skill1 += 0.5;
}
else
{
my.skill1 = 0;
}

my.skill1 = clamp(my.skill1,-4,4);
c_move(me,my.skill1,nullvector,IGNORE_ME|USE_BOX|GLIDE);

vec_set(temp, my.x);
temp.z = -5000;
c_trace (my.x,temp, USE_BOX|IGNORE_ME|IGNORE_PASSABLE|GLIDE);
if(key_space && my.jump==0&&result<5)
{
my.skill3 += jump_height;
my.jump = 1;
while(my.jump == 1)
{
wait(1);
Cam();
ent_cycle("jump", my.skill7);
if(my.skill7 < 100)
{
my.skill7 += 20;
}
else
{
gravity();
}

vec_set(temp, my.x);
temp.z = -5000;
c_trace (my.x,temp, USE_BOX|IGNORE_ME|IGNORE_MODELS|IGNORE_PASSABLE|GLIDE);
if((my.skill7 >= 90) && (result < 7))
{
my.jump=0;
}
c_move(me,my.skill1,nullvector,USE_BOX|IGNORE_ME|IGNORE_PASSABLE|IGNORE_SPRITES|GLIDE);
vec_set(checkuptemp,vector(0,0,35));
vec_rotate(checkuptemp,my.pan);
vec_add(checkuptemp,my.x);
result = trace(my.x,checkuptemp);
IF (result != 0)
{
gravity();my.skill3 = -2;
}
}
my.skill7 = 0;
}
}
}

action Models_Poly()
{
my.POLYGON = on;
}

Ok here's the whole code. I change to C_trace what i could/managed. But i got worst, changed some values in IGNORE_ME|IGNORE_MODELS and it got worst.
If anyone can please fix this problem... I spent the day repeating the same thing and found no way to solve the problem of the entity interacting with models. All my guesses are that it really has to do with c_trace and c_move and apply the Ignore_me|glide, etc...
Thanks for all the help until now.

Page 2 of 3 1 2 3

Moderated by  adoado, checkbutton, mk_1, Perro 

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