Ask a simple question, get a simple answer

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Code: Select all

GameMode.completeGame()
* Optionally, you can include the path to an .IVF video for it to play.

Code: Select all

function quit()
	GameMode.completeGame("assets/videos/outro1.ivf")
end
User avatar
Eleven Warrior
Posts: 746
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Ask a simple question, get a simple answer

Post by Eleven Warrior »

ty for the help :)
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by bongobeat »

how can I disable the idle animation only for a model rattached to the "parentNode = head" of a monster?

Code: Select all

defineObject{
	name = "ratling_cannon_monster_test",
	baseObject = "base_monster",
	components = {
		{
			class = "Model",
			model = "assets/models/monsters/ratling2.fbx",
			storeSourceData = true, -- must be enabled for mesh particles to work
			offset = vec(0, 0, 0),
			rotation = vec(0,45,0),
		},
		{
			class = "Animation",
			animations = {
				idle = "assets/animations/monsters/ratling/ratling2_idle.fbx",
				moveForward = "assets/animations/monsters/ratling/ratling2_walk.fbx",
				turnLeft = "assets/animations/monsters/ratling/ratling2_turn_left.fbx",
				turnRight = "assets/animations/monsters/ratling/ratling2_turn_right.fbx",
				turnAround = "assets/animations/monsters/ratling/ratling2_turn_around.fbx",
				attack = "assets/animations/monsters/ratling/ratling2_attack.fbx",
				turnAttackLeft = "assets/animations/monsters/ratling/ratling2_turn_attack_left.fbx",
				turnAttackRight = "assets/animations/monsters/ratling/ratling2_turn_attack_right.fbx",
				rangedAttack = "assets/animations/monsters/ratling/ratling2_ranged_attack.fbx",
				getHitFrontLeft = "assets/animations/monsters/ratling/ratling2_get_hit_front_left.fbx",
				getHitFrontRight = "assets/animations/monsters/ratling/ratling2_get_hit_front_right.fbx",
				getHitBack = "assets/animations/monsters/ratling/ratling2_get_hit_back.fbx",
				getHitLeft = "assets/animations/monsters/ratling/ratling2_get_hit_left.fbx",
				getHitRight = "assets/animations/monsters/ratling/ratling2_get_hit_right.fbx",
				fall = "assets/animations/monsters/ratling/ratling2_get_hit_front_left.fbx",
				alert = "assets/animations/monsters/ratling/ratling2_alert.fbx",
			},
			currentLevelOnly = true,
		},
		{
			class = "Model",
			name = "cannon",
			model = "mod_assets/models/naval_cannon_complete.fbx",
			offset = vec(-0.25, -1.35, 0.25),
			rotation = vec(0, 0, 0),
			parentNode = "head",
		},
I want that the "cannon" model don't follow the idle animation of the ratling, because it doesn't look great with the animation.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

That's not possible, sorry.
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.
User avatar
Eleven Warrior
Posts: 746
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Ask a simple question, get a simple answer

Post by Eleven Warrior »

In the program Grimrock Model Toolkit i'm trying to add (gate node) to an wall but it wont say the name gate node in the nodes selection. So the wall becomes a door.

I can make the wall a door np but as soon as I run the editor is say the wall has no gate node.
SluisE
Posts: 8
Joined: Fri Nov 30, 2018 4:56 pm

Re: Ask a simple question, get a simple answer

Post by SluisE »

Eleven Warrior wrote: Fri Mar 27, 2020 3:35 am In the program Grimrock Model Toolkit i'm trying to add (gate node) to an wall but it wont say the name gate node in the nodes selection. So the wall becomes a door.

I can make the wall a door np but as soon as I run the editor is say the wall has no gate node.
In the GMT choose the root node.
Click on Add
A new node is added. Choose this one.
Change the name to 'gate' (not gate node, just gate)
Click the update button
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by bongobeat »

minmay wrote: Thu Mar 26, 2020 7:23 pm That's not possible, sorry.
arghhh, ok, thanks for the answer
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
Eleven Warrior
Posts: 746
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Ask a simple question, get a simple answer

Post by Eleven Warrior »

ty SluisE that works nicely :)
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by bongobeat »

Please can somebody check the attached script of this item?

It worked perfectly for a while, then it's power attack don't work anymore. Don't know if the script has an error or if it's something other related to the rest of the mod.

Code: Select all

defineObject{
	name = "rapier_3",
	baseObject = "base_item",
	components = {
		{
			class = "Model",
			model = "assets/models/items/rapier.fbx",
		},
		{
			class = "Item",
			uiName = "The Diamond Sword",
			gfxIndex = 338,
			gfxIndexPowerAttack = 429,
			impactSound = "impact_blade",
			weight = 2.6,
			traits = { "light_weapon", "sword", "berserker_weapon", "epic" },
			description = "The rapier of Jean Bart, the legendary pirate. It is said that he has slayed 13 drakes with this sword during the Dragon's War. A succesful hit replenishes its power attack.",
			secondaryAction = "Dfire",
             onUnequipItem = function(self,champion,slot)
                party.berserkerScript.weaponUnequip(self,champion,slot)
             end,
		},
		{
			class = "EquipmentItem",
			slot = "Weapon",
			dexterity = 7,
		},
		{
			class = "Particle",
			particleSystem = "manabind_64",
		emitterMesh = "assets/models/items/rapier.fbx",
		},
          {
             class = "Counter",
             name = "collection",
             value = 0,
          },
          {
		class = "MeleeAttack",
		attackPower = 105,
		accuracy = 10,
		cooldown = 3.5,
		pierce = 10,
		swipe = "thrust",
			requirements = { "critical", 2, "epic_weapons", 3 },
             onHitMonster = function(self, monster, tside, damage, champion)
                local doDebug = false
                local currentCount = self.go.collection:getValue()
                local amountLow = (damage / 5)
                local amountHigh = (damage / 2)
                local collectedCount = math.random(amountLow, amountHigh)
                if doDebug then print("currentCount:", currentCount) end
                if doDebug then print("Low:",amountLow,"High:", amountHigh) end
                if doDebug then print("Collected:", collectedCount) end
                self.go.collection:setValue(currentCount + collectedCount)
                if doDebug then print("New Count:", self.go.collection:getValue()) end
                if self.go.collection:getValue() >= 100 then
                   local currentCharges = self.go.Dfire:getCharges()
                   if currentCharges < 3 then
                      if doDebug then print("Charge added, resetting count.") end
                      self.go.Dfire:setCharges(currentCharges + 1)
                      self.go.collection:setValue(0)
                      hudPrint("The Diamond Sword screams with power.")
                   else
                      self.go.collection:setValue(0)
                   end
                end
             end,
          },

			{
			class = "CastSpell",
			name = "Dfire",
			uiName = "Dark Fire",
			cooldown = 5,
			spell = "darkburst",
			energyCost = 80,
			power = 30,
			charges = 3,
			requirements = { "concentration", 2 },
			},
	},
	tags = { "weapon" },
}
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
Zo Kath Ra
Posts: 937
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra »

bongobeat wrote: Sat Mar 28, 2020 1:39 pm Please can somebody check the attached script of this item?
I haven't checked the script yet, but...

"The rapier of Jean Bart, the legendary pirate. It is said that he has slayed 13 drakes with this sword during the Dragon's War. A succesful hit replenishes its power attack."

has slayed -> slew
succesful -> successful
Post Reply