Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Time Factor Problem
Topic Started: Sep 26 2007, 12:08 AM (180 Views)
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Ok, so i am using the Time Factor from the fire/Water demo but i does not seen to be working correctly. I am using it to make a partical effect destroy after a certain time. At around 15-20 fps it works ok but when it gets higher it starts destroying too early.

..::Codes Used::..

Time Factor
Code:
 

global.time_factor=(100/max(20,fps));


In Partical Creation Event, On alarm[0] it destroys itself.
Code:
 

alarm[0]=(8*global.time_factor);


How can i fix this?

Thanks
-DS
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
Zip
Member Avatar
Forum Leader
[ *  *  *  *  * ]
First of all, don't use alarms if you are using time factors, because they don't work, so simply create your own timer[...] array:
Code:
 

//create:
for(i=0;i<10;i+=1);
timer[i]=100; //the steps number without "*global.time_factor"

//step:
for(i=0;i<10;i+=1)
{
timer[i]-=global.time_factor;
if timer[i]<=0 && timer[i]>-500 {event_user(0) timer[i]=-1000};
}

and after create some user defined events (in "others events") corresponding to the alarm events. Simple.

In your case you don't need to do all this things, simply set only one timer variable and do this:
Code:
 

timer-=global.time_factor;
if timer<=0 instance_destroy();
Sorry if i've made some errors, I'm not english!
Offline Profile Quote Post Goto Top
 
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Ah ok thanks ^_^
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply