Page 1 of 1

2 difficult questions

PostPosted: Wed Jun 07, 2006 11:03 am
by Murd-Machine[_]
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?

Re: 2 difficult questions

PostPosted: Sun Jan 27, 2008 6:11 pm
by Thanx
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

Re: 2 difficult questions

PostPosted: Sun Jan 27, 2008 10:16 pm
by Fuzzy
Best to count the objects when you create them, not after. then decrement your count by one as they are destroyed/cleaned up

Re: 2 difficult questions

PostPosted: Mon Feb 04, 2008 6:51 pm
by Thanx
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...