destroy npc command

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

destroy npc command

Post by Willy Elektrix »

Is there anyway to make the Destroy NPC command permanent? For instance, when I save/load a game, I want NPCs who have been destroyed to stay destroyed.

I know I can do this with tags, but I'm trying to avoid that to cut down on the number of excessive tags this game will be using.
User avatar
Gizmog
Metal King Slime
Posts: 2614
Joined: Tue Feb 19, 2008 5:41 am

Post by Gizmog »

In theory you could play games with Global Variables. I don't know what to call this kind of math, but I'd say do it "Bit Style". So say you have a global variable for Narshe representing 16 NPCs. If you want NPC 1 to be destroyed, you'd add 1 to "NarsheNPCs" and if "NarsheNPCs" equals 1 then you'd delete NPC 1. If you want NPC 2 to be destroyed you'd add 2 to NarsheNPCs, and if NarsheNPCs equals 2 then you'd delete NPC 2, if it equals 3 you'd delete 1 and 2, and if you want NPC 3 destroyed you'd add 4 and so on. I don't know that there's built in support to do math this way so that could be complicated, but there might be a cool smart person way to do it.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Are you worried about running out of tags? Or are you just trying to keep your list of tags uncluttered?

If your concern is the first, let me remind you that the current version no longer has a 1000 tag limit! You can use up to 16000 tags.
User avatar
BMR
Metal King Slime
Posts: 3310
Joined: Mon Feb 27, 2012 2:46 pm
Location: The Philippines
Contact:

Post by BMR »

Bob the Hamster wrote:Are you worried about running out of tags? Or are you just trying to keep your list of tags uncluttered?

If your concern is the first, let me remind you that the current version no longer has a 1000 tag limit! You can use up to 16000 tags.

Which is something I personally am very, very happy about :D
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

Bob the Hamster wrote:Are you worried about running out of tags? Or are you just trying to keep your list of tags uncluttered?

If your concern is the first, let me remind you that the current version no longer has a 1000 tag limit! You can use up to 16000 tags.
I'm worried about the organizational hassle of having so many tags. Although, at this point it seems like that's what I'll have to do. Such is life.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

How do you name your tags? I find that having at least a simple naming scheme helps a lot.

Also, you might be tempted to try and group tags together based on what they are for-- in my opinion, that is a mug's game, you are better off just allocating tags as you need them, but giving them good names.

Then, you can export your tag names to your .hsi file, open it up in a text editor, and to a search on it whenever you need to find the name of the tag you need
(You know what? I should totally add the ability to search for tags by name right into the tag browser!)

EDIT: And done! That was a surprisingly easy feature to implement! :) It will be in the next nightly WIP build
Last edited by Bob the Hamster on Tue Aug 06, 2013 2:51 pm, edited 1 time in total.
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

Bob the Hamster wrote:Then, you can export your tag names to your .hsi file, open it up in a text editor, and to a search on it whenever you need to find the name of the tag you need.
This is a good idea. I will probably use it.
Bob the Hamster wrote:(You know what? I should totally add the ability to search for tags by name right into the tag browser!)
Thank you for doing this, but I try to avoid updating my version of OHR while a game is in progress. The likelihood of introducing bugs worries me.
Last edited by Willy Elektrix on Tue Aug 06, 2013 11:51 pm, edited 1 time in total.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

If you have a lot of NPCs that need this then Giz's method could save you a lot of trouble. You don't even need to use bits unless you have tens of thousands of NPCs (there are 16384 global variables). The trickiest part may be getting a script to run just before leaving each map. Stepon NPCs surrounding the doors is one possibility, scripting your own door detection is another.
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

While we are discussing limits. How many NPCs can I use on a single map?
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Willy Elektrix wrote:While we are discussing limits. How many NPCs can I use on a single map?
http://rpg.hamsterrepublic.com/ohrrpgce ... gs%3F#NPCs
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

Bob the Hamster wrote:
Willy Elektrix wrote:While we are discussing limits. How many NPCs can I use on a single map?
http://rpg.hamsterrepublic.com/ohrrpgce ... gs%3F#NPCs
I read that, but I didn't know if the wiki was accurate or not.

I'm creating a game with a 1 giant map. I will have to be very careful because I will probably be at 300 NPCs by the end.
User avatar
SDHawk
Metal Slime
Posts: 672
Joined: Sun Apr 27, 2008 8:46 pm

Post by SDHawk »

Willy Elektrix wrote:
Bob the Hamster wrote:
Willy Elektrix wrote:While we are discussing limits. How many NPCs can I use on a single map?
http://rpg.hamsterrepublic.com/ohrrpgce ... gs%3F#NPCs
I read that, but I didn't know if the wiki was accurate or not.

I'm creating a game with a 1 giant map. I will have to be very careful because I will probably be at 300 NPCs by the end.
If absolutely necessary you could build a system to have "fake" NPCs that use slices. Would require some work depending on what NPC functionality you need to re-create.

Alternately you could use an instancing system that only spawns NPCs when the player is nearby (assuming that you don't need them actively processed at all times) which would raise your limit to 500. You could go even further and have the instancing system build new NPCs on the fly via scripting (alter npc etc) and then only be using as many NPCs as you need around the player at a given time and therefore raising your cap to infinite.

The downside to both solutions of course is that you'd need to place and define the NPCs with your scripts instead of the editor. But considering you're working with 300 of 'em it's probably less unwieldy to do in the long run anyway with proper script organization.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Whoa, slow down. Lifting the 300 NPC limit won't be hard, just need to replace one simple file format with another. Could be less work than scripting an elaborate workaround like that (which is frequently the case. Wouldn't it be nice f users could implement their own features? :)
User avatar
Mogri
Super Slime
Posts: 4598
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

Willy Elektrix wrote:
Bob the Hamster wrote:
Willy Elektrix wrote:While we are discussing limits. How many NPCs can I use on a single map?
http://rpg.hamsterrepublic.com/ohrrpgce ... gs%3F#NPCs
I read that, but I didn't know if the wiki was accurate or not.

I'm creating a game with a 1 giant map. I will have to be very careful because I will probably be at 300 NPCs by the end.
Watch out for performance issues. It might not be as big an issue as it was in the day, but Scary Game 2's town map got a lot of lag when it was released.
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6247
Joined: Mon Dec 08, 2008 7:07 am
Location: Home
Contact:

Post by Spoonweaver »

if sounds like you'd be better off faking the map being continuous then you would faking hundreds of npcs.
With the fade taken out of doors it shouldn't be too hard.
Pokemon fakes 1 big map with a bunch of smaller ones seemlessly connected.
Post Reply