Ask a simple question, get a simple answer

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
minmay
Posts: 2777
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post 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.)
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
rlewarne04
Posts: 13
Joined: Wed Feb 04, 2015 9:05 pm

Re: Ask a simple question, get a simple answer

Post 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 :)
User avatar
Eleven Warrior
Posts: 739
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Ask a simple question, get a simple answer

Post 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()
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Ask a simple question, get a simple answer

Post 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 ?
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Ask a simple question, get a simple answer

Post by msyblade »

Perhaps an "else" line is in order, so the script is prepared for the monster to not be alive when it checks.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
lyle_drake
Posts: 20
Joined: Fri Jan 16, 2015 7:53 pm

Re: Ask a simple question, get a simple answer

Post 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.
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Ask a simple question, get a simple answer

Post 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).
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post 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:
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: Ask a simple question, get a simple answer

Post 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:
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Ask a simple question, get a simple answer

Post 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.
Last edited by AndakRainor on Sat Feb 07, 2015 5:13 pm, edited 1 time in total.
Post Reply