Line Of Sight

Game Editor comments and discussion.

Line Of Sight

Postby jazz_e_bob » Sun Feb 20, 2005 10:56 am

I've written a Line-Of-Sight system that uses a CollisionFree test inside a while loop.

It works well. :)

The problem is I want some actors to be see-through and others solid. I don't want to disable collision state on them either!

My current system is blocked by ANY actor.

I want to use an actor variable like "isSolid".

But...

If I change the x and y of a collision test actor inside a while loop will collision detection for that actor work for a range of positions? Or will it only detect collsion on a Draw Event.

Any feedback appreciated! :)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby jazz_e_bob » Sun Feb 20, 2005 11:06 am

Further testing indicates that collision detection only occurs on a Draw Event.

Hmmm... :(

I need is a version of CollisionFree that ignores collisions where the collide actors "isSolid" flag is not set.
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby jazz_e_bob » Sun Feb 20, 2005 11:16 am

Having a lovely conversation with myself here! :D

Anyhow - I found...

Actor *getactor(long x, long y)
Returns Actor at position (x,y) (in game coordinates) if success, invalid Actor (with cloneindex = -1 and name = "invalid Actor") on error.


Would this return the actor at precisely the given co-ordinates or can the actor simply be touching them somewhere?

More testing! :)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby jazz_e_bob » Sun Feb 20, 2005 11:32 am

Returns actor that collides with that point.

Yay! 8)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby Just4Fun » Sun Feb 20, 2005 10:40 pm

I love the way that you think! Better yet, you share it with the rest of us. :D
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby jazz_e_bob » Sun Feb 20, 2005 11:08 pm

Heh heh.

I sometimes I feel like Game Editor is a game itself! :)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby IPete2 » Mon Feb 21, 2005 4:43 pm

We're not ignoring you Jazz! You posted the first lot within about half an hour - you are too quick! :)

I think that's a great contribution - thanks.

IPete.2
IPete2
 
Posts: 43
Joined: Sun Jan 30, 2005 4:06 pm
Score: 0 Give a positive score

Postby jazz_e_bob » Mon Feb 21, 2005 9:13 pm

I think that's a great contribution - thanks.


Thanks mate.

I am hoping to publish a Line-Of-Sight actor at the end of all this.

( At the moment I am being distracted by spring simulation! Too much fun. )

:)

Image
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron