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!
User avatar
Isaac
Posts: 2956
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac » Wed Mar 18, 2015 2:00 pm

sajon wrote:for i=1,10 do allPlates.floortrigger:enable(true)
for i=1,10 do findEntity(allPlates).floortrigger:enable()

AllPlates stores the names as strings, not objects ~as it should be, but you have to then use findEntity() to get the object with the name.

User avatar
Ciccipicci
Posts: 154
Joined: Mon Oct 08, 2012 12:55 am

Re: Ask a simple question, get a simple answer

Post by Ciccipicci » Wed Mar 18, 2015 4:27 pm

Hello. I've just a simple request. Can someone paste complete scripts for teleport particle effect with different colors? Thanks.

sajon
Posts: 38
Joined: Fri Nov 08, 2013 7:17 am

Re: Ask a simple question, get a simple answer

Post by sajon » Thu Mar 19, 2015 12:54 am

Isaac wrote:
sajon wrote:for i=1,10 do allPlates.floortrigger:enable(true)
for i=1,10 do findEntity(allPlates).floortrigger:enable()

AllPlates stores the names as strings, not objects ~as it should be, but you have to then use findEntity() to get the object with the name.


Thanks
Isaac

I thought that it was because the array was strings, not object, but i could not figure out how to convert it. I knew when you put quotes around something it usually means it is an string. then i removed the quotes and it kept giving me table values.

My head is sore and the wall is dented...

but it worked thanks...

User avatar
Eleven Warrior
Posts: 726
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Ask a simple question, get a simple answer

Post by Eleven Warrior » Sun Mar 22, 2015 8:59 am

Hi all. I have looked through the reference and I cannot find how to remove a skill from a champ? You can remove items, conditions and traits, but not sure if you can remove trait. Anyone know how to do this thxs :)

minmay
Posts: 2657
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay » Sun Mar 22, 2015 9:03 am

Use Champion:trainSkill() with a negative number.
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.

User avatar
Eleven Warrior
Posts: 726
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Ask a simple question, get a simple answer

Post by Eleven Warrior » Sun Mar 22, 2015 10:36 am

Ahhhh Thank you Minmay. That's kinda weird but it works :)

User avatar
almostsimon
Posts: 1
Joined: Sun Mar 22, 2015 3:14 pm

Re: Ask a simple question, get a simple answer

Post by almostsimon » Sun Mar 22, 2015 3:26 pm

Hi there

I just started modding and already have come across a script error (which i saw working in a tutorial somehow??):

So what I have is:

Code: Select all

function healparty()

	party:heal()

end
called via a simple floor_trigger. Then i get this error message:
attempt to call method 'heal' (a nil value) X
Can't figure out what i'm doing wrong >.<

Thanks for your help!
almost Simon


EDIT:
Nevermind, I'm just an idiot :>
Seems like some scripts worked in the first one but do not anymore?

So should be:

Code: Select all

party.party:heal()

User avatar
Isaac
Posts: 2956
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac » Sun Mar 22, 2015 3:59 pm

almostsimon wrote:Seems like some scripts worked in the first one but do not anymore?

So should be:

Code: Select all

party.party:heal()
In the second game, objects now have sub-components. calls are now [often] object.component:function().
Even scripts on the game map contain script components, that contain their code and functions.

User avatar
BuzzJ
Posts: 160
Joined: Sat Jan 12, 2013 4:06 pm

Re: Ask a simple question, get a simple answer

Post by BuzzJ » Tue Mar 24, 2015 11:01 am

Is there a simple way to make an object or several spawn on the same tile as the party when an (here unspecified) event occurs? Where defining the location of the party is not necessary?

User avatar
petri
Posts: 1898
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Ask a simple question, get a simple answer

Post by petri » Tue Mar 24, 2015 11:29 am

BuzzJ wrote:Is there a simple way to make an object or several spawn on the same tile as the party when an (here unspecified) event occurs? Where defining the location of the party is not necessary?
Something like this perhaps?

Code: Select all

party.party:spawn("dagger")

Post Reply