Autoposition changeroom problem

Started by Construed, Sat 22/02/2014 07:55:44

Previous topic - Next topic

Construed

Sometimes when using the ChangeRoomAutoPosition(); Feature it places the player on the total opposite side of the room or on a non walkable area.
Anyone know what may be causing this?

Thanks, -Jar
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

mitlark

Reading a little on the help file, here it says why it sometimes moves the character to the other side of the room.
QuoteIf newPosition is not specified or is 0, the character will be placed on the opposite side of the new room, if he is within 10 pixels of a room edge in the current room.
You should read the help file, as there is much more details about why it does it.

As for the character being on a non-walkable area, I think it's normal too. If I'm not mistaken, something I can be because I've not used this engine enough, ChangeRoomAutoPosition() preserves either the X or Y position, depending on the edge the character was closer to. So, if your previous room walkable area doesn't matches the new room one, like...

Your player will be stuck, sometimes.

There is a function that may do the trick fixing this. Try using player.PlaceOnWalkableArea()
SPIN SPIN! SPIN SPIN!

Construed

Thanks, But what is newPosition and how do I know whether it is 0 ?
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Construed

I guess you might not know. I thank you greatly for taking the time to give me such a good and detailed answer though my friend!
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Khris

Quote from: manualAltenatively, you can specify the position where he will get placed in the new room. newPosition can be 1000 for the left edge, 2000 for the right edge, 3000 for the bottom edge and 4000 for the top edge. Then, add on the offset within that edge where you want to place the character, in normal room co-ordinates.

RTFM!

Construed

Honestly the manual is a horrible piece of crap that you can't find anything in.
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Khris

Are you saying you can't find a command you are already using in the manual?

Mandle

Quote from: Khris on Sun 23/02/2014 03:58:20
Are you saying you can't find a command you are already using in the manual?

LOL! As a teacher I hold comebacks for which there is no possible defense in the highest esteem!

**Adds to collection**

Construed

No, the manual is terribly organized, has absolutely no "Term" searching capabilities and most of the examples in it do not even apply to the most common uses of them.

Don't get me wrong, I love both you and ags, but the manual is total crap.
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Scavenger

It has term searching capabilities, they're under Index (where you can type in the function you want) and Search (which searches pages for their contents). And if you press f1 while the text cursor is over a function in the script editor, it takes you directly to that function's entry.

I'm not sure how it can be improved, except for more script examples, which would bloat out the manual a bit.

Construed

What I mean by search term capabilities is the text within the documentation.
It seems to find the topic names fine but it wont search within the topics to find one or more keywords that would help you to find desired actions or functions.
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Construed

You know, there's no need for me to be an A-hole here, I made a promise to myself to never lie again and I guess I kind of unconsciously did here.

Yes, the help file is a little bit of a pain, but that's not what this is all about.

I've been severely depressed to the point that any even slightly advanced task has been hard for me to focus on, including searching through the help file.
I guess I was just trying to use the beginner tech forum as a crutch hoping that I would get spoon fed the information I needed.

I'm sorry for the hassle and I'm sorry for cutting down the highly complex help file I know a lot of people worked very hard on.

I don't know whats wrong with myself anymore these days.
I guess I'm losing my mind.
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

mitlark

I think we tried to start remarking the manual descriptions as a starting point, so if there was something you didn't understand from the manual, you were able to ask with that in hand. Don't feel guilty of asking, as I think forums are meant for that.

cEgo: Oh yeah, I'm such a nice guy.
cSelf: Shuddup Ego!!!
SPIN SPIN! SPIN SPIN!

Gilbert

I'm locking this, since the problem seems to already be solved, and to prevent it from drifting too much off-topic and the OP being attacked by unfriendly members.

But Construed, while this is the Beginners' forum and I'm usually quite lenient towards people asking questions here, this is not an excuse for not reading the manual at all by blaming it is "crap", especially for one who has been here for some time and not really a newbie. The answers in this topic are all in the manual, and even if it's not or you don't really understand what's written in it, you should at least try checking it before posting here. This just acts as a magnet for potential attacks.

SMF spam blocked by CleanTalk