Making all NPC global?

For questions about using Classic.

Post » Wed Nov 04, 2009 4:11 pm

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!!!
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Wed Nov 04, 2009 5:07 pm

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.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Nov 04, 2009 5:50 pm

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.
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Wed Nov 04, 2009 7:54 pm

[quote="Davioware":2kjhijkm]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.[/quote:2kjhijkm]

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.

[quote="TheJanMan":2kjhijkm]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.[/quote:2kjhijkm]

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.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Thu Nov 05, 2009 1:49 am

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?
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Thu Nov 05, 2009 9:13 am

[quote="TheJanMan":4rl6o1wr]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.[/quote:4rl6o1wr]
When you change layout, the old layout stops running, so only the current layout is ever running.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu Nov 05, 2009 11:46 am

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?
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Thu Nov 05, 2009 4:10 pm

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).
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests