Laser scripting positioning fail
12 posts • Page 1 of 1
Laser scripting positioning fail
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?
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?
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Laser scripting positioning fail
Show us scripts. I think you just make mistake somewhere.
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: Laser scripting positioning fail
- 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
})
}
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Laser scripting positioning fail
I think the velocity is what's causing it. It's moving it before it spawns.
TheWinkits wrote:They both looks of cuking amazing
-

Chronos - [Most Active Member 2010]
- Posts: 4457
- Joined: Mon Aug 31, 2009 6:00 pm
- Location: Californania
Re: Laser scripting positioning fail
Exactly. I don't have this problem in onCollide. And it's hard to use onCollide on a rocket :/
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Laser scripting positioning fail
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 ?
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
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.
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Laser scripting positioning fail
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
-

Chronos - [Most Active Member 2010]
- Posts: 4457
- Joined: Mon Aug 31, 2009 6:00 pm
- Location: Californania
Re: Laser scripting positioning fail
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
Oops sorry for my misunderstanding. But then it wouldn't work on slower simulations :/
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Laser scripting positioning fail
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
I don't know really. I did ound one solution. Making it thicker. So it works now (100hz)
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
12 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests




