# \[MOD\] Capotzalco's First Mod :D

**URL:** <https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603>\
**Category:** Outdated Mods\
**Created:** [July 16, 2015, 12:36am UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603 "2015-07-16T00:36:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![capotzalco](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/capotzalco/32/3594_2.png) [@capotzalco](https://discourse.stonehearth.net/u/capotzalco)\
**Post date:** [July 16, 2015, 12:36am UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/1 "2015-07-16T00:36:28Z")

</div>

## ZalMod - Crafting with Crystal v0.0.3 - Updated##

This is my first attempt at modding; it adds raw crystal as a resource that drops when mining rock and a new class to craft with it, the Artificer.  
My coding is probably better than my artistic skills (ironically for SH Modders), so I’m definitely not set on any of the models yet, but writing this mod is shaping up to be a good learning experience 😃  
 ![](https://us1.discourse-cdn.com/flex022/uploads/stonehearth/original/3X/3/7/37d47158fa37fd16af3e049cbaad7452d7851701.jpg)  
Here we see the male outfit for the Artificer. His talisman is a crystal coated knife, crafted by the blacksmith.  
 ![](https://us1.discourse-cdn.com/flex022/uploads/stonehearth/original/3X/5/d/5d04434cf8293b8c5bc0bc0a3816b73a2188da79.jpg)  
The derpy egg shaped things are rough blocks of raw crystal. I’ve not yet been able to work out if the above ground boulders can drop items too, and I’ve not yet looked into spawning crystal veins.  
 ![](https://us1.discourse-cdn.com/flex022/uploads/stonehearth/original/3X/c/d/cdf912b4850a27782f286b4ba531715d1e062165.jpg)  
This is the first ‘real’ item the mod adds, a crystal that floats above a pedestal. It sheds light at night.  
I can’t figure out how to get the crystal to keep floating (an effect/anim) when the light activates. Any modders good with effect handling? Can an entity have multiple types of effect simultaneously?  
I’m not fully happy with the anim (it loops badly) but it was surprisingly easy to animate.

As of v0.0.3:  
 ![](https://us1.discourse-cdn.com/flex022/uploads/stonehearth/original/3X/6/d/6dc1853dcfe44173ffd54e2cff843ca3deebf99d.jpg)  
New crystal sconce, woot!

v0.0.2 - Now crystal veins will spawn, added two types of specific crystal and an upgrade to the Footman’s shield.  
v0.0.3 - Added a sconce to go with the current light, also animated but goes on a wall. Added an Ioun stone for footmen that gives a courage buff, and the ability to see head slot items.

## Download

Zalmod v0.0.3 for A11 Latest Branch-2494 [zalmod.zip](https://discourse.stonehearth.net/uploads/short-url/mo8JHwofv6wPvRv1FTwxSJgzgs4.zip) (1.0 MB)

Rename the .zip to .smod and place in your mods folder.

---

<div class="post-metadata">

**Author:** ![8BitCrab](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/8bitcrab/32/48512_2.png) [@8BitCrab](https://discourse.stonehearth.net/u/8BitCrab)\
**Post date:** [July 16, 2015, 12:47am UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/2 "2015-07-16T00:47:35Z")

</div>

very nice! i lookj forward to seeing more from you, and this mod.

> [@capotzalco](#):
>
> I’ve not yet looked into spawning crystal veins.

you should take a look at @phector2004’s tutorial on adding mining resources,

> [@\[Tutorial\] Adding mining resources](http://discourse.stonehearth.net/t/tutorial-adding-mining-resources/10658):
>
> ##Part 1: The randomly mined resource: ###Step 1: Start off by creating a resource. A good starting-point tutorial for adding new items can be found here: For this tutorial’s sake, here’s an example resource, ‘/my\_mod/entities/resources/MY\_RESOURCE/MY\_RESOURCE.json’ : { "mixins": "stonehearth:mixins:item\_properties", "type": "entity", "components": { "item": { "category": "resources", "stacks": 40 }, "stonehearth:material" : { "tags" …

---

<div class="post-metadata">

**Author:** ![phector2004](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/phector2004/32/44268_2.png) [@phector2004](https://discourse.stonehearth.net/u/phector2004)\
**Post date:** [July 16, 2015, 1:52am UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/3 "2015-07-16T01:52:50Z")

</div>

That crystal model is 1000 times better than mine! 😄

Looks good! Hope to see more soon

---

<div class="post-metadata">

**Author:** ![capotzalco](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/capotzalco/32/3594_2.png) [@capotzalco](https://discourse.stonehearth.net/u/capotzalco)\
**Post date:** [July 16, 2015, 11:20am UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/4 "2015-07-16T11:20:38Z")

</div>

Thanks @phector2004, you’re too kind 😃  
And thanks @8BitCrab, I’m gonna put veins up there on my list as they look pretty straightforward (and don’t need a model yay!)

Updated to v0.0.2 😃

---

<div class="post-metadata">

**Author:** ![Relyss](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/relyss/32/41785_2.png) [@Relyss](https://discourse.stonehearth.net/u/Relyss)\
**Post date:** [July 16, 2015, 3:36pm UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/5 "2015-07-16T15:36:03Z")

</div>

> [@capotzalco](#):
>
> I can’t figure out how to get the crystal to keep floating (an effect/anim) when the light activates. Any modders good with effect handling? Can an entity have multiple types of effect simultaneously?

Yes, you can have several effects running at the same time (for example, lanterns are light+particles). It’s just one effect with multiple tracks.

> [@capotzalco](#):
>
> I’m not fully happy with the anim (it loops badly) but it was surprisingly easy to animate

So you finally made the animation? I’ll take a look at it. Sometimes it’s difficult to make the end and start of the animation loop correctly, yeah 😥

---

<div class="post-metadata">

**Author:** ![capotzalco](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/capotzalco/32/3594_2.png) [@capotzalco](https://discourse.stonehearth.net/u/capotzalco)\
**Post date:** [July 16, 2015, 3:44pm UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/6 "2015-07-16T15:44:28Z")

</div>

> [@Relyss](#):
>
> Yes, you can have several effects running at the same time (for example, lanterns are light+particles). It’s just one effect with multiple tracks.

That’s what I thought, but when the light effect comes on, the anim stops ☹

---

<div class="post-metadata">

**Author:** ![Relyss](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/relyss/32/41785_2.png) [@Relyss](https://discourse.stonehearth.net/u/Relyss)\
**Post date:** [July 16, 2015, 4:01pm UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/7 "2015-07-16T16:01:32Z")

</div>

I think it may be due to the lamp component, but I might be wrong.

When the lamp component takes action at night, you’re referencing the effect that only has a light track as content. I suggest that you put this in the content of that “crystal\_pedestal\_light\_effect”:

```
{
"type": "effect",
"tracks": {
    "light": {
        "type": "light",
        "light": "animatedlights/lamp/lamp.animatedlight.json",
        "transforms": {
            "x": 0,
            "y": 3.6,
            "z": 0
        }
    },
	"animation": {
		"type": "animation_effect",
		"start_time": 0,
		"animation": "floating.json",
		"loop": true
  } 
}
}

```

I’ve tested it and it just works fine. Although I was cheating to make it night, but… I hope it doesn’t throw any errors and its behavior is consistent and returns to default “animation only” when day comes… 😕

---

<div class="post-metadata">

**Author:** ![capotzalco](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/capotzalco/32/3594_2.png) [@capotzalco](https://discourse.stonehearth.net/u/capotzalco)\
**Post date:** [July 16, 2015, 10:14pm UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/8 "2015-07-16T22:14:09Z")

</div>

Thanks @Relyss, I didn’t think of that. Now to see if I can fix what happens when you place it at night…

It’s nice to have a more experienced modder look over my work

Edit: @Relyss you star! It fixed both bugs at once 😃

---

<div class="post-metadata">

**Author:** ![capotzalco](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/capotzalco/32/3594_2.png) [@capotzalco](https://discourse.stonehearth.net/u/capotzalco)\
**Post date:** [July 17, 2015, 2:17pm UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/9 "2015-07-17T14:17:24Z")

</div>

And we’re updated 😃

---

<div class="post-metadata">

**Author:** ![Praise](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/praise/32/48248_2.png) [@Praise](https://discourse.stonehearth.net/u/Praise)\
**Post date:** [March 18, 2016, 7:55pm UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/10 "2016-03-18T19:55:02Z")

</div>

Hey, pls feel free to add this to the praisedb - [http://praisedb.x10.bz](http://praisedb.x10.bz)

---

<div class="post-metadata">

**Author:** ![Doc\_Brano](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/doc_brano/32/50733_2.png) [@Doc\_Brano](https://discourse.stonehearth.net/u/Doc_Brano)\
**Post date:** [March 18, 2016, 8:25pm UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/11 "2016-03-18T20:25:27Z")

</div>

how is the progress on this?

---

<div class="post-metadata">

**Author:** ![capotzalco](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/capotzalco/32/3594_2.png) [@capotzalco](https://discourse.stonehearth.net/u/capotzalco)\
**Post date:** [March 18, 2016, 11:40pm UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/12 "2016-03-18T23:40:11Z")

</div>

If there’s interest I can definitely update this…

Took a hiatus while I was waiting for more core systems to be implemented, as my own coding is pretty naff…  
Looks like I may be able to implement some other things soon tho, so I’ll have to get back into it 😃

Things are quite busy with work though atm, so please be patient 😅

---

<div class="post-metadata">

**Author:** ![Shizuyori](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/shizuyori/32/42062_2.png) [@Shizuyori](https://discourse.stonehearth.net/u/Shizuyori)\
**Post date:** [March 19, 2016, 12:09pm UTC](https://discourse.stonehearth.net/t/mod-capotzalcos-first-mod-d/14603/13 "2016-03-19T12:09:00Z")

</div>

Thats cool, it would e good to capture it though on PraiseDB even if its not up to date :).

Its an awesome mod and i don’t want it getting lost due to the passing of time, i’m sure plenty of people have been inspired because of this and will in the future too 😃

If you need some help with the PraiseDB, let me know 🙂
