Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
function wardenrepair()
warden_2.brain:seek(16,17)
end
I disabled monster component
After the first step he gets stuck frozen. What am i missing?
the location he needs to walk to is 3 steps forward. There is nothing blocking him.
warden_2.brain:seek(16,17)
end
I disabled monster component
After the first step he gets stuck frozen. What am i missing?
the location he needs to walk to is 3 steps forward. There is nothing blocking him.
- Zo Kath Ra
- Posts: 937
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
1. you should disable the BrainComponent, not the MonsterComponent, to stop the monster from moving on its own
2. seek() only takes one step, it doesn't put the monster into some kind of seeking state, it just takes one step towards the target
2. seek() only takes one step, it doesn't put the monster into some kind of seeking state, it just takes one step towards the target
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
I think I'm missing something on my math here and I can't figure out what it is. I can't get "nothing" to spawn more then the others, I keep getting the same amount, definitely more then 80% its more like 20% even if I have my math set to 50%. Most likely I'm doing something wrong.
That should spawn "nothing" 80% no?
That is my "nothing" object.
EDIT: Ok I think I found my problem LOL.. I can't do this can I?
What would be the proper way to spawn 3 separate details on the same tile?
Code: Select all
local autoDecoFloorDetail2 = function(self)
local g = self.go
local choice = math.random()
if choice <= 0.04 then
spawn("rc_ground_tiles_04",g.level,g.x,g.y,math.random(0,3),g.elevation)
elseif choice <= 0.08 then
spawn("rc_ground_tiles_02",g.level,g.x,g.y,math.random(0,3),g.elevation)
elseif choice <= 0.12 then
spawn("rc_ground_tiles_05",g.level,g.x,g.y,math.random(0,3),g.elevation)
elseif choice <= 0.16 then
spawn("rc_ground_tiles_03",g.level,g.x,g.y,math.random(0,3),g.elevation)
elseif choice <= 0.20 then
spawn("rc_ground_tiles_01",g.level,g.x,g.y,math.random(0,3),g.elevation)
else
spawn("nothing",g.level,g.x,g.y,math.random(0,3),g.elevation)
end
end
Code: Select all
defineObject{
name = "nothing",
baseObject = "base_floor_decoration",
components = {
{
class = "Null",
},
},
editorIcon = 96,
}
EDIT: Ok I think I found my problem LOL.. I can't do this can I?
Code: Select all
defineObject{
name = "base_cave_ground",
baseObject = "base_floor",
components = {
{
class = "Null",
name = "grass",
onInit = autoDecoFloorDetail,
},
{
class = "Null",
name = "tiles",
onInit = autoDecoFloorDetail2,
},
{
class = "Null",
name = "pebbles",
onInit = autoDecoFloorDetail3,
},
},
}
Re: Ask a simple question, get a simple answer
It's not clear to me what your objective is here. Why do you have this "nothing" object at all, instead of just not spawning anything there? You have three of these autoDecoFloorDetail functions but are only showing one of them, are the others similar?
The function you posted does spawn "nothing" 79.999999999999977796% of the time, so there's something you're not showing us.
The function you posted does spawn "nothing" 79.999999999999977796% of the time, so there's something you're not showing us.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
I am stupid ROFLMAO.. turns out when I was exporting my pebbles I had a floor tile not hidden on another layer hahahaha. so when I was running them all I thought I was getting more tiles. O M G .. face palm.minmay wrote: ↑Sat Apr 06, 2019 6:22 am It's not clear to me what your objective is here. Why do you have this "nothing" object at all, instead of just not spawning anything there? You have three of these autoDecoFloorDetail functions but are only showing one of them, are the others similar?
The function you posted does spawn "nothing" 79.999999999999977796% of the time, so there's something you're not showing us.
Yes I have 3 separate functions running on the same floor tile and I want there to be a chance nothing will spawn there. basically I want there to be a chance for a tile,pebble and grass with a mix of the 3. So you could have a grass and a tile, tile and a pebble, just a tile etc.
On another note how would I get nothing to spawn there on the "else"? or can you end it with "elseif"?
Last edited by vanblam on Sat Apr 06, 2019 6:56 am, edited 1 time in total.
Re: Ask a simple question, get a simple answer
um...if you want to do nothing, you don't need an "else" at all, just put the "end" there!
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
Code: Select all
if choice3 >= 0.4 then
spawn("rc_ground_pebbles_04",g.level,g.x,g.y,math.random(0,3),g.elevation)
elseif choice3 >= 0.5 then
spawn("rc_ground_pebbles_01",g.level,g.x,g.y,math.random(0,3),g.elevation)
elseif choice3 >= 0.6 then
spawn("rc_ground_pebbles_02",g.level,g.x,g.y,math.random(0,3),g.elevation)
elseif choice3 >= 0.7 then
spawn("rc_ground_pebbles_03",g.level,g.x,g.y,math.random(0,3),g.elevation)
end
Re: Ask a simple question, get a simple answer
Exactly like that.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.