Richy420Rich Posted November 8, 2012 Author Share Posted November 8, 2012 -Known to work for EO 2.0 and EO 3.0Well here's something simple I took on out of boredom..It allows a class selection for an NPC to determine which class that certain NPC would follow (Going by player classes), selected NPC's won't attack same class players, nor can the players of that class attack that NPC. Only down part is that there's no multiple class selection, but it could be used as a base - This is working for me.Difficulty - 5/5Client & Server SidemodTypes - NpcRec (On the bottom)```Faction As Byte```Server SidemodCombat - CanPlayerAttackNpcAdd this inside all the other checks;```If Npc(MapNpc(mapNum).Npc(mapNpcNum).Num).Faction = GetPlayerClass(attacker) ThenExit FunctionEnd If```modServerLoop - UpdateMapLogicThe loop after ('make sure it's not stunned) The second IF statement, change it to this;```If GetPlayerMap(i) = mapNum And MapNpc(mapNum).Npc(x).target = 0 And GetPlayerAccess(i) <= ADMIN_MONITOR And Npc(npcNum).Faction <> GetPlayerClass(i) Then```Client SideNPC Editor Form. Add a ComboBox. Name it CmbClassCode for CmbClass;```Private Sub CmbClass_Click()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerNpc(EditorIndex).Faction = CmbClass.ListIndex' Error handlerExit Suberrorhandler:HandleError "CmbClass_Click", "frmEditor_NPC", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub```modGameEditors - NpcEditorInitAdd above finish populating;```' add the array to the combofrmEditor_NPC.CmbClass.ClearfrmEditor_NPC.CmbClass.AddItem "None."For i = 1 To Max_ClassesfrmEditor_NPC.CmbClass.AddItem Class(i).NameNext```Add under .txtDamage.text```.CmbClass.ListIndex = Npc(EditorIndex).Faction``` Link to comment Share on other sites More sharing options...
Matt Posted November 8, 2012 Share Posted November 8, 2012 Ah! You beat me to it. I had it all done, but didn't post a tutorial. Good work! Link to comment Share on other sites More sharing options...
Draken Posted November 8, 2012 Share Posted November 8, 2012 *hugs* I love you guys thanks I'll get this installed today sometime.=== LATER THAT DAY IN THE GNOME CAVE===must have not installed it correctly. End up getting a runtime error 9 when i attack any npcs and the npcs of my same class are still attacking me lol=== Even Later===Okay got it installed again, only thing is still getting an error when i attack but they are not attacking me I guess ill go look in server source to see whats going on lol=== Even Later===Got it working finally dont know what I did the first 2 times I tried to install it lol Link to comment Share on other sites More sharing options...
Jumbofile Posted November 8, 2012 Share Posted November 8, 2012 does it work in 3.0 Link to comment Share on other sites More sharing options...
Santini Posted November 8, 2012 Share Posted November 8, 2012 Seeming so it does not effect anything graphical I would imagine it should. Link to comment Share on other sites More sharing options...
Draken Posted November 8, 2012 Share Posted November 8, 2012 yes im using it in 3.0 ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) Link to comment Share on other sites More sharing options...
Richy420Rich Posted November 8, 2012 Author Share Posted November 8, 2012 > Ah! You beat me to it. I had it all done, but didn't post a tutorial. Good work!Yeah sorry for the package block, I was just bored and saw the request lol.> does it work in 3.0I tagged it with EO 2.0 because I'm not sure if the attack AI was different or not in the server loop for 2.3 or 3.0, that's the only reason why I limited it to EO 2.0\. I'll change the tag now that it works for 3.0. Link to comment Share on other sites More sharing options...
Ganjika Posted November 10, 2012 Share Posted November 10, 2012 would be epic to see this grown, perhaphs into something that would allow folks to assign "faction-classes" to selected npc's (example: have a "zombies a" faction for a certain type of zombies) and to be able to gain or lose faction (and in turn be in higher or lower standing with whichever set of npc's the affected faction is set to effect ; "Your standing with Zombies-A has gotten better/Your standing with Zombies-A has gotten worse!").) - this would open the door to faction quests and so fourth. Would be cool to havefactions affect which mobs the player kills and which mobs try to kill the player (while still having some regular mobs/npcs which are associated with no faction and would operate as npcs do now without any faction on them set.) Link to comment Share on other sites More sharing options...
Richy420Rich Posted November 10, 2012 Author Share Posted November 10, 2012 Well, I released it by request and it's a base, I left the options open so basically, any idea of upgrading would be up to the games manager. Link to comment Share on other sites More sharing options...
Castar Posted November 10, 2012 Share Posted November 10, 2012 Thank you for this! I'm working on a City of Heroes/Champions like game and if/when (if I ever manage to get the project anywhere) I implement a Villain faction I'll be needing this badly as I'd love to have a "mixed/neutral" zone (something I always missed in CoH, apart from the social-only Pocket D there was no full-on PvP integration, like say if in World of Warcraft a Horde player strolled around Alliance territory then he was likely to be hunted down). Link to comment Share on other sites More sharing options...
hisherwin Posted November 14, 2012 Share Posted November 14, 2012 This is best for Zombie Games , Me is making one i already have this installed .. take me 30 minutes , But mine is using Option Button not ComboBox , i guess i should update mineSorry for Comma'sThank You! ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png)Sherwin Link to comment Share on other sites More sharing options...
MrKris Posted November 26, 2012 Share Posted November 26, 2012 Whenever I attack an NPC I get a variable undefined error on (attacker) in this line.```If NPC(MapNpc(mapNum).NPC(mapNpcNum).Num).Faction = GetPlayerClass(attacker) Then```I re-installed the tutorial several times but the error continues to pop up. Is there anything I'm missing? Link to comment Share on other sites More sharing options...
Matt Posted November 26, 2012 Share Posted November 26, 2012 Are you sure you're putting that in the right place? What sub are you putting that into? At the top of the sub, do you have```ByVal attacker As Long```?EDIT: If you're putting that in CanNpcAttackPlayer, then change attacker to index. Link to comment Share on other sites More sharing options...
Wortel Angels Posted December 18, 2012 Share Posted December 18, 2012 thats one of the bades tutorial which i ever seen…But it works ;-)(Bad = An noob at coding will never get it working...) Link to comment Share on other sites More sharing options...
Richy420Rich Posted December 18, 2012 Author Share Posted December 18, 2012 Okay I added the difficulty setting of this tutorial. Thanks. Link to comment Share on other sites More sharing options...
Ganjika Posted December 18, 2012 Share Posted December 18, 2012 What if instead of a class selection you had just assigned a 'Faction Group' - with a number and name associated to it (example: "1 - Citizens of Shadewillow") and these could be assigned in character editor as like a checkbox (ie: Faction Group?) and if said checkbox is clicked you could adjust which faction group via a scrollbar, where you would create/edit faction groups could either be in a new form and/or some new commands (ie: "/createfaction factionnumber" - then it could say either "Okay, Name of Faction?" or "Name Invalid/In Use" and if you enter an appropriate faction name it could say (for example) "Faction (1) 'Citizens of Shadewillow' Created!". If you wanted to go a step even futher you could make it so that npcs of rival factions attack/kill each other on site - npc's without a faction can be nutral with any other npc as they are originally without any faction add-on. The tricky part would be setting diplomatic stances between the factions (one could just create custom /commands but in terms of this it could get messy - a form might be needed, I say if any of these ideas are implemented to have all "factions" nutral unless a enemyship is declared between any two factions.Just some suggestions. I really dig this tutorial but i think it needs to be elaborated upon, even if it is supposed to be basic.In any case - Excellent work. =]**Edit: Below is included an example I created (it _isn't_ functional, just visual).)**![](http://i1127.photobucket.com/albums/l632/EsoGuildPB/projected1_zps0ac82d6f.png)![](http://i1127.photobucket.com/albums/l632/EsoGuildPB/projected3_zps81b2e8ac.png)<- ("faction" frame as shown here - would would be in the npc editor)![](http://i1127.photobucket.com/albums/l632/EsoGuildPB/proposedfaction_zps2464aae1.png)(^^ Faction #4 indicates how a removed faction would look on the list. if this design is ever to be used it important to make sure thelist can still function even with the removed function - especially if said function to be removed has current engagements as anenemy/ally of their own/another faction(s). Link to comment Share on other sites More sharing options...
Wortel Angels Posted December 18, 2012 Share Posted December 18, 2012 I mean> Add this inside all the other checks;The most dont know what for checks…> The loop after ('make sure it's not stunned) The second IF statement, change it to this;Some dont know which… i putted it at first try falseWhy do you not just write searchBLABLALBAUnder it putBLABLAElse is the tut/system easy and never 5/5 difficulty Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now