Page 351 of 396

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 30, 2020 2:14 am
by Isaac
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.]

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 30, 2020 11:52 am
by bongobeat
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",
		},
	},
}
That's as far I can go, I really need help for the next script, I suppose it would be in the sword definition. :x :roll: :( :?: :D

Re: Ask a simple question, get a simple answer

Posted: Fri Sep 04, 2020 10:21 am
by kelly1111
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?

Re: Ask a simple question, get a simple answer

Posted: Fri Sep 04, 2020 3:34 pm
by Zo Kath Ra
bongobeat wrote: Sun Aug 30, 2020 11:52 am 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",
		},
	},
}
That's as far I can go, I really need help for the next script, I suppose it would be in the sword definition. :x :roll: :( :?: :D
champion:modifyBaseStat("max_health", -35)
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

Posted: Sat Sep 05, 2020 5:01 am
by minmay
kelly1111 wrote: Fri Sep 04, 2020 10:21 am 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?
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.

Re: Ask a simple question, get a simple answer

Posted: Fri Sep 18, 2020 3:20 pm
by THOM
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...

Re: Ask a simple question, get a simple answer

Posted: Fri Sep 18, 2020 5:32 pm
by Isaac
Does your model match the nodes for the secret_door model?

Image

Re: Ask a simple question, get a simple answer

Posted: Fri Sep 18, 2020 6:47 pm
by minmay
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.

Re: Ask a simple question, get a simple answer

Posted: Fri Sep 18, 2020 10:59 pm
by Scantrahan
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

Re: Ask a simple question, get a simple answer

Posted: Sat Sep 19, 2020 2:36 am
by Isaac
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.