ideas please
7 posts • Page 1 of 1
ideas please
hello again
would be really nice if someone had any ideas to make my code more precise.
it is a code for a battery that can be saved as phunlet without any problems (but needs a special laser to work right).
nothing wrong about everything but the discharge timer.code:
as you can see , i use the sim.time and the integer sim.time +0.97 , every second the battery discharges 1. now whats the problem : low cpu notebook : 0.97 is right . high cpu pc : 0.99 is right ,at 0.97 the step is much more than 1.the timer depends on the fps .
no problem ,if you really want to change the value everytime you add another geom and the frames go low...
i don't expect another code ,i know them. if it were possible ,i would like my code corrected.
any ideas?
thanks.
would be really nice if someone had any ideas to make my code more precise.
it is a code for a battery that can be saved as phunlet without any problems (but needs a special laser to work right).
nothing wrong about everything but the discharge timer.code:
- Code: Select all
(e)=>{
textcolor = [sim.time, textcolor(1), textcolor(2), textcolor(3)];
sim.time > (math.toint(textcolor(0)) + 0.97) ? {textcolor = [textcolor(0), (textcolor(1) - 1), textcolor(2), textcolor(3)]} : {textcolor = [textcolor(0), textcolor(1), textcolor(2), textcolor(3)]};
textcolor(1) <= 0 ? {textcolor = [textcolor(0), 0, textcolor(2), textcolor(3)]} : {textcolor = [textcolor(0), textcolor(1), textcolor(2), textcolor(3)]}
}
as you can see , i use the sim.time and the integer sim.time +0.97 , every second the battery discharges 1. now whats the problem : low cpu notebook : 0.97 is right . high cpu pc : 0.99 is right ,at 0.97 the step is much more than 1.the timer depends on the fps .
no problem ,if you really want to change the value everytime you add another geom and the frames go low...
i don't expect another code ,i know them. if it were possible ,i would like my code corrected.
any ideas?
thanks.
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
- hiltropper
- Posts: 85
- Joined: Mon Dec 20, 2010 12:02 pm
- Location: Germany
Re: ideas please
it's really hard to understand what's the problem and what you need...
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: ideas please
I have no idea what you are talking about... but I can guess 
So you have sim.time + 0.97, so that on your PC, it discharges 1 every second. The problem is that the timer depends on the fps. If I'm right... you can set the system frame rate from inside algodoo
(devious and possibly evil? Yes. Will I download a scene that does that? Nope.)
So what you need to do is adjust the integer added to sim.time depending on the frame rate... Kilinich (or gradyfitz)do you have any ideas how to read the frame-rate?
Other than that, I suggest that you make it automatically increase the sim.frequency when you open the scene.
So you have sim.time + 0.97, so that on your PC, it discharges 1 every second. The problem is that the timer depends on the fps. If I'm right... you can set the system frame rate from inside algodoo
(devious and possibly evil? Yes. Will I download a scene that does that? Nope.)
So what you need to do is adjust the integer added to sim.time depending on the frame rate... Kilinich (or gradyfitz)do you have any ideas how to read the frame-rate?
Other than that, I suggest that you make it automatically increase the sim.frequency when you open the scene.
-

TC42 - Posts: 984
- Joined: Sun Jan 09, 2011 1:53 pm
- Location: $ sudo apt get-install sandwich_
Re: ideas please
tc42 you are right.
sorry for that cryptic post i guess i had no time when i did it.
is that possible if my cpu is to weak to do that? i mean this actually is the problem ,the script is the same but the faster the cpu the faster it discharges...
sorry for that cryptic post i guess i had no time when i did it.
Other than that, I suggest that you make it automatically increase the sim.frequency when you open the scene.
is that possible if my cpu is to weak to do that? i mean this actually is the problem ,the script is the same but the faster the cpu the faster it discharges...
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
- hiltropper
- Posts: 85
- Joined: Mon Dec 20, 2010 12:02 pm
- Location: Germany
Re: ideas please
Yes, increasing the sim.frequency will cause more lag, but results in a more accurate simulation. If you're using laser, then I suggest that you discharge the batteries mechanicle-scriptedly (spelling??) using a box/circle on a hinge that collides with something else (which has the discharge code in the oncollide menu) when the hinge is running. This way, the discharge rate will be more stable on PCs of varying power.
-

TC42 - Posts: 984
- Joined: Sun Jan 09, 2011 1:53 pm
- Location: $ sudo apt get-install sandwich_
Re: ideas please
Presonally, I (or davidz40 for that matter) would use an alternating collider. This is the code I would probably use:
The coded geom should be a circle, hinged between two boxes. It should overlap both boxes. More overlap = more reliability, but more unwanted vibration.
- Code: Select all
collideWater = !collideWater
The coded geom should be a circle, hinged between two boxes. It should overlap both boxes. More overlap = more reliability, but more unwanted vibration.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: ideas please
thanks so far if i get new results i will report it here.
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
- hiltropper
- Posts: 85
- Joined: Mon Dec 20, 2010 12:02 pm
- Location: Germany
7 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest




