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
Xardas
Posts: 83
Joined: Fri Jul 28, 2017 12:30 am

Re: Ask a simple question, get a simple answer

Post by Xardas » Fri May 18, 2018 11:52 am

Maybe this helps:
There is an explanation for the getWorldPosition values, which are the same, you use with setWorldPosition

https://github.com/JKos/log2doc/wiki/Ob ... gameobject
In order to get to the other side of the pit you have to get hit by the fireball and die....
Yep.....moving on!

Pompidom
Posts: 486
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom » Fri May 18, 2018 12:48 pm

Xardas wrote:

Code: Select all

function setexp()
  for i = 1, "highest monsternumber" do       --put index here
     local monster = findEntity("monster_"..i)
     if monster then
       monster. monster:setExp(0)
    end
  end
end

delayedCall(self.go.id, 0.1, "setexp")  --calls the function at the start of the game

This works wonderfully in more ways then I would have imagined,
Not only does the script work for the entire mod and thus multiple maps.
I can also add multiple script entities with beasts/undeads etc... basically create categories.
to give custom amounts of experience any way I see fit.
Or to keep things more simple rename all mobs for each map into a different category. to not lose track of high amount of numbers.

This is just awesome.

Pompidom
Posts: 486
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom » Fri May 18, 2018 1:02 pm

Next question, I would like to enforce Ironman mode with the one and only healing crystal in the town to save your game there.
Creating a risk vs reward mechanic venturing out to other maps.
Also creating a more hardcore experience where save scumming is completely disabled.

Is there any way to enforce ironman mode?

User avatar
Curunir
Posts: 332
Joined: Fri Mar 30, 2012 11:19 pm

Re: Ask a simple question, get a simple answer

Post by Curunir » Fri May 18, 2018 1:33 pm

Pompidom wrote:Next question, I would like to enforce Ironman mode with the one and only healing crystal in the town to save your game there.
Creating a risk vs reward mechanic venturing out to other maps.
Also creating a more hardcore experience where save scumming is completely disabled.

Is there any way to enforce ironman mode?
You do realize with this design decision alone you're alienating a good 50% of the already-low number of potential players, right?

It's also simply bad, dull design. It's not risk vs reward, it's just an annoying trip back to town every time you're low on health and resources.

Xardas wrote: Maybe this helps:
There is an explanation for the getWorldPosition values, which are the same, you use with setWorldPosition

https://github.com/JKos/log2doc/wiki/Ob ... gameobject
This is great, thanks! I didn't think of looking at the "get" section! <3

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

Re: Ask a simple question, get a simple answer

Post by minmay » Fri May 18, 2018 7:25 pm

Pompidom wrote:Is there any way to enforce ironman mode?
No.
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
Curunir
Posts: 332
Joined: Fri Mar 30, 2012 11:19 pm

Re: Ask a simple question, get a simple answer

Post by Curunir » Sat May 19, 2018 8:55 pm

Any way to avoid z-fighting in the pillar textures when putting castle_wall_grating next to one another or next to castle walls?

Edit - Figured it out, you can disable the 'frame' component as needed.

User avatar
Curunir
Posts: 332
Joined: Fri Mar 30, 2012 11:19 pm

Re: Ask a simple question, get a simple answer

Post by Curunir » Sat May 19, 2018 10:22 pm

How can I make a walltrigger react only to spells, not items, but still accept any projectile spell?

I found a script by minmay that checks for the type of fireball used, with a script entity placed in the walltrigger tile, with walltrigger accepting "any" and hitting up the script on activation:

Code: Select all

function checkReceptor(walltrigger, projectile)
  if projectile.go.name == "fireball_small" or projectile.go.name == "fireball_medium" or projectile.go.name == "fireball_large" then
    receptor_door_1.controller:toggle()
  end
end
I expanded that to include all types of frost, poison and lightning bolts but in the end, it just crashes with "attempt to index field 'go' (a nil value)".

Any idea how I can make that work?

Zo Kath Ra
Posts: 865
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra » Sat May 19, 2018 10:50 pm

Curunir wrote:Any idea how I can make that work?
projectile is an entity, not a component.

Code: Select all

function checkReceptor(walltrigger, projectile)
	if projectile.name == "fireball_small" or projectile.name == "fireball_medium" or projectile.name == "fireball_large" then
		receptor_door_1.controller:toggle()
	end
end

User avatar
Curunir
Posts: 332
Joined: Fri Mar 30, 2012 11:19 pm

Re: Ask a simple question, get a simple answer

Post by Curunir » Sat May 19, 2018 10:57 pm

Works like a charm, thanks!

Pompidom
Posts: 486
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom » Mon May 21, 2018 3:47 pm

https://ibb.co/e5BTY8
https://ibb.co/b5UJGT
https://ibb.co/dSUtGT
https://ibb.co/jBs8i8

I'm looking for chairs, are there any custom chair objects out there?
A bench would be suitable as well.

Anything is fine, offsetting some random wood object down the Z axis so it looks like a bench like in the 2nd screenshot would be okay :)

The best I can come up with is jamming the throne from DM into the ground moving it closer to the table.

Post Reply