pit not pit

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!
Post Reply
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

pit not pit

Post by Granamir »

Hi,
anyone knows a way to make a pit act not like a pit.
Now when u step on a pit u activate some script that stop everything, make u fall for pit height then change level going down and falling 'till ground.
As i'm using pit to make lava lake i'd like party to go in there and take damage not fall underneath.
Anyone knows how to disable pit behavior but not graphics?
Thank you

PS: for same reason is there a way to put something like an invisible platform under lava surface, so party goes down only half tile? i mean in object definition; offset is not supported for platform component atm.
Eburt
Posts: 69
Joined: Thu Feb 05, 2015 5:44 am

Re: pit not pit

Post by Eburt »

My initial reaction would be to use a platform component instead of a pit component - just disable it when the party walks overhead. Then you can set up the appropriate model and animations.

As for the platform offset - I'm fairly certain this should work. setOffset() is inherited from the base Component class. I haven't actually ever tried this though, so I'm not sure if it really behaves correctly.
Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: pit not pit

Post by Azel »

In my demo Mod, I just put a Floor_Trigger on top of the Pit, and when the party steps on the Pit, I move them myself with Script activated by the Floor Trigger. Might not be the best way, but works! :mrgreen:
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: pit not pit

Post by minmay »

Why would you want to use PitComponent when you don't want pit behaviour? If you just want the model for one of the pit objects, either disable all the other components or define a new object that only has the ModelComponent.

Making the party fall only a "half tile" won't work very well on its own as it will result in aliased movement behaviour; you can test this yourself by using setWorldPosition() or the heightmap to make a PlatformComponent that isn't level with the rest of its elevation, and moving onto or off of it. The easiest way to make seamless climbing out is probably dividing the level's module height by some value and multiplying all elevations on that level by the same value; then you'd have finer elevations and could use LadderComponents to climb 1.5 or 1 meter, letting the party climb your "half tile" or "third tile" of distance (which is actually a full tile) seamlessly. However, this comes with all the undesirable effects you'd expect; you can't use LadderComponent or MonsterChangeElevationComponent anywhere else on the level, among a dozen other things. Instead my recommendation would be to take advantage of PartyComponent.onMove to make your own fake LadderComponent that lets the party "climb" whatever distance you want; since this is only being used for climbing these "half tile" elevations you wouldn't need to implement most of LadderComponent climbing, just the camera movement (abusing setWorldPosition and setWorldRotation on the party is probably easier than using CameraComponent for this) and increasing elevation at the end.
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.
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: pit not pit

Post by Granamir »

Thank you guys.

Azel it could be a solution, ty.

Minmay u'r right i don't need a pit...i just used it because i started from someone else work and he used pit. :-P
I know about those movement behaviour, unfortunatelly i have to keep it because i need partial movement and your solution is far too difficult for my skills. I already have some of those movement in my mod, i hope people don't be too much annoyed by that.
I don't need a platform either since i made it an insta-kill object.

Again than you for your help.

PS: Eburt i used "offset = vec(x,y,z)" in object definition and i had in response something like "offset not supported for platform component" in my console.
Where have i to use "setOffset()"? and which argument i need in ()?
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: pit not pit

Post by bongobeat »

if you still want to use a pit, without doing a new model, you can put a invisible platform and a mine_floor_01 on it, at the desired height (-1 floor height or more from the top floor(lava)), then when the party goes into the lava it will fall until it reach the platform and stop falling without changing levels.

or why don't you simply dig your level? I don't know how looks your lava, but maybe you don't need a pit. You just have to lower your floor on the desired height. then place your lava stuff over the hole.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: pit not pit

Post by Granamir »

Ty bongobeat,
at the end i did as u say, lowered lava floor
easyest way, i don't even need platform because i made it a tile damager that kills party
Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: pit not pit

Post by Azel »

Oh fun. Can't wait to fall in it :P
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: pit not pit

Post by bongobeat »

hot!
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: pit not pit

Post by Granamir »

:lol: :lol:

EDIT: :lol: i just discovered i need a platform otherwise tile damager doesn't work in each condition (if i fall from heights it doesn't kill party)
Anyone can help me setting a platform in object definition with right offset?
TY
Post Reply