Page 46 of 400

Re: Ask a simple question, get a simple answer

Posted: Mon Feb 09, 2015 8:49 pm
by rlewarne04
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. :)

Re: Ask a simple question, get a simple answer

Posted: Tue Feb 10, 2015 1:50 am
by Isaac
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. :)
Image
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) ?
Try this (in item.lua):

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()

Monster's limited movements

Posted: Tue Feb 10, 2015 2:46 pm
by Duncan1246
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

Re: Monster's limited movements

Posted: Tue Feb 10, 2015 3:01 pm
by Drakkan
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
why you cant just use blocker objects ?

Re: Ask a simple question, get a simple answer

Posted: Tue Feb 10, 2015 3:27 pm
by Duncan1246
Drakkan wrote: why you cant just use blocker objects ?
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...
Duncan

Re: Ask a simple question, get a simple answer

Posted: Tue Feb 10, 2015 4:09 pm
by THOM
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...

Re: Ask a simple question, get a simple answer

Posted: Tue Feb 10, 2015 4:29 pm
by Duncan1246
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...
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?
Duncan

Re: Ask a simple question, get a simple answer

Posted: Thu Feb 12, 2015 6:42 pm
by Azel
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 :mrgreen:

Re: Ask a simple question, get a simple answer

Posted: Thu Feb 12, 2015 6:59 pm
by petri
You could also implement a custom brain (onThink hook) so you can make the monster do whatever you want.

Re: Ask a simple question, get a simple answer

Posted: Fri Feb 13, 2015 12:17 am
by Duncan1246
petri wrote:You could also implement a custom brain (onThink hook) so you can make the monster do whatever you want.
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 :mrgreen:
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.
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...