Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,007 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Wy does "time_factory" don`t work? [Re: Blackchuck] #290174
09/17/09 16:17
09/17/09 16:17
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
you have to write it so:
Code:
action blade()
{
while (!player) {wait (1);} 
while(1)
{
if (vec_dist (player.x, my.x) < 1000) 
{
time_factor = 0.1; 
}
else time_factor = 1;
wait (1); 
}
}



Please laugh!

Re: Wy does "time_factory" don`t work? [Re: Blackchuck] #290176
09/17/09 16:19
09/17/09 16:19
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Thats because you do not reset it to a normal value of 1
Try this:
Code:
action blade()
{
  while (!player) { wait (1); }
  while(me)
  {
    if(vec_dist(player.x,my.x) < 1000) // play with 1000
    {
      time_factor = 0.1;
    }
    else
    {
      time_factor = 1; // reset to normal value if player out of range
    }

    wait(1);
  }
}



Now a problem may arise if you have more blades in your level that are that far away from each other that, if the player is in range for blade A he is out of range of blade B, thus blade B and blade A will "fight" around the time_factor and if you are lucky the time goes to slow motion, if not then its always constantly "normal".

If you want to control more blades with this code which can be far way from each other, then you need a different approach.
Just say a word and someone will help you.

edit:
Damn I was too slow wink

Last edited by Xarthor; 09/17/09 16:19.
Re: Wy does "time_factory" don`t work? [Re: Xarthor] #290309
09/18/09 11:25
09/18/09 11:25
Joined: Jul 2009
Posts: 150
B
Blackchuck Offline OP
Member
Blackchuck  Offline OP
Member
B

Joined: Jul 2009
Posts: 150
hehe, no problem Xarthor and thanks Rei_Ayanami, it works now how I whant it.

But were did you lerned to script so muth detalis?


I have know Gamestudio/A7 Commercial Edition 7.84
Re: Wy does "time_factory" don`t work? [Re: Blackchuck] #290337
09/18/09 14:38
09/18/09 14:38
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Mh, i didnīt learned it, itīs just logical^^ - i think about a problem, maybe i make a picture of what - than i just program grin!

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