Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
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.
*I suppose it depends upon what the designer intends. It's sure a lot easier though.
- Zo Kath Ra
- Posts: 937
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
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
hi, can anyone help me with that script?
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
SpoilerShow
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]]
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
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.
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.
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
ok, this is quite complicated to do then.
thank you for your answer.
thank you for your answer.
Re: Ask a simple question, get a simple answer
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
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
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.
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
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
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...)
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.
(Looking at the resource scripts...)
It's definitely not the sparse flag.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.
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
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.
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.
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.