0 Favourites

My RTS movement doesn't work at some layouts

This forum is currently in read-only mode.
  • 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!!!

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

    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?

    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!

  • 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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • The only globals I think I have are the objects found in the Object Manager layout.

    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!

    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.

  • You should never spawn mouse and keyboard objects, ever. Just make one and copy paste it to all layouts.

  • 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?

  • 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?

    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.

  • You should never spawn mouse and keyboard objects, ever. Just make one and copy paste it to all layouts.

    Can't you simply have one global mousekeyboard on the first layout?

  • Oh dang it! I was actually using the Compare function lol. Thanks Again!!!!!!!

  • Can't you simply have one global mousekeyboard on the first layout?

    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.

  • > Can't you simply have one global mousekeyboard on the first layout?

    >

    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.

    Agreed. I also handle my mousekeyboard object that way.

    Oh dang it! I was actually using the Compare function lol. Thanks Again!!!!!!!

    Haha, I remember doing exactly the same thing when I was new to Constuct.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread sticky
4,517 857,371
Tinimations's avatar
Tinimations
Unread sticky
1,586 437,307
matriax's avatar
matriax
Unread hot topic
378 33,261
part12studios's avatar
part12studios