disabling movement

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Gradunk
Posts: 54
Joined: Tue Oct 22, 2013 2:26 am
Location: Calgary, Canada

disabling movement

Post by Gradunk »

I'm working on my major project called The Forgotten Four but i've run into a few dilemmas.
1. I've played a few mods where, at several points, you can't move. but no where online can i find how to do that. not even in the scripting reference.
2. pretty much i just suck. I need help making a cinematic/3d model of a human Npc that you DONT fight. all it needs to do is stand there

Any help on this?
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: disabling movement

Post by msyblade »

I amy be able to help with both of these, but I'm only on break for a minute, and cannot help at the moment.

Freeze Party:
Do a search (Here on these forums) for "cMove", and try to find a thread about a counter named "cMove"and placing an onMove hook to the party in init.lua. Not sure if the thread exists, or if it's just something a few of us did internally through skype or pm'ing.

3d Model:
Download the LotNR proof's of concept from the Nexus, (sorry no time to link). In the msyblade towntest there are multiple 3d models of people "just standing there". No idle animation, although now, with John Wordsworths "GrimFBX", it should be possible to add an idle animation.

If you still havent figured out the freeze party by the time i get home ( 5 or 6 hrs), i'll throw up detailed instructions for you.

Hope this helps!
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
Gradunk
Posts: 54
Joined: Tue Oct 22, 2013 2:26 am
Location: Calgary, Canada

Re: disabling movement

Post by Gradunk »

So i looked. i found yours, but i don't know how to add it onto the end of the .lua file. i can't look at any of the files in any of the folders in the mod_assets.

so i looked again. found one from Komag so it has to work lol. every version of this i try ends up with the same error saying the cloneObject is a nil value.

cMove = 0
function freezeParty() cMove = 0 end
function thawParty() cMove = 1 end

- plate triggers timer and freezeParty()
- timer triggeres thawParty() and self (deactivate)

cloneObject{
name = "party",
baseObject = "party",
onMove = function(self, dir)
if partyMoveScript.cMove == 0 then return false end
end,
}

that's what he has but i don't know what the nil value is. i also found one that claimed to catch if it was nil but that didn't work either :(

If you know a way for me to be able to actually look at all the mod_asset .luas that would be the best help ever!

I really appreciate that you're helping me though

and i looked for your nexus thing but got carried away with freezing your hotel hades several times haha.
I'll try again tomorrow
User avatar
maneus
Posts: 246
Joined: Mon Jun 17, 2013 10:42 pm
Location: Switzerland

Re: disabling movement

Post by maneus »

Put the following into your init.lua file:

Code: Select all

cloneObject{
   name = "party",
   baseObject = "party",

   onMove = function(self, dir)
      if (cMove:getValue() == 0) then
         return false
      end
         return true
   end,
Then put a counter into your mod named "cMove" and set it to 1.

You can activate this counter by a hidden pressure plate set to "activated", "cMove", "decrement".
The pressure plate must set to triggered by party , so when the party step on it the counter will be set to 0 and you can not move.
For deactivating the counter set a timer to the counter that will "increment" the counter after a while.

That should work for you.

You can find the original post of msyblade here: viewtopic.php?f=14&t=5664&p=62184&hilit=cmove#p62184
Gradunk
Posts: 54
Joined: Tue Oct 22, 2013 2:26 am
Location: Calgary, Canada

Re: disabling movement

Post by Gradunk »

lol you didn't say anything there that wasn't already stated by msyblade himself. it's giving me a nil value i don't know why
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: disabling movement

Post by msyblade »

In your mod assets folder, there are multiple sub folders. One is called "Scripts". Inside that folder you will find the init.lua (which basically lists the .lua's you want the mod to run upon starting.) there is also a "monsters.lua" (To define new ones) a "models.lua" (to define new models for your items.lua or objects.lua etc. . .). If you are having trouble locating the folders, thy are in "documents/Almost Human/Legend of Grimrock/Dungeons/YourDungeonName/Mod Assets".

Replace Komags code with the code supplied by maneus, make SURE it is the last entry in the init.lua, and remember to create the cMove COUNTER in your dungeon and set it to 1. Then any trigger that puts that counter to 0 will freeze the party (they can still turn though). Then any trigger (usually a timer) to set it back to 1 will allow movement to resume. It will work with the code provided by maneus, I'm absolutely positive. (And thank you maneus, for locating and pasting that code for me, saved me a bit of work :)

3d models:

Get the "Town Test Source" from here:
http://www.nexusmods.com/grimrock/mods/ ... D362&pUp=1

and you can even see how they are implemented in the models.lua file, and textures.lua file. Also, NEVER EVER copy a lua over your lua files, you must add entries individually.

This is the exact init.lua from HH2, which freezes the party. (notice the last "import" line, it adds an entirely new .lua file, you can import as many as desired, for organization reasons.(Rather than have one GIANT objects.lua, you can have one for this wallset, one for that group of monsters, etc. . .)
SpoilerShow

Code: Select all

-- This file has been generated by Dungeon Editor 1.3.1

-- import standard assets
import "assets/scripts/standard_assets.lua"

-- import custom assets
import "mod_assets/scripts/items.lua"
import "mod_assets/scripts/monsters.lua"
import "mod_assets/scripts/objects.lua"
import "mod_assets/scripts/wall_sets.lua"
import "mod_assets/scripts/recipes.lua"
import "mod_assets/scripts/spells.lua"
import "mod_assets/scripts/materials.lua"
import "mod_assets/scripts/sounds.lua"
import "mod_assets/scripts/objects.lua"
import "mod_assets/lol_gobelins/scripts/materials.lua"

cloneObject{
   name = "party",
   baseObject = "party",

   onMove = function(self, dir)
      if (cMove:getValue() == 0) then
         return false
      end
         return true
   end,
}
Hope you get it figured out, let us know if not.
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
Gradunk
Posts: 54
Joined: Tue Oct 22, 2013 2:26 am
Location: Calgary, Canada

Re: disabling movement

Post by Gradunk »

it's mostly clear now that explained a lot. but now the question is... where do you go to to 'import' those files? i don't know how to access the files in order to add stuff to them.

I downloaded both those files in the link you posted. the first one... OMG SO MUCH SHTUFF! so i deleted all my folders and copy pasted those over to find out it deleted my dungeon!
i fished mine out from the recycling bin and lost all the extra stuff :( how do i add them to what i have instead of replacing them?

the second one didn't seem to do anything idk what that download was.
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: disabling movement

Post by msyblade »

Open a lua file just like a text document, wordpad will work fine. find the part you want add, hold your mouse button and drag over it perfectly, turning it blue. The select to copy that text, either by right clicking, or hitting <cntrl>+c. Then goto the lus in your assets folder,move to the end of it, then right click and select paste, or use <cntrl>+v. You just use them like a text file.
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
Gradunk
Posts: 54
Joined: Tue Oct 22, 2013 2:26 am
Location: Calgary, Canada

Re: disabling movement

Post by Gradunk »

the wordpad comment was a godsend. i finally found the init.lua. had to do a search for it cause it show up any other way.

YYYYYYYYYYYYYYYYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYYYYYYYYYYYYYYYYYYYYYYY!!

I can't thank you enough for helping me through this. it was i'm sure... much more difficult than it needed to be.

now that i know how to access the .lua files i can add all sorts of stuff!

:D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D

Thanks again. if i run into another problem somewhere down the line i'll let you know lol.
User avatar
Chimera005ao
Posts: 187
Joined: Sun Jun 29, 2014 8:34 am

Re: disabling movement

Post by Chimera005ao »

In case anyone reads this and wants an alternate solution, I just spawned barrel/crate objects with a clear texture around the player/monster that I didn't want to move.
Post Reply