Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Creating a new creature  (Read 2103 times)

Mrprofilen

  • Escaped Lunatic
  • Hi.
    • View Profile
Creating a new creature
« on: December 08, 2016, 12:58:28 am »

Hello. I am messing around with the code of the game, trying to figure out some of the basics. So, I want to add a new law enforcement "character" to encounter.

So, in Creature.html, I would create a new creature with all the stats, then in creaturetypes.cpp, add it to the list. Also, in creaturetype.cpp, I'd add him to the allowed list of people that spawn in the police station. In creature.cpp, I'd add him to the kidnap resistant list, and add him to the Report to Police section" also. In creature.h, add him to the list. Now, this "should" add him to the list of creatures, but I am 100% sure I'm missing something. I'm just looking for some basic tips, not a guide per-see, I like figuring things out myself.  Any thing else I should do? Will this "character" be seen throughout all locations?
Logged

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Creating a new creature
« Reply #1 on: December 08, 2016, 11:36:39 am »

Yeah, you've added your creature to the game, but the game does not know how to spawn the creature if it appears, and has no idea of where to spawn them.

-The locations are in the function prepareencounter() in newencounter.cpp
-You need to enable the game to recognize the creature in the HTML file by adding an entry in creaturetype_string_to_enum() in stringconversion.cpp
Logged

Mrprofilen

  • Escaped Lunatic
  • Hi.
    • View Profile
Re: Creating a new creature
« Reply #2 on: December 08, 2016, 08:17:39 pm »

Thank you, I was looking for that. I saw it one time before but I couldn't remember where I did.
Logged

shadowgod3211

  • Bay Watcher
    • View Profile
Re: Creating a new creature
« Reply #3 on: December 08, 2016, 10:47:25 pm »

how do you even make actions like kidnapping in source code?? cause i think i found the thing to make the action but i don't know what to use for return type and parameter type to use for the action

the thing is i want to make a sleeping gas grenade or a non lethal shock grenade to use on enemies and mutant animals or even kidnap the president with it
Logged

SlatersQuest

  • Bay Watcher
    • View Profile
Re: Creating a new creature
« Reply #4 on: December 09, 2016, 09:39:01 pm »

You need to look up the function definition, which will tell you what the matching object types are. The function definitions are contained in the various .h files scattered around in the src/ directory.

Beyond that your question is not detailed enough that I can really follow how to answer it.
Logged