[committed] GameNPC Style Support.

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

[committed] GameNPC Style Support.

Postby geshi » Mon May 09, 2011 2:02 pm

It's now possible to give NPC's styles to use :mrgreen:
Attachments
gamenpc_style_support.patch
(1.16 KiB) Downloaded 64 times
geshi
Contributor
 
Posts: 1826
Joined: Tue Oct 21, 2008 9:16 pm

Re: GameNPC Style Support.

Postby Argo » Mon May 09, 2011 3:23 pm

GESH I LOVE YOU :mrgreen:
Möge Gott sein zwischen Dir und dem Leid, an allen dunklen und verlassenen Orten, die Du erreichen wirst.
Argo
Server Team
 
Posts: 1760
Joined: Thu Sep 18, 2008 6:21 pm
Location: Berlin, Germany

Re: GameNPC Style Support.

Postby Dinberg » Mon May 09, 2011 4:33 pm

Good job! May I suggest something Gesh:
Code: Select all
Properties.GAMENPC_CHANCES_TO_STYLE + Styles.Count
This doesnt make sense in the context of Util.Chance(). Potentially I could see this value being greater than 100 - if for example GAMENPC_CHANCES_TO_STYLE = 100. I'm not sure what Chance() does then, probably just ignore it but its still odd logic.

I thought perhaps you may be trying to make it so that NPCs with more styles, style more often. If this is the case, perhaps do something like:
Code: Select all
int chance = Math.Min(100, Properties.GAMENPC_BASE_STYLE_CHANCE + Styles.Count * Properties.GAMENPC_EXTRA_STYLE_CHANCE);
if (Properties.GAMENPC_BASE_STYLE_CHANCE == 0) chance = 0;
Properties.GAMENPC_EXTRA_STYLE_CHANCE ~ 5 (just so we dont have any magic numbers lying about!)
(Theres a more compact way of writing this using ?, : and ;, but I wanted to illustrate the point clearly.)

mainly because I dont think just 1% difference per style will make a noticeable difference.

Another note: 'StyleProcessor.CanUseStyle(this, style, AttackWeapon)' will always return false for an invalid attack weapon, which most npcs will have. IIRC npc equipment added via npctemplate is purely aesthetic, and swords added in this way will never be used for sword styles. Geshi, can you verify that the patch works for npcs produced by NPCTemplate (which is the primary method I imagine the db team will have access to assigning styles in the first place)?

EDIT: Scratch that last point, just checked the code and its got an override for NPCs:

CanUseStyle:
Code: Select all
169 if (!CheckWeaponType(style, living, weapon))
170 return false;
Code: Select all
602 protected static bool CheckWeaponType(Style style, GameLiving living, InventoryItem weapon)
603 {
604 if (living is GameNPC)
605 return true;
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: GameNPC Style Support.

Postby geshi » Mon May 09, 2011 4:45 pm

Yeah, I just took the code from GamePet and put it in GameNPC, I tested it out, I gave a mob the Slam style he was slamming with no weapons, not sure if that's a problem.
geshi
Contributor
 
Posts: 1826
Joined: Tue Oct 21, 2008 9:16 pm

Re: GameNPC Style Support.

Postby Argo » Mon May 09, 2011 4:57 pm

Dangit, i was just falling in love with ya gesh :mrgreen:
ok, serious now, i'll wait for a corrected version from you :)

kind regards
Argo
Möge Gott sein zwischen Dir und dem Leid, an allen dunklen und verlassenen Orten, die Du erreichen wirst.
Argo
Server Team
 
Posts: 1760
Joined: Thu Sep 18, 2008 6:21 pm
Location: Berlin, Germany

Re: GameNPC Style Support.

Postby Dinberg » Mon May 09, 2011 5:12 pm

To be honest, I dont see it as an issue - reason being by specifying the styles in npctemplate, we can also specify the weapons that mob will have; we can make it so a mob always has appropriate weapons for the styles they use.

I also like the idea of unarmed mobs being able to style (eg hand to hand styles)
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: GameNPC Style Support.

Postby geshi » Mon May 09, 2011 6:14 pm

Hmm yeah, it would be quite silly to have to give a Hunter Wolf pet a sword so it can use the Garrote style, the only other option is making an entirely new style, which has no weapon req.
geshi
Contributor
 
Posts: 1826
Joined: Tue Oct 21, 2008 9:16 pm

Re: GameNPC Style Support.

Postby Phen » Mon May 09, 2011 10:24 pm

iirc when someone uses a style on you, you aren't notified what specific style they used anyways, so I don't see a reason to make a new style just for mobs to use, the only important thing is the effect of the style,whether it be greater damage, a bleed, snare, stun, or debuff. And as far as I'm concerned monsters defy any reasoning to have a weapon to do special damage anyways, they are rebels and they think outside of the box they use claws and teeth and sheer strength to hurt their opponent. Good work Geshi, I hope to see something like this for Storm and DOL.
Phen
Storm GM
 
Posts: 674
Joined: Thu Jun 12, 2008 12:55 am
Yahoo Messenger: KerzedSoul@yahoo.com

Re: GameNPC Style Support.

Postby Graveen » Tue May 10, 2011 9:06 am

accepted, soon in SVN, thank you ! :)

good job :)

bascially, i think the weapon restriction should only apply GamePlayer. Up to the designer to give proper weapons to proper NPCs.

The best 'd be to use bodytype to trigger the check - ie humanoid 'd be checked for weapons while animals won't - but we would have to handle the werewolf-like cases (are the humanoids ? are they animals ?). Notice, BodyType is actually not good (a number for a specified bodytype), and must be a multiple flag system (like we handle NPC flag: a mob can have multiple bodytypes).

DOL afternoon and DOL evening for me, tons of things to include in SVN and website stuff to check ! :)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: GameNPC Style Support.

Postby rdsandersjr » Tue May 10, 2011 11:06 am

Well, like you said the designer should be responsible for allowing certain styles not the code. I.E: that big scary doggy jumps at you and stuns you (aka uses shield slam!) =)
Thanks,
RDSandersJR
User avatar
rdsandersjr
Support Team
 
Posts: 1089
Joined: Fri Aug 01, 2008 3:01 pm
Location: Cincinnati, Ohio

Re: GameNPC Style Support.

Postby Dinberg » Tue May 10, 2011 12:12 pm

Thing is, I don't know if any of these npcs will correctly apply combat effects, because these are sorted by class id afaik
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: GameNPC Style Support.

Postby geshi » Tue May 10, 2011 12:14 pm

I attached slam to a mob last night, and he slammed me (gave me immunity etc).. I don't see any problem.

The next step is ofc making mobs do follow up styles and focus on backstyling of the monster is behind the target etc..
geshi
Contributor
 
Posts: 1826
Joined: Tue Oct 21, 2008 9:16 pm

Re: GameNPC Style Support.

Postby Dinberg » Tue May 10, 2011 11:39 pm

If you have access to the storm SVN check out the AI in the personal dungeons system, it does all of this
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: GameNPC Style Support.

Postby geshi » Tue May 10, 2011 11:47 pm

Nop, but it sounds awesome :mrgreen:
geshi
Contributor
 
Posts: 1826
Joined: Tue Oct 21, 2008 9:16 pm

Re: GameNPC Style Support.

Postby Dinberg » Wed May 11, 2011 8:40 pm

I'll see if I can upload the system to user files later tonight
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest