AUM 46 morrowing player movement

Posted By: cartoon_baboon

AUM 46 morrowing player movement - 03/15/09 18:45

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!!!
Posted By: George

Re: AUM 46 morrowing player movement - 03/16/09 09:29

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.
Posted By: cartoon_baboon

Re: AUM 46 morrowing player movement - 03/16/09 10:43

Thing is, I don't use A7 so lite-C wouldn't help.

I guess I could replace it with c_move though... wink
Posted By: Paleface

Re: AUM 46 morrowing player movement - 03/19/09 05:03

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.
Posted By: George

Re: AUM 46 morrowing player movement - 03/19/09 07:27

That could be the problem. Try to set the polygon flag for those obstacles (if they are models).
Posted By: Paleface

Re: AUM 46 morrowing player movement - 03/20/09 22:15

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?

© 2024 lite-C Forums