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
Khollik
Posts: 171
Joined: Tue Aug 29, 2017 6:44 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by Khollik »

Hi Isaac

Thanks for your very complete answer (as always) but It still doesn't work :(

I tried to add this in the party component, but I only have "invalid component property", as if it doesn't tecognize the function:

Code: Select all

isIdle = function()
script_localizer.script:checklocalizer()
end,
(Obviously, the aim is that when the party doesn't act, something happens...)

I also tried your second method, by adding a connector in a script entity, but I have the same issue.

FYI, I've added other functions in the party component, like onMove, onTurn etc. and these work well. I also checked (since isIdle() is mentioned as Beta 2.2.4 https://github.com/JKos/log2doc/wiki/Co ... -component) and I have the same LOG2 version.

What am I missing there?

K.
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Hooks tend to begin with 'on'; as with onMove, or onEquipItem. The methods that begin with "is", are intended to return a value that indicates whether something is, or is not. And the Get methods all return certain object values.

So if you call isIdle() it returns true or false —if the party is idle or not. These are useful in If and While blocks, as conditions.

Such as:

Code: Select all

if party.party:isIdle() then
script_localizer.script:checklocalizer()
end,
The checklocalizer script would be called if the party were idle at the time that this was called.
User avatar
Khollik
Posts: 171
Joined: Tue Aug 29, 2017 6:44 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by Khollik »

OK I get it, thanks :!:

But what if I want to check if the party is idle, not a specific moment but in all the level? Is there a way to do it without a timer which would check every second (or so) if isIdle() returns true? For now, it's the only solution i can imagine (I hoped I could bypass it by putting isIdle as a permanent component...).

Sorry again if the answer is obvious.
User avatar
Zo Kath Ra
Posts: 931
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra »

Khollik wrote: Sun Oct 21, 2018 3:10 pm OK I get it, thanks :!:

But what if I want to check if the party is idle, not a specific moment but in all the level? Is there a way to do it without a timer which would check every second (or so) if isIdle() returns true? For now, it's the only solution i can imagine (I hoped I could bypass it by putting isIdle as a permanent component...).

Sorry again if the answer is obvious.
Do you want this:
When the party enters a certain level, the game waits until the party becomes non-idle.
Then it sets a flag and/or something happens.

It'd be great if you could be more specific about what you're trying to do, but it's ok if you don't want to spoil a puzzle you're making.
User avatar
Khollik
Posts: 171
Joined: Tue Aug 29, 2017 6:44 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by Khollik »

Correct, I'm trying not to spoil one puzzle I'm working on :D

What I want is a way to check in a specific level if the party is acting or not. And in the second case, well, "something" ( :?: ) continuously occurs to the party so that the player has to play, and has to play quick...
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom »

Using copy/paste in the editor causes glitches especially with too many objects at the same time especially ceilings.

I screwed up one of my maps, copying/pasting a bunch of ud_ceilings at the same time.
I did this 2 months ago and it was the last adds to that specific map.
However I got the glitch now in that map where stuff starts disappearing and then crashes if you try adding more stuff.

Is there a way to fix this manually in the dungeon notepad file? Is data stored somewhere else besides the dungeon notepad file that causes this issue?
And is there any cure besides deleting the entire affected map and restart building the map from scratch?

And most importantly, is this glitch/error confined to just that specific map?

EDIT: So I deleted the entire map, in this case level 22, then created a new map on level spot 22. Saved and exit.
Then copied the entire level 22 from the dungeon notepad file from a backup into the dungeonfile with the empty level 22.

And the issue persists, so am I correct the issue lies somewhere in the dungeon notepad file itself? I'm trying to find where the corruption is essentially.

EDIT2: After testing more scenarios, I came to the simple conclusion, that you cannot stack multiple ceilings upon eachother. Who would have thought. Which is basically what I was doing. And that my map maybe isn't bugged at all. Manual object ud_ceilings on the top elevation are simply disappearing because I was placing ud_ceilings a couple of floors lower and then placing floors on top of them to make complex level design.

Maybe it's a combination of both. Who knows? :) But manual object ceilings like for example ud_ceiling_a_01_01 that replace the tile layer ceiling at a lower floor is ok, until you put a 2nd us_ceiling_a_01_02 on a different elevation. Then shit starts to hit the fan, only tha last placed ceiling is displayed.

Removing all ud_ceiling objects and using other means like rotated roofs that don't replace ceiling components fixes it.

https://youtu.be/tawCXbDhkTc
a video where you can see me walking on top floors and then going under them. which would have been impossible with ceiling objects.
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: Ask a simple question, get a simple answer

Post by KhrougH »

can i use "baseObjet" to identify an object or an item?

example:
for var in party.map:entitiesAt(party.x, party.y) do
if string.match(var.baseObject, "decoration") then

this return nil, so it doesn't work. but maybe there is another way.
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

I think the editor is hard coded to ignore objects names that begin with 'base'.

It is possible to spawn a custom item with a name that starts with 'base', and you can check that name, but the item doesn't appear in the editor's left side object panel. Checking the object's name with match does work though.
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Ask a simple question, get a simple answer

Post by Pompidom »

Which asset pack contains the log1 herbs?
User avatar
THOM
Posts: 1266
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Isaac wrote: Wed Oct 24, 2018 3:39 pm I think the editor is hard coded to ignore objects names that begin with 'base'.

It is possible to spawn a custom item with a name that starts with 'base', and you can check that name, but the item doesn't appear in the editor's left side object panel. Checking the object's name with match does work though.
Maybe they don't appear in the Object list of the Editor because they don't have an Editor Icon defined.

At least all objects without one do not appear.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Post Reply