Page 43 of 395

Re: Ask a simple question, get a simple answer

Posted: Wed Feb 04, 2015 11:04 pm
by minmay
Again, you can make a firearm scale with dexterity (or any other stat) by setting baseDamageStat when you define the FirearmAttackComponent. You just can't change it dynamically like you can with other attack components.
(If you really do need to be able to change it dynamically, and don't want to wait for this bug to be fixed, you could work around it by defining five versions of each of your FirearmAttackComponents, one for each stat and no stat, and just switch between them in the ItemComponent as appropriate.)

Re: Ask a simple question, get a simple answer

Posted: Thu Feb 05, 2015 12:06 am
by rlewarne04
Oh I didn't think of that. Thank you I'll certainly use it in the future :)
I found that I can do it safely using a define object script as it doesn't seem to cause the same error and the weapons scales properly, the same as a Bow or Sword would.

Thank you very much for your help today minmay. I couldn't have done it without you :)

Re: Ask a simple question, get a simple answer

Posted: Thu Feb 05, 2015 10:38 am
by Eleven Warrior
Why is this not working please I am sure it something simple:

function ForceAct1()

force_field_1:activate()
end

EDIT: errr soz I got it now: :oops:

force_field_1.controller:activate()

Re: Ask a simple question, get a simple answer

Posted: Thu Feb 05, 2015 4:49 pm
by AndakRainor
I have a "bad self" error on this line in the isAlive() call :

Code: Select all

if monster ~= nil and monster:isAlive() then
It is in a delayed function used for a periodic effect, the error occured after the death of the monster. Is it dangerous to have a reference to an object or component that is able to die or be destroyed ? Should I use findEntity(id) instead to be sure it still exists ?

Re: Ask a simple question, get a simple answer

Posted: Thu Feb 05, 2015 5:39 pm
by msyblade
Perhaps an "else" line is in order, so the script is prepared for the monster to not be alive when it checks.

Re: Ask a simple question, get a simple answer

Posted: Fri Feb 06, 2015 6:37 pm
by lyle_drake
Here's one that's really bothering me:

I have this magma golem, and for some reason whenever it tries to use a ranged attack, it just sets itself on fire instead. really, i'm stumped.
I've tried messing with its components, i've gone through it's coding in the resource pack, i see no reason why anything should be wrong.
And yet, this golem keeps setting itself alight when it tries to use a ranged attack.

This is weird.

Re: Ask a simple question, get a simple answer

Posted: Fri Feb 06, 2015 7:35 pm
by petri
lyle_drake wrote:Here's one that's really bothering me:

I have this magma golem, and for some reason whenever it tries to use a ranged attack, it just sets itself on fire instead. really, i'm stumped.
I've tried messing with its components, i've gone through it's coding in the resource pack, i see no reason why anything should be wrong.
And yet, this golem keeps setting itself alight when it tries to use a ranged attack.

This is weird.
Try raising ceiling height to at least 2, otherwise the bomb thrown just hits the ceiling (even outdoors).

Re: Ask a simple question, get a simple answer

Posted: Sat Feb 07, 2015 12:10 am
by bongobeat
lol! I feel so stupid! :oops:
thanks for the help, works fine now. I noticed that issue just after defining another golem, and I thought that I do something wrong, but couldn't find what.
Then I notice that I got the same problem with the normal golem, except for one which is placed in a 2 ceiling level!
I did not thought to raise the height of the ceiling for my other testings! :roll:

Re: Ask a simple question, get a simple answer

Posted: Sat Feb 07, 2015 12:58 am
by Azel
I've been placing my outdoor ceiling to a max of 7 to avoid these types of things. I had a fun night of strangeness similar to your experience before I realized the outdoor ceiling was the culprit :shock:

Re: Ask a simple question, get a simple answer

Posted: Sat Feb 07, 2015 4:54 pm
by AndakRainor
Is it possible to make a flying monster fall ? setFlying(false) only changes the way it moves but doesn't make it fall to the ground if it is already one tile above the floor.