Ask a simple question, get a simple answer
-
- Posts: 13
- Joined: Wed Feb 04, 2015 9:05 pm
Re: Ask a simple question, get a simple answer
It's ok that worked as intended after tweaking it at little to suit my needs.
Thank very much for helping me Isaac. I really appreciate it.
Thank very much for helping me Isaac. I really appreciate it.
Re: Ask a simple question, get a simple answer
rlewarne04 wrote:It's ok that worked as intended after tweaking it at little to suit my needs.
Thank very much for helping me Isaac. I really appreciate it.
Try this (in item.lua):AndakRainor wrote:Thanks ! So any idea how I could access all the spells definitions in this function and for each get its name and uiName (the two values necessary to define a spell scroll) ?
Code: Select all
function makeScrolls()
local spellNames = { -- replace "blob" with your own spell names. Add more entries if you need them.
"blob",
"blob",
"blob",
}
for x = 1, #spellNames do
defineObject{
name = "scroll_"..spellNames[x],
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/scroll_spell.fbx",
},
{
class = "Item",
uiName = "Scroll of "..string.gsub(string.gsub(string.sub("_"..spellNames[x],1), "_.", string.upper),"_", " "),
gfxIndex = 113,
weight = 0.3,
},
{
class = "SpellScrollItem",
spell = spellNames[x]
},
},
}
end
end
makeScrolls()
- Duncan1246
- Posts: 404
- Joined: Mon Jan 19, 2015 7:42 pm
Monster's limited movements
I want to limit monster's movements to an open area (without walls or such). I have made it in LoGI with "onMove" and a function, but I think it's a little bit more complicated with LoG2. What about "on PerformAction"? What syntax I have to choose?
Thanks for yours replies.
Duncan 1246
Thanks for yours replies.
Duncan 1246
Re: Monster's limited movements
why you cant just use blocker objects ?Duncan1246 wrote:I want to limit monster's movements to an open area (without walls or such). I have made it in LoGI with "onMove" and a function, but I think it's a little bit more complicated with LoG2. What about "on PerformAction"? What syntax I have to choose?
Thanks for yours replies.
Duncan 1246
- Duncan1246
- Posts: 404
- Joined: Mon Jan 19, 2015 7:42 pm
Re: Ask a simple question, get a simple answer
You are right for one elevation areas, but I have some elevated areas with bridges and I want that some monsters patrolls on it without jumping down...Drakkan wrote: why you cant just use blocker objects ?
Duncan
Re: Ask a simple question, get a simple answer
Jumping down?
AFAIK monsters stay on their elevation - except for flying monsters (like uggardians). But you could place blockers in the air by elevation +1/2/3...
AFAIK monsters stay on their elevation - except for flying monsters (like uggardians). But you could place blockers in the air by elevation +1/2/3...
- Duncan1246
- Posts: 404
- Joined: Mon Jan 19, 2015 7:42 pm
Re: Ask a simple question, get a simple answer
So for elevations I am worring about nothing... but for open areas it seems to me that multiply blockers is an heavy solution... i hoped to define paths included in a monster's hook, it's my first reason for asking about "onMove". With a defined path by monster, I could have differents paths for different monsters in the same area. What to do you think?THOM wrote:Jumping down?
AFAIK monsters stay on their elevation - except for flying monsters (like uggardians). But you could place blockers in the air by elevation +1/2/3...
Duncan
Re: Ask a simple question, get a simple answer
I'm far from a Pro on the available options to achieve a Monster Patrol Path, but if I were going to attempt it with my current bag of tricks...
I would create the monster and disable the Move option via the Editor. Then place a Script object, create a function (MoveMyMonster), and use the Monster Move/Strafe/Turn method(s) as needed (http://www.grimrock.net/modding/scripting-reference/) to "patrol" the monster along a defined path. I would hook this function to a timer than runs every second or so.
Lastly, I would set up 1 or more floor triggers near the monster so that when the party walks near the area, the floor trigger runs a Function that stops the Timer (hence, stops the MoveMyMonster function), and re-enables the default Move option so that the Monster is now free to move on its own to engage the party.
This would be simulating "aggro" found in most MMORPG's.
Of course, I'd have to actually write this out to test it and tweak it as needed to avoid errors (ie, object collisions while moving the monster) as well as realism. My 2 cents
I would create the monster and disable the Move option via the Editor. Then place a Script object, create a function (MoveMyMonster), and use the Monster Move/Strafe/Turn method(s) as needed (http://www.grimrock.net/modding/scripting-reference/) to "patrol" the monster along a defined path. I would hook this function to a timer than runs every second or so.
Lastly, I would set up 1 or more floor triggers near the monster so that when the party walks near the area, the floor trigger runs a Function that stops the Timer (hence, stops the MoveMyMonster function), and re-enables the default Move option so that the Monster is now free to move on its own to engage the party.
This would be simulating "aggro" found in most MMORPG's.
Of course, I'd have to actually write this out to test it and tweak it as needed to avoid errors (ie, object collisions while moving the monster) as well as realism. My 2 cents
Re: Ask a simple question, get a simple answer
You could also implement a custom brain (onThink hook) so you can make the monster do whatever you want.
- Duncan1246
- Posts: 404
- Joined: Mon Jan 19, 2015 7:42 pm
Re: Ask a simple question, get a simple answer
petri wrote:You could also implement a custom brain (onThink hook) so you can make the monster do whatever you want.
Thanks for the ideas Azel, I think it's a good way to do what in pretty large areas (=few chances of collisions) and close to LG1 scripting I only knows for the moment.Azel wrote:I'm far from a Pro on the available options to achieve a Monster Patrol Path, but if I were going to attempt it with my current bag of tricks...
I would create the monster and disable the Move option via the Editor. Then place a Script object, create a function (MoveMyMonster), and use the Monster Move/Strafe/Turn method(s) as needed (http://www.grimrock.net/modding/scripting-reference/) to "patrol" the monster along a defined path. I would hook this function to a timer than runs every second or so.
Lastly, I would set up 1 or more floor triggers near the monster so that when the party walks near the area, the floor trigger runs a Function that stops the Timer (hence, stops the MoveMyMonster function), and re-enables the default Move option so that the Monster is now free to move on its own to engage the party.
This would be simulating "aggro" found in most MMORPG's.
Of course, I'd have to actually write this out to test it and tweak it as needed to avoid errors (ie, object collisions while moving the monster) as well as realism. My 2 cents
Petrl, I wonder about brain and what we could do with it, but do you have some examples or have you seen some threads about it, because "scripting reference" gives barely a list...
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?
Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
download at:http://www.nexusmods.com/grimrock/mods/399/?
Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?