Making all NPC global?

This forum is currently in read-only mode.
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • Since I'm making an RPG with Construct, and I'm trying to design my NPCs to travel between layouts (or maps), should I make all the NPCs global? Copy pasting them in each layout seems to slow the progress not to mention kinda useless since they'll be leaving the layout at some random time.

    Any opinions? Suggestions? Help!!!

  • No, global isn't for things like that. Global just means they don't destroy when the layout changes. You wouldn't want an npc to stay in the same coordinates when a layout changes. It's going to take a more advanced system for npcs to be able to travel seamlessly between layouts. And, actually, npcs in real rpgs don't travel between maps, they just move from one location to another based on story variables or whatever. I just want to inform you that making an rpg is pretty difficult.

  • Well, my NPCs aren't just gonna stay in one layout for I want them to act more realistic than just stand in one spot or move around in a map for the rest of the game. I know indeed that RPGs have not been made in Construct yet thats why I'm starting to make one. If I don make one successfully, I would probably boost the interest of others in using Construct.

    BTW, when a game in Construct is running, and that a layout is being played, are other layouts running too? or just on pause or standby or something.

    If my NPCs were to travel between layouts, I would probably need a RealTime system or something to monitor them all.

  • actually, npcs in real rpgs don't travel between maps, they just move from one location to another based on story variables or whatever. I just want to inform you that making an rpg is pretty difficult.

    Actually ever seance PS1 Rpgs have been doing this with a day and night timer to make there world feel more realistic.

    True adding this is very hard and difficult. That why you don't see many game

    with this feature.

    Well, my NPCs aren't just gonna stay in one layout for I want them to act more realistic than just stand in one spot or move around in a map for the rest of the game. I know indeed that RPGs have not been made in Construct yet thats why I'm starting to make one. If I don make one successfully, I would probably boost the interest of others in using Construct.

    BTW, when a game in Construct is running, and that a layout is being played, are other layouts running too? or just on pause or standby or something.

    If my NPCs were to travel between layouts, I would probably need a RealTime system or something to monitor them all.

    I would think the other layout would not be running.

    But you should test this out.

    Maybe if you have the map like Zelda (like one big ass map and break it down into sectors) that might work.

    and the other way I can think of is calculate the position of the NPCs based on a timer.

    I have notice that some game that do what you want have a day and night timer feature to it. Their is now doubt in my mined that they do it with a day and night timer,

    and this would be your best bet for making this work.

  • It would be better to ask the developers themselves though... Now somebody do that pplllaazzzz.In other news, how do I make NPC move randomly? What behavior should I use?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • BTW, when a game in Construct is running, and that a layout is being played, are other layouts running too? or just on pause or standby or something.

    When you change layout, the old layout stops running, so only the current layout is ever running.

  • But what ever changed there is kept at constant right? If I went from map1 to map2 and an object was in position (1,1) and when I went to map2, it went to position (12,23), if I go back to the layout, will it go back to where it was placed?

  • No. Try it and you will see, the layout state reverts, unless you explicitly save it with one of the system save actions. Global objects continue to exist (and be modified) after you leave a layout with a global object on it - and when you come back to that same layout, the global object is not recreated (ie. global objects on a layout are only ever created once).

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)