Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I create a few NPCs that will fight alongside the player? #6

Open
Himesjb opened this issue Sep 24, 2018 · 5 comments
Open

How do I create a few NPCs that will fight alongside the player? #6

Himesjb opened this issue Sep 24, 2018 · 5 comments

Comments

@Himesjb
Copy link

Himesjb commented Sep 24, 2018

I want to have 4 NPCs or so who will fight along with the player in my game. Is there a way to create a Monster with CombatLib who will befriend the player and fight with him? I have looked up this set of instructions...
image

...but I can't figure out how or where to access this list (game.friends). I did Ctrl-F and searched for it in the code view of my game, and also in CombatLib, but I just don't see where I should plug it in.

@ThePix
Copy link
Owner

ThePix commented Sep 24, 2018

Say you have a monster called "friendly monster", put this in the game start script:

do(friendly monster, "settodefend")

@Himesjb
Copy link
Author

Himesjb commented Sep 25, 2018

Thank you!

@Himesjb
Copy link
Author

Himesjb commented Sep 25, 2018 via email

@Himesjb
Copy link
Author

Himesjb commented Oct 6, 2018

Okay, so I tried this, but now the ‘friendly monster’ I created will only attack himself. I wonder if I’m leaving something out. What do I need to add to make him attack the other monsters in the room (instead of himself) ? I have tried looking through the code, but I can't figure it out. What file and what chunk of code would be crucial for this to work out?

@glen-mills
Copy link

#9 (comment)

Try this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants