Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 662 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: stuck player [Re: Blink] #315781
03/18/10 23:48
03/18/10 23:48
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Try to load an empty level and test the script, it works fine for me:

Quote:

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

function player_action() {
VECTOR temp;
var walk_percentage = 0, stand_percentage = 0, movement_speed = 10;
player = my;
c_setminmax(me);
vec_set(my.min_x,vector(-15,-15,-50));
vec_set(my.max_x,vector(15,15,50));
while (1)
{
player.pan -= 5 * mouse_force.x * time_step;
if(key_pressed(281)) //mouse right
{
ent_animate(my, "walk", walk_percentage, ANM_CYCLE);
walk_percentage += 7 * time_step;
walk_percentage %= 100;

temp.x = movement_speed * (mouse_right)*0.6 * time_step;
temp.y = 0;
temp.z= 0;
c_move (my, temp, nullvector, IGNORE_PASSABLE | GLIDE );
}
else
{
ent_animate(my, "stand", stand_percentage, ANM_CYCLE);
stand_percentage += 5 * time_step;
}
wait(1);
}
}


function main() {
fps_max = 60;
video_mode = 11;

level_load(NULL);
wait(1);

ent_create("player.mdl",vector(330,0,0),player_action);
}



"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: stuck player [Re: Blink] #316044
03/20/10 23:18
03/20/10 23:18
Joined: Jan 2010
Posts: 16
KlongKiller Offline
Newbie
KlongKiller  Offline
Newbie

Joined: Jan 2010
Posts: 16
I have also tried using c_move and c_rotate and for me they get stuck often. I played around with them for a couple weeks and decided to make my own using ray tracing, I was suprised to find very satisfying results with my own version... I think the reason is that I completely understand how mine works because I coded it, I am also using a it on a level with a lot of crazy geometry(A model with the polygon flag set) and it still works smoothly instead of a level made in wed(mostly 90degree angled blocks) I recently finished the gravity code and have moved forward with my project. If you are interested on how I did It I suppose I could make time

Re: stuck player [Re: KlongKiller] #316110
03/21/10 14:58
03/21/10 14:58
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
I solved the problem. I was reworking an old game made with A5 and some of the furniture in the room was prefabs. I replaced all of those prefabs with models with polygon set on. Now all's well. Since there was no problem with A5 I can only presume that levels made in A5 WED and A6 WED aren't compatible for collision purposes. Sounds like a dumb guess, LOL.

Now...if someone could give me a workaround to keep the mouse trapped in a window I would be done with this beast.

Re: stuck player [Re: JazzDude] #316134
03/21/10 18:26
03/21/10 18:26
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I think it's only possible in lite-c (but not 100% sure). There you have access to Windows-functions:

Originally Posted By: DJBMASTER
#include <acknex.h>
#include <windows.h>

void main()
{
mouse_pointer = 0;
RECT* rect;
GetWindowRect(hWnd,rect);
ClipCursor(rect);
}



"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: stuck player [Re: Superku] #316239
03/22/10 16:51
03/22/10 16:51
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
I wanted to include a window mode for widescreen monitors to preserve the aspect ratio. However, in the shooting action the mouse would get outside of the window and minimize the game window. My workaround is to use this snippet by Mercuryus which keeps the aspect ration of the game at 4/3.

I just got a widescreen monitor a couple days ago and the code works very well.

Re: stuck player [Re: Blink] #317216
03/30/10 00:43
03/30/10 00:43
Joined: Mar 2010
Posts: 3
G
gotobrain Offline
Guest
gotobrain  Offline
Guest
G

Joined: Mar 2010
Posts: 3
Post deleted.

Last edited by MichaelGale; 03/30/10 08:37. Reason: Spam
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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