[WIP] Combined custom content thread

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!
SpacialKatana
Posts: 163
Joined: Fri Sep 14, 2012 6:20 pm

Re: [WIP] Combined custom content thread

Post by SpacialKatana »

Nice thread, I've managed to cobble together a working staff that casts fireballs.

I'm having trouble however adding the baseDamageStat = "willpower" to my item. Any help appreciated Akroma22.

Code: Select all

defineObject{
   name = "staff_fireballs",
   baseObject = "base_item",
   components = {
      {
         class = "Model",
         model = "assets/models/items/acolyte_staff.fbx",
      },
      {
         class = "Item",
         uiName = "Staff of Fireballs",
         gfxIndex = 340,
         weight = 2.7,
         description = "A magical staff that radiates great power.",
      },
      {
         class = "CastSpell",
         spell = "fireball",
         cooldown = 3.0,
      },
    },
}
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: [WIP] Combined custom content thread

Post by akroma222 »

Thanks specialKatana, good to see you're still around ;)

Here we have your Staff of Fireballs (using willpower as the damage bonus)
SpoilerShow

Code: Select all

defineObject{
       name = "staff_fireballs",
       baseObject = "base_item",
       components = {
       	{
             class = "Model",
             model = "assets/models/items/acolyte_staff.fbx",
        },
	{
             	class ="Item",
             	uiName = "Staff of Fireballs",
             	gfxIndex = 340,
        	weight = 2.7,
             	impactSound = "impact_blunt",
             	traits = { "stave", "light_weapon" },
             	secondaryAction = "fireBall",
             	description = "A fiery staff designed by the archmage specialKatana"
        },
        {
             	class = "MeleeAttack",
             	attackPower = 13,
             	accuracy = 5,
             	swipe = "vertical",
             	attackSound = "swipe_special",
             	cooldown = 3.5,
             	baseDamageStat = "willpower",
             	damageType = "fire",
		causeCondition = "burning",
		conditionChance = 30,
             	requirements = {"light_weapons" ,1},
        },
        {
             	class = "CastSpell",
             	name = "fireBall",
		uiName = "Fireball",
             	charges = 9,
             	cooldown = 4.0,
             	energyCost = 30,
             	spell = "fireball",
             	requirements = { "fire_magic", 1},
        },
        }
    }
and here is a version that shoots multiple fireballs as a special attack :twisted:
(although all fireballs follow the same trajectory.. have not got around to changing that yet)
SpoilerShow

Code: Select all

defineObject{
       name = "staff_fireballs",
       baseObject = "base_item",
       components = {
       	{
             class = "Model",
             model = "assets/models/items/acolyte_staff.fbx",
        },
	{
             	class ="Item",
             	uiName = "Staff of Fireballs",
             	gfxIndex = 340,
        	weight = 2.7,
             	impactSound = "impact_blunt",
             	traits = { "stave", "light_weapon" },
             	secondaryAction = "fireBall1",
             	description = "A fiery staff designed by the archmage specialKatana"
        },
        {
             	class = "MeleeAttack",
             	attackPower = 13,
             	accuracy = 5,
             	swipe = "vertical",
             	attackSound = "swipe_special",
             	cooldown = 3.5,
             	baseDamageStat = "willpower",
             	damageType = "fire",
		causeCondition = "burning",
		conditionChance = 30,
             	requirements = {"light_weapons" ,1},
        },
        {
             	class = "CastSpell",
             	name = "fireBall1",
		uiName = "Volley of Flames",
		chainAction = "fireBall2",
		chainActionDelay = 0.3,
             	charges = 9,
             	cooldown = 4.0,
             	energyCost = 30,
             	spell = "fireball",
             	requirements = { "fire_magic", 1},
        },
	{
             	class = "CastSpell",
             	name = "fireBall2",
		uiName = "Fireball",
		chainAction = "fireBall3",
		chainActionDelay = 0.3,
             	spell = "fireball",
        },
	{
             	class = "CastSpell",
             	name = "fireBall3",
		uiName = "Fireball",
             	spell = "fireball",
        },
        }
    }
EDIT - note this staff does not have a different icon for full/empty charges - if it did you would need to add emptyGfxIndex = (number) in the castSpell component.

Enjoy :D
Akroma
SpacialKatana
Posts: 163
Joined: Fri Sep 14, 2012 6:20 pm

Re: [WIP] Combined custom content thread

Post by SpacialKatana »

akroma222 wrote:Thanks specialKatana, good to see you're still around ;)

~~ snip ~~

Enjoy :D
Akroma
Nice one cheers ! I couldn't resist the new outdoor areas now could I ? 8-)

Amma bit too busy workin' these days to get right back into scripting, but I'll surely make some nice stuff for my mod when the assets are released !

Stay frosty,

Sk.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: [WIP] Combined custom content thread

Post by akroma222 »

Haha no one can resist the outdoor areas! 8-)

A quick scripting question - and probably a simple silly one too
I am trying to use champion:getClass() to check the champs class when they equip an item... doesnt want to work!
SpoilerShow

Code: Select all

function assassinDaggerEquip(self, champion, slot)
	local name = champion:getName()
	if slot == 1 or slot == 2 then
		if champion:getClass() == "Fighter" then
			champion:trainSkill("critical", 1)
			hudPrint(""..name.."'s Critical skill increases by 1 level.")
		end
	end
end
Really not sure why this wouldnt be working... can anyone point out what Im doing wrong?
(works fine without the champion:getClass() business)
cameronC
Posts: 80
Joined: Wed Apr 11, 2012 10:54 pm

Re: [WIP] Combined custom content thread

Post by cameronC »

when I call getClass it returns a lowercase "fighter" for me. You have it uppercase.
Writer and sometimes artist of the very slightly acclaimed comic series Scrambled Circuits. A comic series about a robot written by a human.

Grimrock 2 socketSystem: viewtopic.php?f=22&t=8546 / Github
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: [WIP] Combined custom content thread

Post by akroma222 »

Thank you cameronC! it is indeed 'fighter' :D

EDIT - updated Doridion's food/egg/water assets
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: [WIP] Combined custom content thread

Post by Drakkan »

please update snail and ice lizard monster
viewtopic.php?f=22&t=8104
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: [WIP] Combined custom content thread

Post by akroma222 »

Thanks Drakkan, will add both monsters to the thread tomorrow ☺
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: [WIP] Combined custom content thread

Post by akroma222 »

Lizards (Ice/fire/green/dark) have been added
Snails will be up soon
Daggers, Swords and Axes are done - just need to add scripted game effects for some of them and will then add them
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: [WIP] Combined custom content thread

Post by Grimfan »

akroma222 wrote:Lizards (Ice/fire/green/dark) have been added
Snails will be up soon
Daggers, Swords and Axes are done - just need to add scripted game effects for some of them and will then add them
Will certainly be using some of these. :)

I've got the scavenger up and running but at the moment the little freaks are making no sounds. The editor keeps telling me it can't find the wav.files. :x
Post Reply