Page 250 of 400
Re: Ask a simple question, get a simple answer
Posted: Thu Jul 26, 2018 1:43 pm
by Pompidom
I have placed some tents around my mod. I believe they're from zim's assets. when you click on them your party starts resting.
Is there a way to disable resting everywhere else?
I found that
return false from PartyComponent.onRest hook
will do the trick, but I have no idea in which file i have to change this line.
and will this also disable resting from the tents?
Re: Ask a simple question, get a simple answer
Posted: Thu Jul 26, 2018 7:51 pm
by akroma222
Pompidom wrote: ↑Thu Jul 26, 2018 1:43 pm
but I have no idea in which file i have to change this line.
It depends on which file you keep your party definition and hooks in....
Have you written any code for any of the hooks yet?
Party Hooks :
Code: Select all
PartyComponent.onCastSpell(self, champion, spell)
PartyComponent.onDamage(self, champion, damage, damageType)
PartyComponent.onDie(self, champion)
PartyComponent.onAttack(self, champion, action, slot)
PartyComponent.onLevelUp(self, champion)
PartyComponent.onReceiveCondition(self, champion, condition)
PartyComponent.onDrawGui(self, context)
PartyComponent.onDrawInventory(self, context, champion)
PartyComponent.onDrawStats(self, context, champion)
PartyComponent.onDrawSkills(self, context, champion)
PartyComponent.onDrawTraits(self, context, champion)
PartyComponent.onPickUpItem(self, item)
PartyComponent.onProjectileHit(self, champion, item, damage, damageType)
PartyComponent.onRest(self)
PartyComponent.onWakeUp(self)
PartyComponent.onTurn(self, direction)
PartyComponent.onMove(self, direction)
For example, Ive written my party hooks in the init.lua file
(Zimber's mod files, for example, have the party def + hooks kept in a lua file called zim_party.lua - and he just imports zim_party.lua from his init.lua file)
Would you like to look over such a def / hook file??
To manipulate the outcome when the onRest hook fires.... check to see if the tent is in front of the party, if it is then return false
This example includes the hook as part of a (very brief) party definition
Party hooks are just listed one after the other like this :
Code: Select all
defineObject{
name = "party",
baseObject = "party",
components = {
class = "Party",
onRest = function(self)
local dx,dy = getForward(self.go.facing)
if party.x + dx == tent_1.x
and party.y + dy == tent_1.y
and party.level == tent_1.level
and party.elevation == tent_1.elevation then
print("stop tent sleep")
return false
end
end,
onReceiveCondition(self, champion, condition)
-- do condition stuff here
end,
onProjectileHit(self, champion, item, damage, damageType)
-- do projectile stuff here
end,
},
}
Alternatively, you can make the same check as a condition for the party being able to rest (ie you can only sleep in tents)
Here is 2 ways of doing that through the onRest hook :
Code: Select all
onRest = function(self)
local dx,dy = getForward(self.go.facing)
if not party.x + dx == tent_1.x
or not party.y + dy == tent_1.y
or not party.level == tent_1.level
or not party.elevation == tent_1.elevation then
print("only tent sleep")
return false
end
end,
onRest = function(self)
local dx,dy = getForward(self.go.facing)
if party.x + dx == tent_1.x
and party.y + dy == tent_1.y
and party.level == tent_1.level
and party.elevation == tent_1.elevation then
print("only tent sleep")
--do party resting stuff here
else
return false
end
end,
Enjoy!
Akroma
EDIT: elevation & level checks added
Re: Ask a simple question, get a simple answer
Posted: Sat Jul 28, 2018 5:55 pm
by Pompidom
So basically something I should just ignore until the very end.
Which is basically I do with everything I don't understand

or unable to accomplish without holding hands help.
On the bright side

I have started to make a boat, which allows me to create an "inside the boat" map

Re: Ask a simple question, get a simple answer
Posted: Sat Jul 28, 2018 9:00 pm
by minmay
Akroma, those hooks need to check whether the party is on the same level as the tent as well. You probably want to check elevation too.
Re: Ask a simple question, get a simple answer
Posted: Sun Jul 29, 2018 4:20 am
by akroma222
minmay wrote: ↑Sat Jul 28, 2018 9:00 pm
Akroma, those hooks need to check whether the party is on the same
level as the tent as well. You probably want to check elevation too.
You're right, I do! Haha

Thankyou!
Re: Ask a simple question, get a simple answer
Posted: Sun Aug 12, 2018 1:05 pm
by Pompidom
I started making a new map where I want the player to walk through a waterfall into a cave exit that leads to an underground cave map.
The map is brand new and thus still empty and only a very rough sketch/try at it.
Also the screenshots are taken in lowest settings in low res.
https://ibb.co/c2n65p
https://ibb.co/n0fJkp
What are my options to make sure the cave stairs don't light up like a christmas tree because of the daylight that goes through everything?
Are there any day_sky blocker tiles/walls/ceilings or something like that?
Re: Ask a simple question, get a simple answer
Posted: Mon Aug 13, 2018 4:48 pm
by kelly1111
Question:
Does anyone know how to make a texture / surface look wet ingame?
I remember that someone made something like this a while back (ground surface) , but can't find the post anymore
Any tips are welcome
Looking for a wet stone surface
Re: Ask a simple question, get a simple answer
Posted: Mon Aug 13, 2018 5:17 pm
by THOM
I made it and you can find it in my Journey To Justice - Resource Pack.
Have a look here:
https://www.nexusmods.com/legendofgrimr ... ?tab=files
It's just a question of glossiness. You can set this value in the material definition for example to
glossiness = 100,
Re: Ask a simple question, get a simple answer
Posted: Tue Aug 14, 2018 9:29 am
by akroma222
Pompidom wrote: ↑Sun Aug 12, 2018 1:05 pm
I started making a new map where I want the player to walk through a waterfall into a cave exit that leads to an underground cave map.
Sorry I cant help with any of your specific questions, but here is a video of Skuggs' waterfall
https://www.youtube.com/watch?v=96v6ZV2R14I
Im not sure if Skuggs is still around, further; whether the waterfall is a shared asset.....
Also - Zimber created waterfall assets - I would download and take a look at his work too (your answers may lay there?)
Hope this helps
Akroma
Re: Ask a simple question, get a simple answer
Posted: Tue Aug 14, 2018 10:57 am
by THOM
The waterfall of Skuggs will come with ORRR3.
