~Advanced Scripting and Editor Help

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!
dancodan
Posts: 19
Joined: Sun Apr 29, 2012 1:38 pm

Re: ~Advanced Scripting and Editor Help

Post by dancodan »

Wow thanks a lot guys!
It works now.

I finally understand why the object didnt spawn on the surface. Cause I didn't have the item in the world already.
I will now try to spawn it directly in to the Alcove, without having it in the world already.

Thanks JohnWOrdsworth, Nutjob and SnowyOwl47.

I really appreciate the help guys
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: ~Advanced Scripting and Editor Help

Post by NutJob »

Anyone know how to get the state of a lever (actived/deactivated, true/false, 0/1, Good Ash/Bad Ash)?

Works! But only because that lever is real and I'm not imagining it. (it exists in the game)

Code: Select all

lever_state = myStupidLeverPullMe.lever:isEnabled()
Works

Code: Select all

myStupidLeverPullMe.lever:setState("activated") --as well does "deactivated" of course
Therefore you'd think...

Code: Select all

unkLever_state = myStupidLeverPullMe.lever:getState()
..but it don't.

So I tried Log1 method call

Code: Select all

strLever_state = myStupidLeverPullMe.lever:getLeverState()
...nada

Now, just trying anything.

Code: Select all

unkLever_state = myStupidLeverPullMe.lever:isActive() -- seems sensible
unkLever_state = myStupidLeverPullMe.lever:isActived()
unkLever_state = myStupidLeverPullMe.lever:isDeactivated() -- sure I'll accept reverse logic, anything please
Note: I setup a floor_trigger to [attempt] to get the state of the lever so I didn't mess with logic as the lever is being pulled/interacted. So question is GOTO Line:1
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: ~Advanced Scripting and Editor Help

Post by JohnWordsworth »

Haha, you got very close - it was just a spelling mistake that threw you!

I have just tried the following, and it returns true or false...

Code: Select all

mine_lever_1.lever:isActivated()
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: ~Advanced Scripting and Editor Help

Post by NutJob »

JohnWordsworth wrote:Haha, you got very close - it was just a spelling mistake that threw you!

I have just tried the following, and it returns true or false...

Code: Select all

mine_lever_1.lever:isActivated()
WORKS!

{joyous exclamative} You are pure awesome for finding my error!

I think I need to step away from the code for the evening! I think I just hit 14 hours now and my head banging is not a result of Heavy Metal!
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: ~Advanced Scripting and Editor Help

Post by JohnWordsworth »

There is a point where you just gotta sleep :p. Although, I think there is a Twitch interview with a couple of the LOG guys in 45 minutes - so just hold out a bit longer...? :p
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: ~Advanced Scripting and Editor Help

Post by NutJob »

I'll pop to the front of these forums and find a link. Thanks, for the heads up. Setting up a universal bitmask parser for puzzle solving I think is too much right now.
SpacialKatana
Posts: 163
Joined: Fri Sep 14, 2012 6:20 pm

Re: ~Advanced Scripting and Editor Help

Post by SpacialKatana »

Is there any way of finding out what the gfxIndex numbers are for the keys? I see JW used 30 for his tome...I need to clone keys.

Cheers.
User avatar
ScroLL
Posts: 56
Joined: Tue Sep 18, 2012 12:21 pm
Location: Vermont

Re: ~Advanced Scripting and Editor Help

Post by ScroLL »

SpacialKatana wrote:Is there any way of finding out what the gfxIndex numbers are for the keys? I see JW used 30 for his tome...I need to clone keys.

Cheers.
Another great solution from John Wordsworth:

Spawn the item whose gfxindex you want to see and print it to the console:

Code: Select all

print(spawn("tome_wisdom").item:getGfxIndex());
SpacialKatana
Posts: 163
Joined: Fri Sep 14, 2012 6:20 pm

Re: ~Advanced Scripting and Editor Help

Post by SpacialKatana »

ScroLL wrote:
SpacialKatana wrote:Is there any way of finding out what the gfxIndex numbers are for the keys? I see JW used 30 for his tome...I need to clone keys.

Cheers.
Another great solution from John Wordsworth:

Spawn the item whose gfxindex you want to see and print it to the console:

Code: Select all

print(spawn("tome_wisdom").item:getGfxIndex());
Awesome dood fank you very much ( The key was 62 btw) :D
Post Reply