Way to modify party speed ?

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
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Way to modify party speed ?

Post by cromcrom »

Hello there my friends :-)

While waiting for the next Glögg coding cession (that I hopefully won't miss because of being at work :-( ), and requesting a get/set party speed modifier, are you people aware of a way to freeze the party in place (not mentionning the paralysis condition, I justwant to prevent the party from moving). If you know a way to change the speed, I am interested, too ^^

Thanks in advance.
A trip of a thousand leagues starts with a step.
User avatar
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Re: Way to modify party speed ?

Post by Blichew »

Maybe try this with counter which increases it's value via onMove party hook ? Check with counter.value % 2 and move only if it's an even value.

Key to this seems to be if party.onMove is executer before or after actual move...
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Way to modify party speed ?

Post by msyblade »

I'm not yet familiar with the differences in syntax for party hooks in LoG2, but in LoG1 we would put an onMove hook on the party, which connects to a counter. If the counter reads 0 then onMove returns false. Then it was just placing a pad to decrement the counter to 0, and a timer to increase it to 1 when ready to allow movement again.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Way to modify party speed ?

Post by cromcrom »

I already have a quite complex exhaustion system. However, it only increases food consumption so far. I will try the return false for onMove hook, although I think it doesn't work. I will check this evening. Thanks for the tips anyways :-)
A trip of a thousand leagues starts with a step.
User avatar
remma
Posts: 36
Joined: Mon Apr 15, 2013 11:03 pm
Location: Newcastle upon Tyne, England

Re: Way to modify party speed ?

Post by remma »

used to be able to do it with the framework in LoG1

function freeze()


fw.setHook('party.test.onMove',
function(self,dir)
return false
end
)

end


function unfreeze()

fw.removeHook('party.test.onMove')

end


So something involving an onmove hook?
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Way to modify party speed ?

Post by cromcrom »

I check, "return false" works like a charm. It should be really easy to check some variables or function to return false, than have a delayed call or timer setting the return to true. I will try this, sounds fun.
A trip of a thousand leagues starts with a step.
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Way to modify party speed ?

Post by cromcrom »

Ok, I have it :-)
A trip of a thousand leagues starts with a step.
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Way to modify party speed ?

Post by msyblade »

good deal crom, glad you got it. :D
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Aisuu
Posts: 61
Joined: Fri Oct 31, 2014 2:07 pm

Re: Way to modify party speed ?

Post by Aisuu »

cromcrom wrote:Ok, I have it :-)
Can you provide full script please? I need to slow party in specific places as well for my mod..
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Way to modify party speed ?

Post by cromcrom »

There you go :-)
viewtopic.php?f=22&t=8309

Enjoy :-)
A trip of a thousand leagues starts with a step.
Post Reply