Laser scripting positioning fail

Suggest changes and improvements to Algodoo.

Laser scripting positioning fail

Postby Rideg » Thu Oct 07, 2010 10:01 pm

If I would spawn a circle with the velocity of 50 * e.normal using onCollide, it would spawn at e.pos.

If I would do the same thing with onHitByLaser, it would spawn a frame after the "spawning". Basically if you spawn at position [0.0, 0.0] with [0.0, 100.0] as a velocity, it would spawn at [0.0, 2.0] perhaps. Just an example.

Can't this get fixed? It's hard using gears in a speed rocket I'm making and the lasers cause the spawn engine to spawn circles outside the rocket.

What do you think?
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Laser scripting positioning fail

Postby Kilinich » Fri Oct 08, 2010 7:42 am

Show us scripts. I think you just make mistake somewhere.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Laser scripting positioning fail

Postby Rideg » Fri Oct 08, 2010 8:36 pm

Code: Select all
(e)=>{
    scene.addCircle({
        onCollide := (e)=>{e.this.density = 0};
        radius := 0.15;
        density := 0.5;
        collideSet := 64;
        heteroCollide := true;
        color := [0.0, 0.0, 0.0, 1.0];
        vel := 25 * e.normal;
        pos := e.pos
    })
}
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Laser scripting positioning fail

Postby Chronos » Fri Oct 08, 2010 8:49 pm

I think the velocity is what's causing it. It's moving it before it spawns.
TheWinkits wrote:They both looks of cuking amazing
User avatar
Chronos
[Most Active Member 2010]
 
Posts: 4457
Joined: Mon Aug 31, 2009 6:00 pm
Location: Californania

Re: Laser scripting positioning fail

Postby Rideg » Fri Oct 08, 2010 8:55 pm

Exactly. I don't have this problem in onCollide. And it's hard to use onCollide on a rocket :/
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Laser scripting positioning fail

Postby electronicboy » Sat Oct 09, 2010 12:08 am

it is one of those things that will be fixed if and when the thyme system is rewrote which may be a while as saying it big is a MASSIVE understatement.

Either way, can't you just use an offset by using e.pos + 0.2 ?
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: Laser scripting positioning fail

Postby Rideg » Sat Oct 09, 2010 2:42 am

electronicboy wrote:it is one of those things that will be fixed if and when the thyme system is rewrote which may be a while as saying it big is a MASSIVE understatement.

Either way, can't you just use an offset by using e.pos + 0.2 ?

What? Read the top post. I'm having trouble because it's spawned there. It means i does NOT want it to be spawned at another position.
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Laser scripting positioning fail

Postby Chronos » Sat Oct 09, 2010 3:12 am

I think he was saying why not offset it by -2 so it spawns at 0, 0?
TheWinkits wrote:They both looks of cuking amazing
User avatar
Chronos
[Most Active Member 2010]
 
Posts: 4457
Joined: Mon Aug 31, 2009 6:00 pm
Location: Californania

Re: Laser scripting positioning fail

Postby electronicboy » Sat Oct 09, 2010 11:59 am

i was just using that as an example
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: Laser scripting positioning fail

Postby Rideg » Sat Oct 09, 2010 1:56 pm

Oops sorry for my misunderstanding. But then it wouldn't work on slower simulations :/
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Laser scripting positioning fail

Postby electronicboy » Sat Oct 09, 2010 4:28 pm

Is there anything that could be place into a formula. for example, for every 50 m/s the object travels, it is offset by 1. If so, you could use the k-probe to get speed info and use a formula to worl out how far the offset should be.
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: Laser scripting positioning fail

Postby Rideg » Sun Oct 10, 2010 12:01 am

I don't know really. I did ound one solution. Making it thicker. So it works now (100hz)
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 6 guests