Jump to content

[scripting] auto aggro character?


Recommended Posts

hi, i'm insanely new to scripting, but i'm finding no answers on how to make an aggro character?

 

i am trying to make a mod where one of the character's flaws is that when his sanity gets too low and he's not moving around or doing something else (or if he doesn't have a weapon equipped, but i'm not sure if i want that one yet), he runs towards them to attack.

 

it's inconvenient, yes, but i'm going to make this instinct something very low, to the point of seeing horrors or perhaps to the point where you can actually attack them) before it kicks in, but i don't know if this is doable?

 

my first thought was to go through willow's actions, as she impulsively starts fires depending on her sanity, but i don't know how to turn it into fighting? and i'm also afraid that if i do this, charlie may count as a monster and he'll run directly into the dark?

 

has anyone else scripted this before? or is this too much to bother with as a flaw?

Link to comment
Share on other sites

charlie may count as a monster and he'll run directly into the dark?
 Charlie isn't an entity, it's actually a component ("grue") attached to players. So that won't be a problem. But... this sounds really tricky. I'm guessing you'd want to look at the RPC handlers for action.attack or something, and issue that on the nearest enemy where it would spawn willowfire in Willow's firebug component (obviously make a copy of that component and rename it).

 

The RPC handlers are in networkclientrpc, in scripts.

Link to comment
Share on other sites

 Charlie isn't an entity, it's actually a component ("grue") attached to players. So that won't be a problem. But... this sounds really tricky. I'm guessing you'd want to look at the RPC handlers for action.attack or something, and issue that on the nearest enemy where it would spawn willowfire in Willow's firebug component (obviously make a copy of that component and rename it).

 

The RPC handlers are in networkclientrpc, in scripts.

 

 

do you think it's even worth it to bother with scripting it? i think it would be an exciting element to add (if only because it'd be a new thing i haven't seen in other mods), but i dont know if that's too big of a flaw to have??

 

but thank you for your help!!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...