However I have trouble with the monsterattack component.
Code: Select all
local newAttPow = spawnthing.monsterattack:getAttackPower() Any Ideas please ?
Code: Select all
local newAttPow = spawnthing.monsterattack:getAttackPower() I'm not trying to contradict or be difficult, just understand it a bit better. The Asset Pack should simply implement the Scripting Reference, and in this case it doesn't seem to do that. Quite the opposite at first glance (albeit with inexperience eyes).MonsterAttackComponent (MonsterActionComponent)
Implements a monster attack action. A monster can have more than one attacks.
MonsterAttackComponent:getAccuracy()
MonsterAttackComponent:getAnimationSpeed()
MonsterAttackComponent:getAnimations()
MonsterAttackComponent:getAttackFromBehindAnimation()
MonsterAttackComponent:getAttackPower()
With that, I can successfully type the following script command:CrystalComponent (Component)
Implements the animation and behavior of healing crystals.
CrystalComponent:activate()
CrystalComponent:deactivate()
CrystalComponent:getCooldown()
CrystalComponent:setCooldown(number)
Entities, game objects (or just “go”) are the objects spawned in the dungeon either by placing them in the dungeon using the Dungeon Editor or spawning them dynamically from a script. For example, instances of buttons, pressure plates, teleporters and the party are all entities. Each entity has an id, a string which identifies the entity uniquely. You can refer to an entity by simply typing it’s id. For example, the following script prints the world coordinates of the entity with the id “party” to the console:
print(party:getWorldPosition())
Entities themselves do not have much useful functionality. Instead, interesting objects are made by adding components to the entities. For example, you would build an object with a 3D model that emits a continuous sound by adding a Model and a Sound component to an entity. A component is always created and owned by a single entity and components cannot exists without an entity. Each component has a class, e.g. Door and Model are classes, and a name which uniquely identifies the components inside its entity. By default the name of a component is the class name in lower case but you can pick any name when defining assets. Usually one entity can have only one component of a kind (for example, single Door component per entity) but some components do not have this restriction. For example, an entity can have any number of Model, Light, Particle and Sound components. In this case, each component must be explicitly and uniquely named (for example, “model1″, “model2″).