MightyMidget Posted December 5, 2004 Share Posted December 5, 2004 Hi, I downloaded Talchia's Hardcore mod and its really great, but I'd like to make a mod along similar lines myself... does anyone know where I can find the source code for the Hardcore mod? Or else just as helpful would be some help as to where to start on this idea? I'd like to modify the stats of all enemies in the game by multiplying them by a fraction of the player's Character level. e.g. Hitpoints (for all enemies) * (1/8 of Player level) That way all the enemies will keep their difficulty relative to each other unlike the hardcore mod where stats were simply added. If anyone can outline for me roughly how to get started on this that would be great. I have all the necessary modding tools, my trouble is just what functions to use to specify all enemies and modify their stats based on the player's level. Thanks. Link to comment Share on other sites More sharing options...
Xavier2 Posted December 5, 2004 Share Posted December 5, 2004 Originally posted by MightyM Hi, I downloaded Talchia's Hardcore mod and its really great, but I'd like to make a mod along similar lines myself... does anyone know where I can find the source code for the Hardcore mod? Or else just as helpful would be some help as to where to start on this idea? I'd like to modify the stats of all enemies in the game by multiplying them by a fraction of the player's Character level. e.g. Hitpoints (for all enemies) * (1/8 of Player level) That way all the enemies will keep their difficulty relative to each other unlike the hardcore mod where stats were simply added. If anyone can outline for me roughly how to get started on this that would be great. I have all the necessary modding tools, my trouble is just what functions to use to specify all enemies and modify their stats based on the player's level. Thanks. I don't know much about this sort of thing but i thought of a possible direction. Every area in the game has a Enter script. Perhaps what you want can be done by adding some functions to the default script. Anyway. Good luck on that. It sounds very good but also very hard and challenging. Link to comment Share on other sites More sharing options...
Darth333 Posted December 5, 2004 Share Posted December 5, 2004 Talchia edited k_ai_master.nss. You'll find the source code in this thread: http://www.lucasforums.com/showthread.php?s=&threadid=120989 (last post). Link to comment Share on other sites More sharing options...
MightyMidget Posted December 5, 2004 Author Share Posted December 5, 2004 Thanks for the replies. The enter script thing might help a bit, i'll look into that. Also the source code for all the scripts in the game exists in the scripts.bif I looked at the K_AI_Master source and concluded that Talchia did not use existing functionality within the file but rather added his/her own. Link to comment Share on other sites More sharing options...
Darth333 Posted December 5, 2004 Share Posted December 5, 2004 Originally posted by MightyM Thanks for the replies. The enter script thing might help a bit, i'll look into that. If I were you, I would forget this. First you'll have to edit the enter script for all the areas and it's heavy for nothing since there are other available solutions. Simple is always better. Also, many other mods are using those scripts and it will only create an incompatibility problem. I looked at the K_AI_Master source and concluded that Talchia did not use existing functionality within the file but rather added his/her own. That is true. You could also have a look at k_def_buff.nss in the BIFs Link to comment Share on other sites More sharing options...
MightyMidget Posted December 5, 2004 Author Share Posted December 5, 2004 "That is true. You could also have a look at k_def_buff.nss in the BIFs" SWEET! I think this will be perfect! I have one ominous question tho, why didn't Talchia use this file then? Why use K_AI_Master if k_def_buff already had the capability? Oh well... time to test it out. Link to comment Share on other sites More sharing options...
MightyMidget Posted December 5, 2004 Author Share Posted December 5, 2004 It looked promising.... and I modified it, but sadly it modified my stats not the enemies' which doesn't make much sense... but whatever. I'm going to look for the difficulty scripts now. Thanks for the suggestion tho. Link to comment Share on other sites More sharing options...
deathdisco Posted December 5, 2004 Share Posted December 5, 2004 why didn't Talchia use this file then? Why use K_AI_Master if k_def_buff already had the capability? He may not have been aware of it at the time. That was pretty early on when modding KOTOR was in it's infancy. Link to comment Share on other sites More sharing options...
beancounter Posted December 5, 2004 Share Posted December 5, 2004 A lot of the NPC's and creatures do not run the k_deff_buff. Like the Sandpeople and some of creatures you fight in Kashyyyk. However, every creature does use k_ai_master. You have to check the spawn in script for a creature and see if it makes a call to k_deff_buff. You are probably better off changing the k_ai_master. Link to comment Share on other sites More sharing options...
MightyMidget Posted December 5, 2004 Author Share Posted December 5, 2004 How do I edit K_AI_Master? I can't seem to find an object that specifies all enemies... I can find objects that specify the targeted enemy, or the nearest enemy ... but not all enemies. Does anyone know what the object that specifies all enemies in area, or just all enemies period is called? Link to comment Share on other sites More sharing options...
MightyMidget Posted December 6, 2004 Author Share Posted December 6, 2004 Where are the base stats for all the npcs defined? What file? This would be a great help to know . Also, does anyone know of an object that contains all the enemies in the game? I mean how did Talchia do his hardcore mod? To what objects did he effect changes? Just to your target... or what? How could I change the stats on a particular enemy? Or better yet all enemies? Thanks. Link to comment Share on other sites More sharing options...
RedHawke Posted December 6, 2004 Share Posted December 6, 2004 ^^^^ You have lots of questions padawan... this is good! Originally posted by MightyM Where are the base stats for all the npcs defined? What file? This would be a great help to know . The NPC stats are defined by their individual .utc file, then enhanced by the k_ai_master.ncs script. Originally posted by MightyM Also, does anyone know of an object that contains all the enemies in the game? Nope, there is no one central place to store NPC information, they are all individual .utc files stored in the individual modules themselves. Originally posted by MightyM I mean how did Talchia do his hardcore mod? To what objects did he effect changes? Just to your target... or what? Talchia altered the k_ai_master.ncs script this script simply adjusts the NPC's that are hostile to you in the game pending your level, and the games difficulty setting, if I'm not mistaken. Originally posted by MightyM How could I change the stats on a particular enemy? Or better yet all enemies? Thanks. You can change the stats of a particular enemy by simply editing the NPC's .utc file with KT to taste, and dropping it into override... Warning some of the NPC .utc files if placed in override can screw up the game at numerous points. There isn't really a way to alter all NPC's of a particular type as I said above there is no real central file that defines the NPC's statistics, they are all individual files contained in the modules themselves. The only centralized NPC file is the appearance.2da this controls the NPC appearances but it does not control the statistics. I hope this helps! Link to comment Share on other sites More sharing options...
MightyMidget Posted December 6, 2004 Author Share Posted December 6, 2004 That's awsome! Talchia altered the k_ai_master.ncs script this script simply adjusts the NPC's that are hostile to you in the game pending your level, and the games difficulty setting, if I'm not mistaken. I would love to edit the NPC's that are hostile to me. But how can I do this? The trouble is -I can't seem to figure out how Talchia implemented his mod in the K_AI_Master file... I just have no idea what he did.... if I had his source code or somthing I'm sure I could improve upon the mod e.g. i'd do somthing like this to enemies stats: EffectAbilityIncrease(ABILITY_DEXTERITY, nCharLevel+3) Would it be possible for you to give me some pointers as to how to modify enemies stats? How would be the best way to do this? I'd like to modify the K_AI_Master file since it is the most logical, and i'd like all enemies to be modified according to the stat changes I specify. Thanks! Link to comment Share on other sites More sharing options...
RedHawke Posted December 6, 2004 Share Posted December 6, 2004 Originally posted by MightyM That's awsome! Just so you know the file works simply, not that it is simple to do. Originally posted by MightyM I would love to edit the NPC's that are hostile to me. But how can I do this? (Edited for space) Thanks! Sadly, I don't think you can see what Talchia did because Talchia did not include a source .nss script in his mod. Well you will have to look at the source script called k_ai_master.nss, you can find it with KT (I don't have a comp with KT on it right now but I believe it is in there somewhere), this is the base script the game uses, you will have to modify that .nss script to taste with notepad, then compile it with the compiler. This thread might be of help to you as far as helping you with the how to, and the links to the tool downloads you will need. I hope this helps! EDIT: MightyM, you should have asked these questions in the thread you already started as you are asking the same types of questions here, this would have helped to centralize your questions and the answers. If a moderator reads this it might be beneficial to merge the two threads. Link to comment Share on other sites More sharing options...
beancounter Posted December 6, 2004 Share Posted December 6, 2004 You should modify Talchia's code to how you want it. Darth333 gave you the download link in a earlier thread. His script is fired by the indiviual creatures when they perceive you for the first time. You should not do a mass update with this script, unless you used the "On Entry" script. You will need to do a couple of steps. 1. Make sure the player and his party do no run this script 2. Get the players level - Talchia used the variable nCharLevel 3. Get the object_self hitpoints 4. Modify the hitpoints All of the above steps are in the Hardcore mods source code. Just look at case 1002 - On Perception Link to comment Share on other sites More sharing options...
Darth333 Posted December 6, 2004 Share Posted December 6, 2004 MightyM, in case you did not find out about this yet, you could have a look at nwnscript.nss for the functions you can use. Originally posted by RedHawke EDIT: MightyM, you should have asked these questions in the thread you already started as you are asking the same types of questions here, this would have helped to centralize your questions and the answers. If a moderator reads this it might be beneficial to merge the two threads. Done! Link to comment Share on other sites More sharing options...
MightyMidget Posted December 6, 2004 Author Share Posted December 6, 2004 All of the above steps are in the Hardcore mods source code. "Just look at case 1002 - On Perception" Sorry where's case 1002 - On Perception? Also does anyone know what would be some good tutorials to start with in order to learn the stuff i'll need to know to make my own hardcore mod? "nwnscript.nss for the functions you can use." Yup I noticed that just recently and i've downloaded the indexed version of this in order to better find and use the functions it contains. Thanks, you've all helped a lot. . Link to comment Share on other sites More sharing options...
tk102 Posted December 6, 2004 Share Posted December 6, 2004 Sorry where's case 1002 - On Perception? It's the part that has the ///////>>>>>>HARDCORE MOD V 1.0<<<<<<<<<<///////// in it... kind of hard to miss... In regards to scripting, the best that can be offered in terms of advice is to look at Darth333's sticky thread and to read the current posts from others... it's one of those things that you pick up or you don't. C++ tutorials may also help give you gist of it. I see also that Talchia forgot to include this bit in his/her code: [size=3]if(GN_GetSpawnInCondition( SW_FLAG_EVENT_ON_PERCEPTION) && GetLastPerceptionSeen()) { SignalEvent(OBJECT_SELF, EventUserDefined(1002)); }[/size] that should be inserted right before this part [size=3]} break; case 1003:[/size] just in case anybody was trying to create a user-defined event based for OnPerception in conjunction with this mod. P.S. MightyM, please try to use those handy-dandy [ quote ] vbCode tags. They help the readability greatly. Link to comment Share on other sites More sharing options...
MightyMidget Posted December 6, 2004 Author Share Posted December 6, 2004 Oh my goodness!!! I can't believe it. I thought the link to the K_AI_Master script that Darth333 posted was for the source of the original K_AI_Master script. It was actually for Talchia's very own hardcore mod!!!! In fact it turns out that Talchia almost entirely copied the code from the K_Def_Buff.nss. This mod is going to be super easy now . I'll post it up here when i'm done but essentially it will mod NPC stats based on your character's level, so instead of upping npc stats when you get to a certain level it will check your current character level and then derive the stat boosts from that. Thus - an ever increasing difficulty. Thanks all!! Link to comment Share on other sites More sharing options...
tk102 Posted December 6, 2004 Share Posted December 6, 2004 it will mod NPC stats based on your character's level, so instead of upping npc stats when you get to a certain level it will check your current character level and then derive the stat boosts from that. Thus - an ever increasing difficulty. Ok... I don't see the difference but sounds good! Link to comment Share on other sites More sharing options...
MightyMidget Posted December 6, 2004 Author Share Posted December 6, 2004 Well i'm going to edit enemy stats based on your character level and the enemy's original stats. so e.g. I might increase the enemy's dexterity by ncharlevel/10+1*the original dexterity of the enemy. and there will be no condition of reaching a certain player level for it to take effect, it will simply always take effect. I have one more question tho how can I find the original dexterity or any other stat of the targets of the Hardcore mod Script? Link to comment Share on other sites More sharing options...
tk102 Posted December 6, 2004 Share Posted December 6, 2004 from nwscript.nss // 139: Get the ability score of type nAbility for a creature (otherwise 0) // - oCreature: the creature whose ability score we wish to find out // - nAbilityType: ABILITY_* // Return value on error: 0 int GetAbilityScore(object oCreature, int nAbilityType); So you might have something like this in your script... int nSTR=GetAbilityScore(OBJECT_SELF, ABILITY_STRENGTH); int nDEX=GetAbilityScore(OBJECT_SELF, ABILITY_DEXTERITY); // etc... Link to comment Share on other sites More sharing options...
MightyMidget Posted December 6, 2004 Author Share Posted December 6, 2004 Thanks i'll try that . Link to comment Share on other sites More sharing options...
MightyMidget Posted December 6, 2004 Author Share Posted December 6, 2004 Do you know how I can find the original force points of the object? Your code example should work well for abilities, but Force points aren't an ability... so how would I do it? Thanks for the help this project is moving along quite smoothly now . EDIT: - just found this // 56: // returns the Max force points for the creature int GetMaxForcePoints(object oObject=OBJECT_SELF); Guess that answers my question . Link to comment Share on other sites More sharing options...
MightyMidget Posted December 6, 2004 Author Share Posted December 6, 2004 Another question: What's the difference between vitality points, and hitpoints? Are they one and the same? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.