Page 16 of 396

Re: Ask a simple question, get a simple answer

Posted: Sun Nov 09, 2014 2:15 pm
by Blichew
onDie is a hook of Health componet, not the monster itself as far as I remember so you should probably look there.

:EDIT: mobile speling, lol

Re: Ask a simple question, get a simple answer

Posted: Sun Nov 09, 2014 5:15 pm
by NutJob
The cube wrote:How to add a ondie hook to a monster spawned by a script?
Use addConnector("onDie", "yourscript","yourfunction")

Re: Ask a simple question, get a simple answer

Posted: Sun Nov 09, 2014 9:49 pm
by Jackard
What is the difference between swamp water, surface water, and underground water?

Re: Ask a simple question, get a simple answer

Posted: Sun Nov 09, 2014 9:52 pm
by Karinas23
Jackard wrote:What is the difference between swamp water, surface water, and underground water?
different colour.


how do i get a spell launcher to fire a spirit relay bolt also whats the entity name i need to put in a receptor to be triggered by a spirit relay bolt

Re: Ask a simple question, get a simple answer

Posted: Sun Nov 09, 2014 10:45 pm
by QuintinStone
Question: I thought I saw a thread where a defineObject block was posted for a single example of each object type; can anyone help me find it?

Re: Ask a simple question, get a simple answer

Posted: Sun Nov 09, 2014 11:05 pm
by Jackard
Karinas23 wrote:
Jackard wrote:What is the difference between swamp water, surface water, and underground water?
different colour.
They all seem to be the same color in my preview? Maybe my graphics options are not set high enough?

Re: Ask a simple question, get a simple answer

Posted: Mon Nov 10, 2014 3:33 am
by PPanda
Karinas23 wrote:how do i get a spell launcher to fire a spirit relay bolt also whats the entity name i need to put in a receptor to be triggered by a spirit relay bolt
You have to program it to shoot via script i believe. Everything is there entity wise, you just have to script the shot.

The entity will be the spell that will trigger the receptor. aka: dark_bolt, poison_bolt, etc. Works just like keys and locks with doors.

Re: Ask a simple question, get a simple answer

Posted: Mon Nov 10, 2014 3:44 am
by PPanda
Jackard wrote:
Karinas23 wrote:
Jackard wrote:What is the difference between swamp water, surface water, and underground water?
different colour.
They all seem to be the same color in my preview? Maybe my graphics options are not set high enough?
On the surface, they might, but hop into them. You'll see a difference.

underground water: lagoon clear on top and underneath.

surface water: blue on top, blue underneath with some limited visibility.

swamp water: blueish green on top, green underneath with fairly limited visibility.

Re: Ask a simple question, get a simple answer

Posted: Mon Nov 10, 2014 7:21 am
by PPanda
Maybe someone can shed some light for me:

I'm trying spawn a bunch of Mobs and give each of them some custom properties. I got everything set up and ready to go, but one minor problem is stopping me from completing my script: I can't seem to use a variable in place of the actual entity ID.

ex:

Code: Select all

function makeamummy()
spawn("mummy", ........., "Mob_1")
local var = "Mob_1.monster"

Mob_1.monster:setLevel(3)    --This works
var:setLevel(3)              --This won't

end
It keeps saying that "attempt to call method 'getHealth' (a nil value) x" which to me means that it's not recognizing the variable as representing the mob ID. I've seen other scripts use a variable in place of an ID, but I seem to be missing something. I'm going to be using an array for naming the mobs, so it's important to me that I use a variable in place of the actual name so I can spam-run the same script section to make my script file smaller.

Re: Ask a simple question, get a simple answer

Posted: Mon Nov 10, 2014 8:57 am
by Prozail
findEntity is your friend.

Code: Select all

function makeamummy()
local var = spawn("mummy", ........., "Mob_1")

--local var = "Mob_1.monster" -- no need for this

Mob_1.monster:setLevel(3)    --This works

--var:setLevel(3)              --This won't
var.monster:setLevel(3)             

--and you can do:

local obj = findEntity("Mob_1")
obj.monster:setLevel(3)


-- also you can spawn somthing and get the unique id automatcally by not naming the object
-- local obj2 = spawn("mummy",.........)
-- and then store obj2.id



end