2 difficult questions

You must understand the Game Editor concepts, before post here.

2 difficult questions

Postby Murd-Machine[_] » Wed Jun 07, 2006 11:03 am

Hello.
How can I make this:
1. Take 2 points and save they coordinates in variables,
and check using this variable if the line between 2 points cross with the object (e.g. "obj1")? (so that 1 object that moves using mouse can't cross through another). And save this event in variable.
And this:
2. I have many rooms in the game. They are all 240x320. How can I count number of cirtain objects in each room?
User avatar
Murd-Machine[_]
 
Posts: 72
Joined: Fri Nov 04, 2005 7:04 pm
Location: Moscow-city
Score: 1 Give a positive score

Re: 2 difficult questions

Postby Thanx » Sun Jan 27, 2008 6:11 pm

I'm working on the answer to question 2, but meanwhile, I'll answer your second question. :)
But this answer only works if the rooms have all the same number of actors. In that case, you'll find a built in function (look through the script refference if so, I've forgot its name) that counts the number of actors in the whole .ged file. Subtract the number of actors (if any) that are not in any of the rooms, then, asuming you know the number of rooms, divide the remaining actor count with the number of rooms. I'll answer your 1st question soon, cause I have ideas, :idea: just need to test them. :D
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: 2 difficult questions

Postby Fuzzy » Sun Jan 27, 2008 10:16 pm

Best to count the objects when you create them, not after. then decrement your count by one as they are destroyed/cleaned up
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: 2 difficult questions

Postby Thanx » Mon Feb 04, 2008 6:51 pm

Hmm It's a tough question. If you don't want it to go to a region in the game, then you could use code, something like this:
if(x< somenumber && x> somenumber)
{
move actor somewhere...
}
do something similar on the y axis, but I don't know of anything better...
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest