
Summoning Horn
-
- Posts: 146
- Joined: Wed Jun 11, 2014 1:31 am
Summoning Horn

- Zo Kath Ra
- Posts: 940
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Summoning Horn
Search the asset pack for files that contain the text "Horn of Summoning"Emera Nova wrote:So I'm wanting to do stuff with the summoning horn much like they did in the main game with bringing out the enemy on the beach using it. How would I need to set up a script to have it call an enemy or create an item if you are standing somewhere.
-
- Posts: 146
- Joined: Wed Jun 11, 2014 1:31 am
Re: Summoning Horn
So I found the Summoning Horn in the assests list and here is the code for it..
>.> I don't see anything in that code that says anything about summoning the monster.
I would like to know how to script that part.
Code: Select all
defineObject{
name = "horn",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/horn.fbx",
},
{
class = "Item",
uiName = "Horn of Summoning",
gfxIndex = 297,
weight = 1.0,
primaryAction = "blow",
description = "This horn has a pungent earthy smell.",
},
{
class = "ItemAction",
name = "blow",
uiName = "Blow Horn",
cooldown = 4,
onAttack = function(self)
for e in party.map:entitiesAt(party.x, party.y) do
if e.script and e.script.blowTheHorn then
e.script:blowTheHorn()
end
end
playSound("blow_horn")
end,
},
},
}

- Skuggasveinn
- Posts: 562
- Joined: Wed Sep 26, 2012 5:28 pm
Re: Summoning Horn
In the code you have this
What this does is it looks for a script in the party location with the function blowTheHorn, if found it executes that function.
So all that you need to to is to place a script in the location you want the party to be standing when they use the horn, that script needs to have a function called blowTheHorn and anything you place in that function (summoning monsters, or whatever) will get executed.
kind regards.
Skuggasveinn.
Code: Select all
onAttack = function(self)
for e in party.map:entitiesAt(party.x, party.y) do
if e.script and e.script.blowTheHorn then
e.script:blowTheHorn()
end
So all that you need to to is to place a script in the location you want the party to be standing when they use the horn, that script needs to have a function called blowTheHorn and anything you place in that function (summoning monsters, or whatever) will get executed.
kind regards.
Skuggasveinn.
-
- Posts: 7
- Joined: Thu Jul 14, 2016 4:27 pm
Re: Summoning Horn
I'm new to programing and wanted the same thing.
I understand how the code for the horn works but I'm confused on how you get the horn in the map in the first place.
I understand how the code for the horn works but I'm confused on how you get the horn in the map in the first place.
- Zo Kath Ra
- Posts: 940
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Summoning Horn
Not sure if I understand your question.Daniknamchang wrote:I'm new to programing and wanted the same thing.
I understand how the code for the horn works but I'm confused on how you get the horn in the map in the first place.
Are you asking how to use the editor?
-
- Posts: 7
- Joined: Thu Jul 14, 2016 4:27 pm
Re: Summoning Horn
I just read it wrong.
I thought you had to make the code but it's already in the horn.
I thought you had to make the code but it's already in the horn.