Page 384 of 400
Re: Ask a simple question, get a simple answer
Posted: Mon Apr 25, 2022 6:49 pm
by Isaac
But it's non-specific. It returns true for anyone in the party with the item; not the caster's personal inventory.
*I suppose it depends upon what the designer intends. It's sure a lot easier though.

Re: Ask a simple question, get a simple answer
Posted: Mon Apr 25, 2022 7:54 pm
by Zo Kath Ra
Isaac wrote: ↑Mon Apr 25, 2022 6:49 pm
But it's non-specific. It returns true for anyone in the party with the item; not the caster's personal inventory.
*I suppose it depends upon what the designer intends. It's sure a lot easier though.
PartyComponent:isCarrying(string) returns true even for disabled champions
So if champion 1 is the only champion carrying a "red_gem"
and you disable champion 1 with Champion:setEnabled(false)
then party.party:isCarrying("red_gem") still returns true.
But in most mods, the party doesn't change once you've started the game, so this little bug usually doesn't matter.
Re: Ask a simple question, get a simple answer
Posted: Mon May 02, 2022 4:50 pm
by bongobeat
hi, can anyone help me with that script?
Code: Select all
-- this is added to an item, an armor
onEquipItem=function(self,champion,slot)
if slot==4 then
champion:trainSkill("water_magic", 1,false)
champion:trainSkill("earth_magic", 1,false)
champion:trainSkill("air_magic", 1,false)
champion:trainSkill("fire_magic", 1,false)
playSound("level_up")
end
end,
onUnequipItem=function(self,champion,slot)
if slot==4 then
champion:trainSkill("water_magic", -1,false)
champion:trainSkill("earth_magic", -1,false)
champion:trainSkill("air_magic", -1,false)
champion:trainSkill("fire_magic", -1,false)
end
end]]
I wanted to add the 4 skillpoins in each magic schooll, it works only if you haven't reach the maximum skill (5 pts)
The problem here is if you already got 5 in any magic, then when removing the item, it removes 1 pt of the corresponding magic, even if you maxed the skill before puting the item. So basically, you loose one or more skill points
Re: Ask a simple question, get a simple answer
Posted: Mon May 02, 2022 5:12 pm
by minmay
This is quite complicated to do in a way that works. The
skillModifiers field may be relevant.
You'll need to manage skill traits by hand no matter what approach you use (because adding skill traits can be automatic, but removing them when skill levels decrease is not). If you use skillModifiers, you'll need to do some fix-up any time the player trains the skill in the character sheet. If you use this trainSkill() approach, you'll need to store whether the skill level was actually increased and only decrease it on unequip if it was, and of course it won't be able to raise the skill past 5.
Re: Ask a simple question, get a simple answer
Posted: Fri May 06, 2022 11:12 am
by bongobeat
ok, this is quite complicated to do then.
thank you for your answer.
Re: Ask a simple question, get a simple answer
Posted: Sun May 29, 2022 7:37 am
by Adrageron
Hello, guys! I have encountered another problem
I am using this tileset made by Phitt:
https://www.nexusmods.com/legendofgrimrock2/mods/35 wich is really a masterpiece. But recently I've discovered an unpleasant surprise: all doors in this mod (normal and secret ones) are transparent for projectiles. Is there a right way to fix it? Sadly, I have no experience using model editors, so I have no idea what to do with all that models and nodes

Re: Ask a simple question, get a simple answer
Posted: Sun May 29, 2022 7:51 am
by Isaac
Door component has a 'sparse' option that allows projectiles to pass through, and for the party to pick up items on the floor just inside the doorway.
DoorComponent:setSparse(boolean)
You can set the component's sparse flage to false in the individual door object definition(s), or in the object they inherit the door component from, if there is one.
*I have not looked at the mod resource yet, but am downloading it as I type.
Re: Ask a simple question, get a simple answer
Posted: Sun May 29, 2022 7:58 am
by Adrageron
Isaac wrote: ↑Sun May 29, 2022 7:51 am
Door component has a 'sparse' option that allows projectiles to pass through, and for the party to pick up items on the floor just inside the doorway.
Thank yor for reply!
AFAIK, 'sparse' option only allows to put/pick up items, not throw.
Re: Ask a simple question, get a simple answer
Posted: Sun May 29, 2022 8:08 am
by Isaac
You are probably right; It's been a [long] while since I've used any of it... I am re-familiarizing.
(Looking at the resource scripts...)
SPARSE:
Items can be picked up and dropped through sparse doors. Monsters can also see through sparse doors, and the Poison Cloud spell can be cast through sparse doors.
It's definitely not the sparse flag.
I see what you mean about projectiles passing through the doors.
_____________
There are differences with the doors from the regular/official doors...
**Minmay has likely seen this problem before, and already knows.
It seems like it must be the script; swapping with an official door model solves nothing.
The Asian gate model is unusual; with assimp import lib nodes, but it seems to work visually well enough.
Re: Ask a simple question, get a simple answer
Posted: Sun May 29, 2022 9:04 am
by minmay
DoorComponent uses the bounding box of the
gate node (for normal doors) or the
door_left and
door_right nodes (for double doors) for projectile and FirearmAttackComponent collision.
The problem here is that two of the door models in that asset pack have empty
gate nodes. You can fix this by shuffling around the nodes; this was quick enough for me to do so
here's a download link to fixed versions of those models.