Author Topic: NWN moba scripting help  (Read 557 times)

Legacy_Mister Sheep

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
NWN moba scripting help
« on: February 10, 2015, 03:17:34 am »


               

To anyone who loves the MOBA genre, i considered creating my own NWN module around the tower defense setting. But i kinda suck at scripting.


1# So far i've been unable to make my ''minions'' spawn at regular intervals. I can set them to respawn 30 seconds after death, but i want to to ALWAYS spawn every 30 seconds, even if there is already a wave up.


2# Another minion problem. How do i make them walk across the map? Ive seen some script that can make them walk to another point in the map, which would be fine for the mid lane, but what about the top and bottom lane? Anyone knows a script that would make them walk throught different checkpoints while STILL attacking enemy NPCs/PCs on sight?


3# I've set two different factions, the blue faction and the red faction. As far as minion goes, they attack each other properly. I've also created a starting area that allows the player to select either the blue or the red side(By porting there), but that's as far as i was able to go. How can i make players join a specific faction? If they join the blue side, the red side should become hostile and the blue side should be friendly-fireproof.



For anyone who wants more info about the moba i'm creating:


There are two bases, three lanes and a jungle. There can be up to five players on each sides. They have to defend their towers (more like huge immobile NPCs that have strong ranged attacks) and ultimately their Base (another immobile NPC). In each lanes, the PCs must try to push with the help of their minions that can tank a few turret hit until they destroy a set of 3-4 turrets to an exposed Base.


Players start at lvl 5, with only enough gold to purchase a starting item. To collect experience points, you must get the killing blow on the minion. To collect the gold, you must loot their corpses. One must be careful when pushing too hard as their gold might become inaccessible. The enemy might even be able to loot your own gold.


The jungle has many different neutral camps that can be killed for gold, experience and special items like a Heal potion or invisibility potions. There is a dragon on one side of the jungle that requires the whole team to kill, but offers a lot of gold, and a scroll of Hellball.


Damage types are divided by their role. Piercing damage is for sneak attacks and ranged attacks(Marksman and Assassin roles). Slashing for tankier melee types, offering vampiric weapons(For tanks and fighters). Turrets use bluedgeonning damage, and the only way to mitigate it is with the use of a shield(Tanks, either support tanks or solo lane tanks, make great tower divers if they use the proper shield). Magic/elemental damage from spellcasters and some weapons from the shop. NPCs and turret take increased magical damage (which include cold, fire, electrical, etc.)


The top lane is surrounded by cliffs and has poor visibility, the jungler can easily gank there. Tanks and fighters will probably prefer going there.


The middle lane is a broad way and is a relatively safe zone. Squishy classes should prefer it.


The bottom lane is surrounded by pits, this place is fit for a marksman, they have an advantage in any fights happening on that side of the jungle, since they can shoot across the pits (but not through the top lane cliffs)


The jungle will be fit for any characters that can stealth, be it rogues, rangers or monks.


The fifth player will have a low access to gold, so a caster class is probably the most fit to support his team mates, since they depend less on items as well as offering CC/debuffs/buffs. A pure tank could be a great support too, and could help gather gold from corpses without dieing (Gold can be traded)


Items will be greatly varied. Giving a resistance or bonus to one of the four damage types (piercing, slashing, bludgeonning and magical/elemental), Stats bonus, immunity to special effects, on-use spells, special weapons that apply effects on-hit (like a slow or a stun) passive regen and etc.


Some of the starting items: an unlimited ammunition bow, a vampiric sword, a quarterstaff that deals increased damage to jungle monsters, a shield that protects from damage, and a few more for each role. Each are cheap, but will be replaced when the character gains more gold.


I really hope i can make this module come true, and i also hope i can find a few people that would be interested to play. I also plan on uploading the module once it is completed so everyone can use it.


Thanks for reading =D



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
NWN moba scripting help
« Reply #1 on: February 10, 2015, 04:02:46 am »


               

When it will be avaliable to download? I need play it. 



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
NWN moba scripting help
« Reply #2 on: February 10, 2015, 04:10:11 am »


               


To anyone who loves the MOBA genre, i considered creating my own NWN module around the tower defense setting. But i kinda suck at scripting.


1# So far i've been unable to make my ''minions'' spawn at regular intervals. I can set them to respawn 30 seconds after death, but i want to to ALWAYS spawn every 30 seconds, even if there is already a wave up.


2# Another minion problem. How do i make them walk across the map? Ive seen some script that can make them walk to another point in the map, which would be fine for the mid lane, but what about the top and bottom lane? Anyone knows a script that would make them walk throught different checkpoints while STILL attacking enemy NPCs/PCs on sight?


3# I've set two different factions, the blue faction and the red faction. As far as minion goes, they attack each other properly. I've also created a starting area that allows the player to select either the blue or the red side(By porting there), but that's as far as i was able to go. How can i make players join a specific faction? If they join the blue side, the red side should become hostile and the blue side should be friendly-fireproof.




#1


 


CreateObject combined with recursive delayed function. It should look like this


 


void SpawnMinions()


{


 if(GetFirstPC() == OBJECT_INVALID || GetLocalInt(GetModule(),"GAME_OVER")) return;


object oRed1 = GetWaypointByTag("blabla");


object oRed2 = GetWaypointByTag("blabla");


object oRed3 = GetWaypointByTag("blabla");


object oBlue1 = GetWaypointByTag("blabla");


object oBlue2 = GetWaypointByTag("blabla");


object oBlue3 = GetWaypointByTag("blabla");


CreateObject("minionred",GetLocation(oRed1));


CreateObject("minionred",GetLocation(oRed1));


CreateObject("minionred",GetLocation(oRed1));


CreateObject("minionred",GetLocation(oRed2));


CreateObject("minionred",GetLocation(oRed2));


CreateObject("minionred",GetLocation(oRed2));


and so on


DelayCommand(30.0,SpawnMinions());


}


 


 


#2


 


They will move automatically if you setup waypoints matching WP_tagofminion_X where X = 01 - how much you need. Try paint the minion into area, then select him and then right click anywhere on map you should get an option create waypoint, if you do this it will bind it with minion, after that you can delete minion. Also this means you need special blueprint for midlane/botlane/toplane minions


 


#3 you need to use SetPCDislike/SetPCLike functions.


               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
NWN moba scripting help
« Reply #3 on: February 10, 2015, 04:15:51 am »


               

Anyway, as a guy who has experience in making and playing PvP arenas in NWN, and as a guy who play Legends of League and already thought about this idea to make the DOTA in NWN, I have to warn you.


 


I don't think there is enought interest nor player base that would be interested in this. Keep in mind, you need 10, 10!!! peoples just to play this mode, while such numbers are these days rare even in roleplay servers and they get so many players only in primetime. Due to the ammount of work required to make this possible I don't think its worth it. It wont work even as a downloadable arena for LAN because you never gather 10 players for LAN, so it would have to be online which means you need hosting with public IP and good connectivity. And what to do when there wont be 10 players? And what to do when game already started and there are more players? Or when one player quits etc. etc. Basically you would have to make bots, and thats the most problematic on this concepts.


 


Not even mentioning balance changes which you would most likely have to do because everyone will play casters otherwise.



               
               

               
            

Legacy_Mister Sheep

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
NWN moba scripting help
« Reply #4 on: February 11, 2015, 12:01:07 am »


               

Thanks for the help! I don't have a lot of free time, but i'm working on it little by little. I'll make sure to create another post when it's ready and working!


As pointed it might be hard to find 10 players, so if all works well i'll do a 3v3 map too.



               
               

               
            

Legacy_Mister Sheep

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
NWN moba scripting help
« Reply #5 on: February 19, 2015, 11:41:30 am »


               

Sorry for the bump, i just need help once more, and i thought it would be best to bump instead of creating a new thread.


The module is going really well so far, but something still bugs me.


The module PvP setting is set on Party-Protected, and when players join a side, they automatically join a distinct ''red'' or ''blue'' group. But i can't find a way to stop players from attacking their own minions/towers.


In a perfect match, nobody would try to right-click their own minion, and attack them. But in case there is a griefer, i'd rather have a way to make it impossible for players to attack people on their own team.


Each player gets an item either called ''Blue Power Shard'' or ''Red Power Shard'' depending on their side, and their respective minions/turrets have the ''BlueFaction'' and ''RedFaction''.


So far i created a script on minions that clears all actions the player makes if they attack one of their own minion/turret, but they still deal damage on their first attack, and the minion/turret remains hostile. If possible, I'd like to make them unable to attack their own minions AT ALL, and that the minion stays ''friendly'' toward them.


Maybe there's a way to make the blue team perceive blue minions with a green nameplate?


Anyone can help me out?


Thanks! Beside that i only need to implement jungle creeps and items and the module will be ready for launch!



               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
NWN moba scripting help
« Reply #6 on: March 15, 2015, 04:27:58 pm »


               

Edit: Wrong topic :|