1 registered members (Ayumi),
662
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
Senior Expert
|
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: /////////////////////////////// #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: JazzDude]
#316134
03/21/10 18:26
03/21/10 18:26
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
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: #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
OP
User
|
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
gotobrain
Guest
|
Guest
Joined: Mar 2010
Posts: 3
|
Post deleted.
Last edited by MichaelGale; 03/30/10 08:37. Reason: Spam
|
|
|
|