My RTS movement doesn't work at some layouts

For questions about using Classic.

Post » Wed Oct 28, 2009 3:29 pm

Basically, its a start of my rpg. The problem I'm pointing at is that if you put the "Object Manager" layout as the first layout to be loaded, the RTS movement (Hero Movement Event Sheet) thing works fine, but if you just leave it as it is, (Queenies Village as 5th layout), the Hero Movement Event Sheet doesnt seem to work. Maybe I'm missing something.

Totally confused lol.
My .CAP: http://www.mediafire.com/download.php?blyfmjuwjxy

Again heyyylllpppp!!!
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Wed Oct 28, 2009 4:19 pm

You're already trying to take on a little bigger project it seems. :o

Anyway, there's some stuff not quite right. Like in your Hero Movement event sheet you keep spawning player characters all the time. This should only be done at Start of layout. Also you don't need to set everything to global. Like the player and all. Just use Globals (global values) for the stuff that need to be carried over to the next layout, like gender, hp, xp and such.

And the worst: get rid of all the different MouseKeyboard objects. Use one and simply copy it to all layouts it's needed. And don't keep spawning additional objects in the GeneralKeys event sheet. Why would you do that? :shock:
The way you have it with different events using different control objects and what not, it's all becoming pretty messy.

Even with only the change in the Hero movement sheet I mentioned before, your layouts work as intended when run separately. The whole game still messes up. Probably due to the whole MouseKeyboard object mess I assume. I'd really really fix that issue first! :)
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Wed Oct 28, 2009 4:32 pm

Hmm so you're saying the Hero Movement Event works alright, but the only prob would be found in the mousekeyboard? The only globals I think I have are the objects found in the Object Manager layout.

Still, I'm a bit confused.
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Wed Oct 28, 2009 6:46 pm

[quote="TheJanMan":2j7vzng7]The only globals I think I have are the objects found in the Object Manager layout.[/quote:2j7vzng7]

Those don't need to be global in the first place! But the most messed up stuff is in your character selection, which is responsible for most problems. The objects femaledata + maledata are both global too, plus they have freaking RTS movement assigned to them. So do your player sprites in that layout. And this messes things up A LOT. Took me more than half an hour to figure this out, so you owe me now! :wink:

So at the very least do the following to fix things:

1. Remove the global attribute of basically all the sprites that have it!
- male + female + player circle in the Object Manager layout
-femaledata + maledate in the CharSelect layout

2. Remove unnecessary RTS behaviors:
- femaledata + maledata + femalepersona + malepersona in the CharSelect layout

3. Use a global for gender selection. A global variable that is!
You'll have to change some events around for this of course in the Hero Movement event sheet. Also change the spawning which I mentioned in my earlier post.

4. Delete all MouseKeyboad objects which are not named "GlobalMouseKeyboard".
Remove the global attribute of your control object GlobalMouseKeyboard. Copy it to all layouts where it isn't already located. Remove all events you can find that are spawning GlobalMouseKeyboard objects!!!

5. You will still need to change a few events around for this stuff to work properly. I believe some events in the CharSelect sheet use different MouseKeyboard objects.

After I did all this, the game worked as intended... finally. :twisted:
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Wed Oct 28, 2009 10:39 pm

You should never spawn mouse and keyboard objects, ever. Just make one and copy paste it to all layouts.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Thu Oct 29, 2009 1:24 am

Oh I see. That sure is messed up. I'll try to do the things you guys said. I'll hit ya back when its all fixed. Thanks a lot!!

EDIT: While trying to fix it by myself, I forgot how to validate the global gender variable if its 0 or 1 which can be found in the Hero Movement Event sheet. The old one was using the private variable "gender" of the "player" object. I basically don't know how to do the same using global variables.

SO howz thou does it?
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Thu Oct 29, 2009 7:21 am

[quote="TheJanMan":1eakkn2e]EDIT: While trying to fix it by myself, I forgot how to validate the global gender variable if its 0 or 1 which can be found in the Hero Movement Event sheet. The old one was using the private variable "gender" of the "player" object. I basically don't know how to do the same using global variables.

SO howz thou does it?[/quote:1eakkn2e]

Well, instead of

Sprite: Value 'gender' Equal to X
+do stuff

use

System: Is global variable 'gender' Equal to X
+do stuff

Look for the condition "Compare global variable" in System.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Thu Oct 29, 2009 8:05 am

[quote="Davioware":121a88mt]You should never spawn mouse and keyboard objects, ever. Just make one and copy paste it to all layouts.[/quote:121a88mt]

Can't you simply have one global mousekeyboard on the first layout?
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Thu Oct 29, 2009 8:18 am

Oh dang it! I was actually using the Compare function lol. Thanks Again!!!!!!!
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Thu Oct 29, 2009 10:30 am

[quote="cow_trix":20g11nj8]Can't you simply have one global mousekeyboard on the first layout?[/quote:20g11nj8]
It's practically the same thing, I just prefer to copy paste it so it appears on all layout event sheets. Global just means it doesn't destroy when the layout changes, so copy pasting has the same advantage, only you can access the copies of it from anywhere where they exist. It doesn't really make a difference, I just like it more that way.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests