Awesome. Couldn't deduce it was that. Thank you so much!NutJob wrote:It'll trigger the connector when it starts (0.0) and at your timerInterval (like normal).
Ask a simple question, get a simple answer
- TheLastOrder
- Posts: 104
- Joined: Wed Oct 17, 2012 1:56 am
Re: Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
Hello everyone. I'm new here.
Thought messing around with the Grimrock editor would be a good way to try out programming/level design.
So, I have a simple question: How can I offset the location of an item within a cell? Such as placing a turtle egg in the middle of the nest.
Thanks!

So, I have a simple question: How can I offset the location of an item within a cell? Such as placing a turtle egg in the middle of the nest.
Thanks!
Re: Ask a simple question, get a simple answer
hi, yes.Kaliflour wrote:Hello everyone. I'm new here.Thought messing around with the Grimrock editor would be a good way to try out programming/level design.
So, I have a simple question: How can I offset the location of an item within a cell? Such as placing a turtle egg in the middle of the nest.
Thanks!
check game reference for gameobject - there is more you can do with item. for example:
GameObject:getPosition()
GameObject:setPosition(x, y, facing, elevation, level)
GameObject:setWorldPosition()
GameObject:setWorldPositionY(y)
GameObject:setWorldRotation(…)
GameObject:setWorldRotationAngles(x, y, z)
GameObject:setWorldRotationAnglesWithOrder(x, y, z, order)
so for example you can move your item like this
youritemname:setWorldPosition(vec(3.002938, 0.00000, 3.054278, 0.000000))
Re: Ask a simple question, get a simple answer
Thanks Drakkan! Got it working now.
EDIT: Just found setSubtileOffset(). Seems to be an easier way of doing what I wanted to do. Thanks for pointing me to the right place in the scripting reference.
EDIT: Just found setSubtileOffset(). Seems to be an easier way of doing what I wanted to do. Thanks for pointing me to the right place in the scripting reference.
- cromcrom
- Posts: 549
- Joined: Tue Sep 11, 2012 7:16 am
- Location: Chateauroux in a socialist s#!$*&% formerly known as "France"
Re: Ask a simple question, get a simple answer
Ok, my turn 
I have this code in monsters.lua, but the placed monsters do not have these attributes...
Any help please ?

I have this code in monsters.lua, but the placed monsters do not have these attributes...
Code: Select all
defineObject{name = "crom_fjeld_warg",
baseObject = "fjeld_warg",
components = {
{
class = "Health",
name = "health",
spawnOnDeath = "",
health = 20,
onDie = function(self)
for i=1,math.random(5,10) do
spawn("coin_copper")
end
end,
},
}
}
A trip of a thousand leagues starts with a step.
-
- Posts: 168
- Joined: Thu Oct 30, 2014 1:56 am
Re: Ask a simple question, get a simple answer
I think you need to change the monster component, not health.
EDIT:
I used something like this to pull the values from the default wargs
EDIT:
Code: Select all
defineObject{name = "crom_fjeld_warg",
baseObject = "fjeld_warg",
components = {
{
class = "Monster",
meshName = "fjeld_warg_mesh",
level= 1,
health = 20,
maxHealth = 20,
exp = 60,
hitSound = "warg_hit",
hitEffect = "hit_blood_black",
dieSound = "warg_die",
onDie = function(self)
for i = 1,math.random(5,10) do
spawn("rock")
end
end,
},
}
}
I used something like this to pull the values from the default wargs
Code: Select all
m = fjeld_warg_1
print(m.monster:getCapsuleHeight())
print(m.monster:getCapsuleRadius())
print(m.monster:getCollisionRadius())
print(m.monster:getCurrentAction())
print(m.monster:getDeathEffect())
print(m.monster:getDieSound())
print(m.monster:getEvasion())
print(m.monster:getExp())
print(m.monster:getFlying())
print(m.monster:getFootstepSound())
print(m.monster:getGroupSize())
print(m.monster:getHeadRotation())
print(m.monster:getHealth())
print(m.monster:getHitEffect())
print(m.monster:getHitSound())
print(m.monster:getIdleAnimation())
print(m.monster:getImmunities())
print(m.monster:getLevel())
print(m.monster:getLootDrop())
print(m.monster:getMaxHealth())
print(m.monster:getMeshName())
print(m.monster:getProtection())
print(m.monster:getShape())
Re: Ask a simple question, get a simple answer
The most safe way is to copy original warg asset and just change what you want to change (e.c. health, drop etc...)cromcrom wrote:Ok, my turn![]()
Code: Select all
defineObject{
baseObject = "base_monster",
name = "cromrcom_sand_warg",
components = {
{
name = "model",
class = "Model",
storeSourceData = true,
model = "assets/models/monsters/sand_warg.fbx"
},
{
animations = {
fall = "assets/animations/monsters/sand_warg/sand_warg_get_hit_front_left.fbx",
attack = "assets/animations/monsters/sand_warg/sand_warg_attack.fbx",
turnRight = "assets/animations/monsters/sand_warg/sand_warg_turn_right.fbx",
moveForwardTurnRight = "assets/animations/monsters/sand_warg/sand_warg_walk_turn_right.fbx",
getHitFrontLeft = "assets/animations/monsters/sand_warg/sand_warg_get_hit_front_left.fbx",
getHitBack = "assets/animations/monsters/sand_warg/sand_warg_get_hit_back.fbx",
getHitFrontRight = "assets/animations/monsters/sand_warg/sand_warg_get_hit_front_right.fbx",
moveForwardTurnLeft = "assets/animations/monsters/sand_warg/sand_warg_walk_turn_left.fbx",
howl = "assets/animations/monsters/sand_warg/sand_warg_howl.fbx",
moveForward = "assets/animations/monsters/sand_warg/sand_warg_walk.fbx",
turnLeft = "assets/animations/monsters/sand_warg/sand_warg_turn_left.fbx",
idle = "assets/animations/monsters/sand_warg/sand_warg_idle.fbx",
getHitLeft = "assets/animations/monsters/sand_warg/sand_warg_get_hit_left.fbx",
getHitRight = "assets/animations/monsters/sand_warg/sand_warg_get_hit_right.fbx"
},
class = "Animation",
name = "animation",
currentLevelOnly = true
},
{
lootDrop = {
75,
"warg_meat",
10,
"warg_meat"
},
hitSound = "warg_hit",
resistances = {
poison = "weak"
},
health = 400,
class = "Monster",
traits = {
"animal"
},
meshName = "sand_warg_mesh",
headRotation = {
90,
0,
0,
0 },
exp = 350,
hitEffect = "hit_blood_black",
capsuleRadius = 0.7,
dieSound = "warg_die",
name = "monster",
capsuleHeight = 0.2
},
{
class = "WargBrain",
name = "brain",
sight = 5
},
{
sound = "warg_walk",
class = "MonsterMove",
name = "move",
cooldown = 0.5
},
{
sound = "warg_walk",
class = "MonsterTurn",
resetBasicAttack = true,
name = "turn"
},
{
resetBasicAttack = true,
turnDir = 1,
cooldown = 2,
sound = "warg_walk",
class = "MonsterMove",
name = "moveForwardAndTurnRight",
animations = {
forward = "moveForwardTurnRight"
}
},
{
resetBasicAttack = true,
turnDir = -1,
cooldown = 2,
sound = "warg_walk",
class = "MonsterMove",
name = "moveForwardAndTurnLeft",
animations = {
forward = "moveForwardTurnLeft"
}
},
{
woundChance = 30,
pierce = 5,
class = "MonsterAttack",
accuracy = 15,
cooldown = 3,
sound = "warg_attack",
screenEffect = "damage_screen",
name = "basicAttack",
attackPower = 35
},
{
animation = "howl",
class = "MonsterAction",
name = "howl",
cooldown = 60
}
}
}
-
- Posts: 168
- Joined: Thu Oct 30, 2014 1:56 am
Re: Ask a simple question, get a simple answer
Where did you get the definitions for that?
Re: Ask a simple question, get a simple answer
and most easy way is to use cloneObject 
(since you are already using it)

(since you are already using it)
Code: Select all
cloneObject{
name = "crom_fjeld_warg",
baseObject = "fjeld_warg",
components = {
{
class = "Monster",
health = 20,
onDie = function(self)
for i = 1,math.random(5,10) do
spawn("coin_copper")
end
end,
}
}
}
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450
- cromcrom
- Posts: 549
- Joined: Tue Sep 11, 2012 7:16 am
- Location: Chateauroux in a socialist s#!$*&% formerly known as "France"
Re: Ask a simple question, get a simple answer
Waow, I hardly have time to set up my random spawn system, and look at all this O_O . Thanks you so much guys, my issue was with monster class. Thanks again, crediting 

A trip of a thousand leagues starts with a step.