Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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 (AbrahamR), 717 guests, and 4 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
AUM 46 morrowing player movement #256277
03/15/09 18:45
03/15/09 18:45
Joined: Feb 2006
Posts: 616
Netherlands
cartoon_baboon Offline OP
User
cartoon_baboon  Offline OP
User

Joined: Feb 2006
Posts: 616
Netherlands
Hi,
I've been using the player movement code from AUM 46. However it doesn't really have any proper collision included. When colliding with level blocks it can move through them while slowly moving upwards. Would it be possible to explain what I need to change to get it to stop movement when hitting a wall?

Here is the code:

Code:
action player1
{
    player = my;
    my.x = -2700;
    my.y = -2500;
    my.z = -2000;
    my.pan = 160;
    my.transparent = on;
    my.alpha = 100;
    my.skill40 = camera_distance;
    my.skill41 = camera_height;
    camera_mode = 3;

    while (1)
    {
       player.pan -= 10 * mouse_force.x * time - 1.5 * (key_a - key_d);
       camera.x = player.x - camera_distance * cos(player.pan);
       camera.y = player.y - camera_distance * sin(player.pan);
       camera.z = player.z + camera_height + 0.8 * sin(my.skill46 * 3.6);
       camera.pan = player.pan;
       camera.tilt += 7 * mouse_force.y * time;
       camera_distance = min (max (camera_distance, 5), 500);
       if (key_w + key_s > 0)
       {
          ent_cycle("walk", my.skill46);
          my.skill46 += 10 * (1 + key_shift * 0.5) * time;
          my.skill46 %= 100;
       }
       else
       {
          ent_cycle("stand", my.skill48);
          my.skill48 += 2 * time;
          my.skill48 %= 100;
       }

       if (camera_mode == 3)
       {
          avoid_obstacles();
       }
       vec_set (temp, my.x);
       temp.z -= 10000;
       trace_mode = ignore_me + ignore_passable + use_box;
       temp.z = -trace (my.x, temp);
       temp.x = 10 * (key_w - key_s) * (1 + 1 * key_shift) * time;
       temp.y = 0;
       my.skill47 += ent_move (temp, nullvector);
       if (my.skill47 > 50)
       {
          snd_play(step_wav, 30, 0);
          my.skill47 = 0;
       }
       wait (1);
    }
}




Thanks a lot!!!

Re: AUM 46 morrowing player movement [Re: cartoon_baboon] #256339
03/16/09 09:29
03/16/09 09:29
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
ent_move is an old instruction; it has been replaced with c_move. Check out Aum82's faq; I have converted the code to lite-C there.

Re: AUM 46 morrowing player movement [Re: George] #256351
03/16/09 10:43
03/16/09 10:43
Joined: Feb 2006
Posts: 616
Netherlands
cartoon_baboon Offline OP
User
cartoon_baboon  Offline OP
User

Joined: Feb 2006
Posts: 616
Netherlands
Thing is, I don't use A7 so lite-C wouldn't help.

I guess I could replace it with c_move though... wink

Re: AUM 46 morrowing player movement [Re: George] #256797
03/19/09 05:03
03/19/09 05:03
Joined: Feb 2009
Posts: 4
Germany, Hamburg
Paleface Offline
Guest
Paleface  Offline
Guest

Joined: Feb 2009
Posts: 4
Germany, Hamburg
Hmm Using the Lite-C Code from the Aum82's faq sometimes lifts my Player Entity on the Z-Axis when standing near an obstacle...
Any Idea how to avoid this? Is it because I checked the Player's BBox Propertie flag? But without the BBox Flag my Player is placed wrongly onto the ground.


This line intentionally left blank
Re: AUM 46 morrowing player movement [Re: Paleface] #256811
03/19/09 07:27
03/19/09 07:27
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
That could be the problem. Try to set the polygon flag for those obstacles (if they are models).

Re: AUM 46 morrowing player movement [Re: George] #257155
03/20/09 22:15
03/20/09 22:15
Joined: Feb 2009
Posts: 4
Germany, Hamburg
Paleface Offline
Guest
Paleface  Offline
Guest

Joined: Feb 2009
Posts: 4
Germany, Hamburg
Yes, that seems to solve some of my problems - thanks alot...

....but I guess I have to take a deeper deeper deeper look into A7 before starting to realize my Ideas as my Program-Setup up to now seems not to run quite correct with .hmp files and has other huge disadvantages ...
Any chance on a new RPG Workshop Series within AUM?


Last edited by Paleface; 03/22/09 00:14.

This line intentionally left blank

Moderated by  George 

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