Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
So is this sword on a pedestal or other surface [a one time check], or do you intend that they be checked every single time they try to lift it; even from the floor, if they set it down? What should happen if the only champion strong enough to hold it, loses some of their strength and is no longer strong enough while it's equipped, or in inventory?
*Is this solvable without script, by simply by increasing the assigned weight of the item? [Make the sword weigh 150kg for example.]
*Is this solvable without script, by simply by increasing the assigned weight of the item? [Make the sword weigh 150kg for example.]
Re: Ask a simple question, get a simple answer
Isaac wrote: ↑Sun Aug 30, 2020 2:14 am So is this sword on a pedestal or other surface [a one time check], or do you intend that they be checked every single time they try to lift it; even from the floor, if they set it down? What should happen if the only champion strong enough to hold it, loses some of their strength and is no longer strong enough while it's equipped, or in inventory?
*Is this solvable without script, by simply by increasing the assigned weight of the item? [Make the sword weigh 150kg for example.]
I've changed my mind about the whole thing.
The stats checking coud be too much restrictive, it would be better if the script check if a character has a certain trait.
1°) Sword is placed in a fake altar with worldPosition and rotation or placed on a true altar if necessary.
2°) I put an invisible button before the sword/pedestal, so that the player touch only the button, and cannot touch the sword.
3°) The button trigger the script that check the party if any member has the right trait.
4°) If yes, the button is destroyed, and only the champion who has the trait can use the word.
5°) The trait will be given by drinking a potion, that only warriors can drank, warriors class are fighter, barbarian or knight.
Edit:
So, basicaly I've done everything except one thing: That only the champion who has the special trait can use that sword.
I don't know how to link the item and the trait together.
This is for the special potion that will give a trait to any warrior:
SpoilerShow
Code: Select all
defineObject{
name = "potion_golden_claymore_bearer",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/flask_large.fbx",
},
{
class = "Item",
uiName = "Potion of Raw Power",
gfxIndex = 414,
weight = 0.5,
description = "A mysterious potion of raw power, whose ingestion could have side effect if the person who drinks it is not strong enough.",
gameEffect = "Only a true warrior can drink such potion.",
},
{
class = "UsableItem",
sound = "level_up",
onUseItem = function(self, champion)
if champion:hasTrait("barbarian") or champion:hasTrait("fighter") or champion:hasTrait("knight") then
hudPrint(champion:getName().." drinked the potion.")
champion:addTrait("golden_claymore_holder")
champion:upgradeBaseStat("strength", 1)
hudPrint(champion:getName().." loose 35 Health.")
champion:modifyBaseStat("max_health", -35)
champion:modifyBaseStat("health", -35)
return true
else
hudPrint(champion:getName().." is not a true warrior and can't drink this.")
return false
end
end,
},
{
class = "Particle",
particleSystem = "potion_of_strength",
},
},
}
Re: Ask a simple question, get a simple answer
Question for minmay. I saw somewhere that you made a stairs asset that was walkable in more directions then up and down and without the camara fade in/ out. Will this be released in you mod or maybe asset pack in the future?
- Zo Kath Ra
- Posts: 937
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
champion:modifyBaseStat("max_health", -35)bongobeat wrote: ↑Sun Aug 30, 2020 11:52 am This is for the special potion that will give a trait to any warrior:That's as far I can go, I really need help for the next script, I suppose it would be in the sword definition.SpoilerShowCode: Select all
defineObject{ name = "potion_golden_claymore_bearer", baseObject = "base_item", components = { { class = "Model", model = "assets/models/items/flask_large.fbx", }, { class = "Item", uiName = "Potion of Raw Power", gfxIndex = 414, weight = 0.5, description = "A mysterious potion of raw power, whose ingestion could have side effect if the person who drinks it is not strong enough.", gameEffect = "Only a true warrior can drink such potion.", }, { class = "UsableItem", sound = "level_up", onUseItem = function(self, champion) if champion:hasTrait("barbarian") or champion:hasTrait("fighter") or champion:hasTrait("knight") then hudPrint(champion:getName().." drinked the potion.") champion:addTrait("golden_claymore_holder") champion:upgradeBaseStat("strength", 1) hudPrint(champion:getName().." loose 35 Health.") champion:modifyBaseStat("max_health", -35) champion:modifyBaseStat("health", -35) return true else hudPrint(champion:getName().." is not a true warrior and can't drink this.") return false end end, }, { class = "Particle", particleSystem = "potion_of_strength", }, }, }
champion:modifyBaseStat("health", -35)
I'd remove the second line, because:
- reducing max_health automatically reduces health, if (health_old > max_health_new)
- the second line always takes away health that the champion should keep
Not to mention the edge case:
max_health <= 35
edit:
drinked the potion => has drunk
loose 35 Health => has lost
Or, if you want to use the present tense:
drinked the potion => drinks
loose 35 Health => loses
Re: Ask a simple question, get a simple answer
I believe we went over this before!
You don't need the model, it was literally just the dungeon stairs model with the walls taken out and with the top aligned to the 3x3x3 grid.
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
I've run into a weird issue:
I've defined a new secret door with a new model. As far as I can see I've copied all parts of the definition from a secret door of the original game. My door does work and look like expected - except of that is does not block thrown items.
Is something special required from the model? That's the only thing I can think of (it has a door node of course).
Or can be because of the material, which is transparent?
I'm clueless...
I've defined a new secret door with a new model. As far as I can see I've copied all parts of the definition from a secret door of the original game. My door does work and look like expected - except of that is does not block thrown items.
Is something special required from the model? That's the only thing I can think of (it has a door node of course).
Or can be because of the material, which is transparent?
I'm clueless...
Re: Ask a simple question, get a simple answer
Does your model match the nodes for the secret_door model?
Re: Ask a simple question, get a simple answer
Specifically, every door model should have a node named "gate", which is used to determine collisions. Without a gate node (or with an empty gate node), projectiles won't collide with the door at all.
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.
-
- Posts: 2
- Joined: Fri Sep 18, 2020 6:52 pm
Re: Ask a simple question, get a simple answer
Hi, new poster here. I'm wondering if anyone would have any advice on how to take the undying cube model from the in game assets and convert it into a file suitable for 3d printing ( STL, OBJ, X3D, 3MF) and whether or no blender is the tool I need for that.
EDIT - Using the GMT, will report on success
EDIT - Using the GMT, will report on success
Re: Ask a simple question, get a simple answer
Welcome!
The GMT will export the model as an OBJ file, but there is a very good Blender plugin here that will import the .model files directly.
http://www.grimrock.net/forum/viewtopic ... 6&p=122300
*Note!! This plugin requires an older version of Blender to work; you need version Blender 2.72 —or it will mangle the mesh.
https://download.blender.org/release/Blender2.72/
You can have more than one version of Blender installed; just have them in different folders.
The GMT will export the model as an OBJ file, but there is a very good Blender plugin here that will import the .model files directly.
http://www.grimrock.net/forum/viewtopic ... 6&p=122300
*Note!! This plugin requires an older version of Blender to work; you need version Blender 2.72 —or it will mangle the mesh.
https://download.blender.org/release/Blender2.72/
You can have more than one version of Blender installed; just have them in different folders.