Bastien067 experiments, new assets and other...

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
bastien067
Posts: 8
Joined: Thu Nov 01, 2012 6:41 am

Bastien067 experiments, new assets and other...

Post by bastien067 »

Hello everyone :)
First I would like to apologize for my english, but I have an excuse : I'm french :P
I started modding a few days ago, an I would like to use this thread to show and discuss new asset i have created, script code, texture and 3d models...

First, I'm proud to introduce The magic Scroll of...
Remember the good old magic scrolls in D&D ? You read it and the scroll activate a spell... and then all you have is a useless magic scroll...
When i saw that it is possible to make new assets, this is the first thing i think about...
I juste create an item with using the model of a scroll and working like a magic wand with only one charge.

here is the code:

Code: Select all

defineObject{
		name = "magicscroll_fireball",
		class = "Item",
		uiName = "Magic scroll of Fireball",
		model = "assets/models/items/scroll.fbx",
		description = "Reading this scroll will release a powerful fireball.",
		skill = "fire_magic",
		gfxIndex = 113,
		accuracy = 0,
		coolDownTime = 5,
		attackMethod = "castWandSpell",
		spell = "fireball",
		wandPower = 25,
		charges = 1,
		emptyItem = "magicscroll_empty",
		weight = 0.3,
}

cloneObject{
		name = "magicscroll_empty",
		baseObject = "scroll",
		uiName = "Empty Magic Scroll",
		description = "This empty magic scroll is now useless"
}
Obviously you can change the spell by whatever spell you want... fireball is just an example...

Let me know what you think about it, this is my first try in coding, so maybe the code is nat perfect, but it's working ^^
Thank you.
bastien067
Posts: 8
Joined: Thu Nov 01, 2012 6:41 am

Re: Bastien067 experiments, new assets and other...

Post by bastien067 »

I want to thank you everyboby, because I'm learning a lot with all your posts..

The recipe you can make in the mortar work basically like this : item1+item2=item3...

So you can make a recipe to make whatever item you want : so you can make a basic crafiting system. I tought it would be cool to be able to craft your own bombs. Here is the code to
craft a poison bomb :

Code: Select all

defineRecipe{
	item = "poison_bomb",
	ingredients = {
		1, "water_flask",
		2, "herder_cap",
		1, "grim_cap",
	}
}
just add it to the "recipe" script in you mod_assets.

It use a water flask, but if you want you can use a normal flask : and yes, the flask is used in the process and you can't regain it like when you drink a potion, but after all, when you make bombs, you need to break things ^^ ...
It's just an example, you can use the items you want to make the item you want ^^

The only problem is that this crafting method use the mortar... For crafting a poison bomb, with chemical agents, i could be logical... but is much less logical if you want to craft a sword or an armor for instance...

I plan to make recipe to make some items like the mortar but to craft other things. For instance an anvil where you can craft weapons and armor using metal junk, or a scriptory (not sure if it is the correct word, i mean : "a table where you write") where you can craft magic scrolls using ink and stone magic runes...
It will be easy to make a new item cloning the mortar but with a different icon and 3d model (let say an anvil)... well maybe not so easy but i can see how to do it... But like this it will be still possible to craft potions on the anvil and weapons in the mortar...
So i have to figure how to make the crafting items like the mortar or the anvil only able to craft certain items but not the others... Maybe with a script who check all the items in a list and look if they are allowed to be created in that specific crafting item. But I dont know how to do (how to script) it, or even if it is possible... Still a lot to learn !
Thank you for all advices you can give ^^

EDIT : I made a few try
The mortar item is listed a a container with a capacity of 7 and a containerType named "mortar"... But as this "mortar" point nowhere else i suppose it is hardcoded...
It is possible to alter the capacity, but that's all, and it don't change the number of slots on the image...
I can change the icone and model to have an anvil in place of the mortar, but it will still be a mortar...
bastien067
Posts: 8
Joined: Thu Nov 01, 2012 6:41 am

Re: Bastien067 experiments, new assets and other...

Post by bastien067 »

I needed a three lock combination on a wall, so i made a
high lock and low lock

here is the code

Code: Select all

cloneObject{
	name = "lock_low",
	baseObject = "lock",
	height = 0.75,
}

cloneObject{
	name = "lock_high",
	baseObject = "lock",
	height = 2,
}
Add it in the object script in your mod_assets.

I know i'm not dicovering the wheel here, but is a lern new things I thing it's important to show to beginners like me how the basics work..
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Bastien067 experiments, new assets and other...

Post by JohnWordsworth »

Nice idea with the D&D like scrolls. I can definitely see the benefit of dropping a few of those in a dungeon so that the player gets to play with a few spells they may not have learned.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Bastien067 experiments, new assets and other...

Post by Neikun »

I made the high and low locks some time ago, but I don't remember which thread I posted them on lol.

Also, Welcome to the community!
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Ciccipicci
Posts: 154
Joined: Mon Oct 08, 2012 12:55 am

Re: Bastien067 experiments, new assets and other...

Post by Ciccipicci »

Great add! For who want to add directly into the object.lua other spells, copy/paste this code:
SpoilerShow
defineObject{
name = "magicscroll_frostbolt",
class = "Item",
uiName = "Magic scroll of Frostbolt",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will release a powerful frostbolt.",
skill = "ice_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "frostbolt",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}

defineObject{
name = "magicscroll_lightning_bolt",
class = "Item",
uiName = "Magic scroll of Lightning bolt",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will release a powerful lightning bolt.",
skill = "air_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "lightning_bolt",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}

defineObject{
name = "magicscroll_poison_bolt",
class = "Item",
uiName = "Magic scroll of Poison Bolt",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will release a powerful poison bolt.",
skill = "earth_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "poison_bolt",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}

defineObject{
name = "magicscroll_ice_shards",
class = "Item",
uiName = "Magic scroll of Ice Shards",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will release a powerful ice shards.",
skill = "ice_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "ice_shards",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}

defineObject{
name = "magicscroll_shock",
class = "Item",
uiName = "Magic scroll of Shock Bolt",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will release a powerful shock bolt.",
skill = "air_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "shock",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}

defineObject{
name = "magicscroll_invisibility",
class = "Item",
uiName = "Magic scroll of Invisibility",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will make the party invisible.",
skill = "air_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "invisibility",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}

defineObject{
name = "magicscroll_enchant_fire_arrow",
class = "Item",
uiName = "Magic scroll of Enchant Fire Arrow",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will make an arrow enchanted with fire.",
skill = "fire_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "enchant_fire_arrow",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}

defineObject{
name = "magicscroll_fire_shield",
class = "Item",
uiName = "Magic scroll of Fire Shield",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will release fire shield for the party.",
skill = "fire_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "fire_shield",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}

defineObject{
name = "magicscroll_frost_shield",
class = "Item",
uiName = "Magic scroll of Frost Shield",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will release frost shield for the party.",
skill = "ice_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "frost_shield",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}

defineObject{
name = "magicscroll_poison_shield",
class = "Item",
uiName = "Magic scroll of Poison Shield",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will release poison shield for the party.",
skill = "earth_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "poison_shield",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}

defineObject{
name = "magicscroll_shock_shield",
class = "Item",
uiName = "Magic scroll of Shock Shield",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will release shock shield for the party.",
skill = "air_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "shock_shield",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}

defineObject{
name = "magicscroll_fireburst",
class = "Item",
uiName = "Magic scroll of Fireburst",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will release a powerful fireburst.",
skill = "fire_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "fireburst",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}

defineObject{
name = "magicscroll_poison_cloud",
class = "Item",
uiName = "Magic scroll of Poison Cloud",
model = "assets/models/items/scroll.fbx",
description = "Reading this scroll will release a powerful poison cloud.",
skill = "earth_magic",
gfxIndex = 113,
accuracy = 0,
coolDownTime = 5,
attackMethod = "castWandSpell",
spell = "poison_cloud",
wandPower = 25,
charges = 1,
emptyItem = "magicscroll_empty",
weight = 0.3,
}
bastien067
Posts: 8
Joined: Thu Nov 01, 2012 6:41 am

Re: Bastien067 experiments, new assets and other...

Post by bastien067 »

Thank you for the comments and Ciccipicci great wotk you have done ! thank you very much !

I'm try to make "monk" things now... I always liked to paly monks in fantasy games !

So first i made an object who use castRuneSpell and requires the unarmed_combat skill to be used.. so the "monk" is a fighter using the unarmed combat skill to throw spells.

the code for the objet (i use a golden dragon as model : kung fu style !)

Code: Select all

cloneObject{
		name = "monk_dragon",
		baseObject = "golden_dragon",
		description = "This dragon figure from the Xuyi schools help monks to focus their powers",
		uiName = "Monk magic dragon",
		skill = "unarmed_combat",
		requiredLevel = 1,
		attackMethod = "castRuneSpell",
		treasure = false,
	}
And i made a couple of spell to use with it, inspired by other scripts I have seen here

Code: Select all

defineSpell{
   name = "monk_haste",
   uiName = "Speed of the Serpent",
   skill = "unarmed_combat",
   level = 5,
   runes = "ACE",
   manaCost = 20,
   onCast = function(champion) 
        champion:setCondition("haste", 50)
	hudPrint(champion:getName() .. " uses Speed of the Serpent")
	party:playScreenEffect("frostburst")
	playSound("heal_party")
	end
	}
This one is working with no problem, it gives haste to the monk.

but this one, supposed to be a self heal, insipred by healing spell i have seen on the forum, is not working properly :

Code: Select all

defineSpell{
   name = "monk_heal",
   uiName = "Health of the Bear",
   skill = "unarmed_combat",
   level = 5,
   runes = "ABC",
   manaCost = 20,
   onCast = function(champion, skill)
	local heal_amount = 2 *skill 
        champion:modifyStat("health", heal_amount)
	hudPrint(champion:getName() .. " uses Health of the Bear  and gained" .. heal_amount .. "hp")
	party:playScreenEffect("frostburst")
	playSound("heal_party")
	end
	}
The local heal_amout is equal to 2*skill (and the skill is unarmed_combat)
It work in-game, but dont heal the proper amount : for an unarmed combat skill of 5 (the min to throw the spell) it is supposed to heal by 2*5 = 10 hp... but it heals the monk by 30 hp, with a skill of 5 in unarmed combat. Same with a skill of 20 : it heal 30hp when it supposed to heal 2*20= 40hp...
Why it's not working please help ?
Meanwhile i'll continue to work on other "monk things" ^^
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: Bastien067 experiments, new assets and other...

Post by Grimwold »

ok I think I see what's happening with the healing spell.

onCast provides 5 variables champion x y direction and skill... you are using the second, which is x co-ordinate as your skill... so healing amount will vary depending on which space you are stood in!

try this:

Code: Select all

    defineSpell{
       name = "monk_heal",
       uiName = "Health of the Bear",
       skill = "unarmed_combat",
       level = 5,
       runes = "ABC",
       manaCost = 20,
       onCast = function(champion, x, y, direction, skill)
       local heal_amount = 2*skill
            champion:modifyStat("health", heal_amount)
       hudPrint(champion:getName() .. " uses Health of the Bear and gained " .. heal_amount .. "hp")
       party:playScreenEffect("frostburst")
       playSound("heal_party")
       end
       }
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Bastien067 experiments, new assets and other...

Post by HaunterV »

Grimwold wrote:ok I think I see what's happening with the healing spell.

onCast provides 5 variables champion x y direction and skill... you are using the second, which is x co-ordinate as your skill... so healing amount will vary depending on which space you are stood in!

try this:

Code: Select all

    defineSpell{
       name = "monk_heal",
       uiName = "Health of the Bear",
       skill = "unarmed_combat",
       level = 5,
       runes = "ABC",
       manaCost = 20,
       onCast = function(champion, x, y, direction, skill)
       local heal_amount = 2*skill
            champion:modifyStat("health", heal_amount)
       hudPrint(champion:getName() .. " uses Health of the Bear and gained " .. heal_amount .. "hp")
       party:playScreenEffect("frostburst")
       playSound("heal_party")
       end
       }
I see nothing wrong with location based healing, just set a description mentioning leylines and it'll be fine. :P
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
bastien067
Posts: 8
Joined: Thu Nov 01, 2012 6:41 am

Re: Bastien067 experiments, new assets and other...

Post by bastien067 »

Ok thank you very much grimwold !! That helps me a lot !
As I said I'm a total newbie in scripting, i didn't know that I have to declare all the variables enven if I dont use it.
So I go back to work with this new elements.
Post Reply