-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Component Authoring Guide
Oge Nnadi edited this page Jun 7, 2017
·
5 revisions
Contained within will be some tips and tricks as well as solutions for common "gotchas" that might afflict the inexperienced Artisan.
- Under the Hero Placeholder, go to programming.Programmable and add the method name under programmableProperties
- Go to the Components Tab
- Under the inventory.Item component (in the list) add the name of the method to the plannableMethods array
- Under the programming.Plans component (also in the list,) add the name of the method to the plannableMethods array, too
- Select any component. Select the arrow of the smaller box and choose 'Create New Component'
- Assign it to a system and give it a name.
- Go back to the Thangs Tab and add this component to the Hero Placeholder
- Test run the level and try using the method! (The hero should attack themselves, as that is the default code)
- Go to the combat.Bashes component, copy paste everything, and put it in your new component commented out (surround it by ### ### which is like /* */ in JS)
- Observe the 'attach', and 'bash' methods.
The following is a broad overview of what occurs under the hood:
World Base Class
The world contains a set of Systems, Thangs and their Components.
System Base Class
Systems are a set of actions that are performed on applicable Thangs.
- The Collision System ensures collision objects don't overlap.
- The AI System controls the logic for the NPCs, such as Yaks or Ogres.
Thang Base Class
Thangs are individual entities which contain Components.
- An Arrow is a Thang.
- An Ogre is a Thang.
Component Base Class Components are parts which sum to make an entire Thang.
- A common Peasant is made up of the following:
- Acts
- FindsPaths
- Allied
... - Sees
Describe how to efficiently make a spell here.
Describe how to make an ability.
- Enemies consist of very rudimentary intelligence. Spell-based enemies (such as Shaman,) employ the component 'ai.AutoCasts' for their spell repertoire, which automatically cycles through all their available spells and attempts to cast them if they are off cooldown.
- Note that the actual logic (who they are casting on, when to cast,) is locked in the individual function defined inside the spell.
- If your Thang spawns another Thang (such as shooting or summoning,) you must include a "requiredThangTypes" in the config schema, as this preloads the assets required.
- If spawning in a location, be sure to check to see if the position to spawn is actually 'clear' of obstacles.
- When creating a programmable action (such as bash or summon,) it needs to be added to the programming.Plans PlannableMethods array.
CodeCombat | Home | Blog | Forum | Teachers | Legal | Contribute
- Home
- Archmage Home
- Artisan Home
- Diplomat Home
- Archmage General
- Mission statement
- Coco Models
- Coding Guidelines
- Cookbook
- File system
- JSON Schema
- Technical overview
- Testing
- Third party software and services
- Artisan General
- Building A Level
- Coding Guidelines for Artisans
- Editing Thang Components
- Important Artisan Concepts
- Keyboard Shortcuts
- Debugging
- Artisan How-To Index
- Diplomat General
- i18n
- i18n Glossary nb
- i18n Glossary ru
- i18n Glossary es-419
- Dev Setup
- Dev Setup: Linux
- Dev Setup: Windows
- Dev Setup: Mac
- Dev Setup: Vagrant
- Dev Setup: Issues
- Game Engine
- Component
- Multiplayer
- Surface
- System
- Thang
- Thang Component System
- Tome
- World
- Artisan Tabs
- Components And Systems
- Scripts
- Settings
- Thangs
- Other
- Aether
- Client models
- Developer organization
- Educational Standards
- Events, subscriptions, shortcuts
- Chat Room
- Chat Room Rules
- Permissions
- Project Ideas List
- Treema
- Versioning
- Views