Ludeon Forums

Ludeon Forums

  • January 19, 2019, 05:32:12 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Utility mod request  (Read 134 times)

Krolon

  • Drifter
  • **
  • Posts: 56
  • Refugee
    • View Profile
Utility mod request
« on: January 09, 2019, 04:36:05 PM »

Could anyone make a small mod that would add a button for turrets to become extremely hostile? I mean shooting wild animals.
(yes, I do know that it sounds like cheesy hunt, but instead I rather want it to make a wide open gate and I do not want wild animals to wander into my base :/)
Logged

dninemfive

  • Drifter
  • **
  • Posts: 57
  • Refugee
    • View Profile
Re: Utility mod request
« Reply #1 on: January 11, 2019, 12:50:20 AM »

This is actually a good first mod project, if you're up to the challenge. Use this tutorial for setup, then modify the methods in "Building_Turret" to return wild animals in addition to hostiles.
Logged

Krolon

  • Drifter
  • **
  • Posts: 56
  • Refugee
    • View Profile
Re: Utility mod request
« Reply #2 on: January 11, 2019, 11:38:32 AM »

Uhhh, I understand the "fish and fishing rod" help type, and I actually do appreciate it, but I have no experience whatsoever, gonna try tho  :D
Logged

Krolon

  • Drifter
  • **
  • Posts: 56
  • Refugee
    • View Profile
Re: Utility mod request
« Reply #3 on: January 11, 2019, 02:52:29 PM »

okay I don't even know how to start... I'm not even reading about all the C# stuff because I've read through some XMLs at least a couple times and I just do not understand how the targeting works, I don't even see it
Logged

LWM

  • Drifter
  • **
  • Posts: 80
  • Little White Mouse
    • View Profile
Re: Utility mod request
« Reply #4 on: January 12, 2019, 01:21:32 PM »

This is actually a good first mod project, if you're up to the challenge. Use this tutorial for setup, then modify the methods in "Building_Turret" to return wild animals in addition to hostiles.

Aaaaah...did you look at Building_Turret?  You actually want to look at Building_TurretGun, which has the targeting logic.

Also...you didn't post a link to Harmony, and that's probably what you'd need to modify the default Turret.  And by "that's probably what you'd need" I mean you'd probably have to patch an anonymous delegate validator function (AttackTargetFinder.cs, BestAttackTarget(...)).  Not even close to appropriate for the faint of heart or low on experience.

Heh.  Oops.

OP:  If you're up for the adventure of coding, I think the way to do it is to create a type of turret that's specifically anti-wildlife......actually, you can't simply derive from the original class, because TryFindNewTarget() is "protected."  Well, F.

Also, you'd have to rewrite a fair bit of targeting code, because everything - EVERYTHING - has checks to make sure the target is hostile.

Just how much do you want this mod ;)  It's still doable :p  (also, do you care if it shoots your own animals?  I think that would be more fun, tbh - make the player work to keep them safe from the really stupid AI...)

--LWM

Logged

Krolon

  • Drifter
  • **
  • Posts: 56
  • Refugee
    • View Profile
Re: Utility mod request
« Reply #5 on: January 13, 2019, 06:36:05 AM »

Weeeell, that doesn't sound any easier... I've never had experience with coding and never even felt a need to learn to code...
Logged

LWM

  • Drifter
  • **
  • Posts: 80
  • Little White Mouse
    • View Profile
Re: Utility mod request
« Reply #6 on: January 14, 2019, 09:52:16 AM »

Have you ever felt a *desire* to learn?

If not, you may have to ply a programmer with caffeine while they write something ;)

--LWM

PS - Or booze, no judging here.  Or caffeine and booze.  I don't recommend offering yayo or flake, tho.
Logged

Krolon

  • Drifter
  • **
  • Posts: 56
  • Refugee
    • View Profile
Re: Utility mod request
« Reply #7 on: January 14, 2019, 10:20:12 AM »

yes, I have, but not for coding
Logged

LWM

  • Drifter
  • **
  • Posts: 80
  • Little White Mouse
    • View Profile
Re: Utility mod request
« Reply #8 on: January 14, 2019, 06:32:51 PM »

That's what I meant ;p
Logged

Krolon

  • Drifter
  • **
  • Posts: 56
  • Refugee
    • View Profile
Re: Utility mod request
« Reply #9 on: January 17, 2019, 10:13:35 AM »

I guess it's just not going to happen...
Logged