Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (dr_panther, VoroneTZ, AndrewAMD, vicknick, 7th_zorro), 829 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: time_step question [Re: Logitek] #456173
11/13/15 07:54
11/13/15 07:54
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
3.75 * time_step would give you the opposite result... When the FPS drops, time_step becomes bigger, so it'll give you a bigger value in 30 fps than in 60 fps.

Instead, 16 / time_step will give you the frame rate, multiply by 0.x for fractions of a second, for example, if you want to wait 4 frames out of 60 fps, that's 0.067 of a second ((1/60) * 4), now 16 / time_step * 0.067 will give you the frames needed to wait on different fps.

As for the spider example, this line (4-th) is multiplying the pointer to a vector by time_step, and a pointer is usually just a pointer. It shouldn't make any difference, I have no idea why the spider goes faster...


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: time_step question [Re: EpsiloN] #456183
11/13/15 16:03
11/13/15 16:03

M
Malice
Unregistered
Malice
Unregistered
M



^ Because this is old pre-lite-c AUM code it is not a pointer at all or for a fact a vector.

Old A5 code I started with. var could be used as a var[3] and accessed with the (dot)xyz

Click to reveal..
Code:
action deadly_spider

{

    var spider_speed;

    var in_front;

    my.enable_entity = on;

    my.enable_impact = on;

    my.event = hurt_them;

    while(1)

    {

       spider_speed.x = 8 * time; 

       spider_speed.y = 0;

       spider_speed.z = 0;

       spider_speed *= time;

       in_front.x = my.x + 40 * cos(my.pan);

       in_front.y = my.y + 40 * sin(my.pan);

       in_front.z = my.z;

       if (content(in_front) == content_solid)

       {

          my.skill40 = my.pan;

          my.skill41 = 30 + random(90);

          while (my.pan < my.skill40 + my.skill41) // rotate 30..120 degrees

          {

             my.pan += 5 * time;

             wait (1);

          }

       } 


       else // free to move

       {

          ent_cycle("run", my.skill20); // play the "run" animation

          my.skill20 += 10 * time; 

          my.skill20 %= 100; // loop 

          move_mode = ignore_passable; // ignore passable entities

          result = ent_move (spider_speed, nullvector);

          if (result == 0) // got stuck?

          {

             spider_speed.x *= -1; // then reverse the movement direction

             my.skill40 = my.pan;

             my.skill41 = 30 + random(90);

             while (my.pan < my.skill40 + my.skill41) // rotate 30..120 degrees

             {

                 my.pan += 5 * time;

                 ent_cycle("run", my.skill20); // play reversed "run" animation

                 my.skill20 -= 10 * time; 

                 my.skill20 %= 100; // loop 

                 move_mode = ignore_passable; // ignore passable entities

                 ent_move (spider_speed, nullvector);

                 wait (1);

             }

            spider_speed.x *= -1; // restore the initial speed

         }

     }

    wait (1);

 }

 wait (1);

}


http://www.coniserver.net/coni_users/web...2_3_3_3_2_2.htm
AUM 42 !!!!

A5 and older code is in on way a simple direct conversion like A6 and pre-lite-c A7 code.

Funny back then lite-c was insane to me, but now that I look back in my mind, WDL was insane !!

Mal

Last edited by Malice; 11/13/15 16:08.
Re: time_step question [Re: ] #456194
11/13/15 19:52
11/13/15 19:52
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Ok, I just noticed it being declared as var...but why is there a call to .x/y/z on a single var?

I started with A4, I've used the old stuff, but I don't think you can access .y on a single var? grin Interesting...


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: time_step question [Re: EpsiloN] #456204
11/14/15 14:43
11/14/15 14:43
Joined: Nov 2009
Posts: 201
Logitek Offline OP
Member
Logitek  Offline OP
Member

Joined: Nov 2009
Posts: 201
That's right.

Because normally it has to be: var spider_speed[3] = 0,0,0;
or var spider_speed[3];

in C-Script.

So I wondering why this is running :-)

I have tested it in C-Script and it is running without that declaration.

Last edited by Logitek; 11/14/15 14:46.
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