destroy npc command
Moderators: Bob the Hamster, marionline, SDHawk
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
destroy npc command
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.
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.
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.
- Bob the Hamster
- Liquid Metal King Slime
- Posts: 7460
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
- BMR
- Metal King Slime
- Posts: 3310
- Joined: Mon Feb 27, 2012 2:46 pm
- Location: The Philippines
- Contact:
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
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
Using Editor version wip 20170527 gfx_sdl+fb music_sdl
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
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.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.
- Bob the Hamster
- Liquid Metal King Slime
- Posts: 7460
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
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
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.
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
This is a good idea. I will probably use it.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.
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.Bob the Hamster wrote:(You know what? I should totally add the ability to search for tags by name right into the tag browser!)
Last edited by Willy Elektrix on Tue Aug 06, 2013 11:51 pm, edited 1 time in total.
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.
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
- Bob the Hamster
- Liquid Metal King Slime
- Posts: 7460
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
http://rpg.hamsterrepublic.com/ohrrpgce ... gs%3F#NPCsWilly Elektrix wrote:While we are discussing limits. How many NPCs can I use on a single map?
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
I read that, but I didn't know if the wiki was accurate or not.Bob the Hamster wrote:http://rpg.hamsterrepublic.com/ohrrpgce ... gs%3F#NPCsWilly Elektrix wrote:While we are discussing limits. How many NPCs can I use on a single map?
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.Willy Elektrix wrote:I read that, but I didn't know if the wiki was accurate or not.Bob the Hamster wrote:http://rpg.hamsterrepublic.com/ohrrpgce ... gs%3F#NPCsWilly Elektrix wrote:While we are discussing limits. How many NPCs can I use on a single map?
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.
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.
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.Willy Elektrix wrote:I read that, but I didn't know if the wiki was accurate or not.Bob the Hamster wrote:http://rpg.hamsterrepublic.com/ohrrpgce ... gs%3F#NPCsWilly Elektrix wrote:While we are discussing limits. How many NPCs can I use on a single map?
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.
- Spoonweaver
- Liquid Metal King Slime
- Posts: 6247
- Joined: Mon Dec 08, 2008 7:07 am
- Location: Home
- Contact: