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
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Re: Ask a simple question, get a simple answer

Post by Blichew »

1. How do I remove the natural loot that a monster can drop? I want to use a watered-down Skeleton Commander as an early boss, but I can't seem to stop him from dropping his longswords. I want him to drop what I say, and nothing more.I know there is a "setLootDrop" component but it asks for a table and I don't know what to put.
I assume you want to change only this one Skeleton Commander, if that's the case just use:

Code: Select all

skeleton_commander_1.monster:setLootDrop = { }
2. When editing equipment, I can't seem to remove item properties. For example, when basing a new cloak off the "bear pelt", I tried "new_cloak.equipmentitem:setResistCold(0)". That sets the cold resist to 0, but unfortunately doesn't remove the tooltip from the item. When you hover over it, it says "Resist Cold +0". I need to get rid of that completely.
Just a wild guess: have you tried editing item description with

Code: Select all

ItemComponent:setDescription(string)
?
4. I need to spawn an edited item inside a container or on the floor. Whenever I spawn one, it just appears in front of the party. Basically I just need the proper syntax for a script that lets me spawn an edited item AND put it at coordinates/container at the same time. This seems like an easy question but I've been tinkering for hours and can't get it right.
Let's assume your chest has id chest_1, try using:

Code: Select all

chest_1.surface:addItem(spawn("wanted_item"))
It might even work without spawn, but with existing item which has id (haven't tried that so I'm not sure):

Code: Select all

chest_1.surface:addItem("wanted_item_1")
User avatar
Matlock19
Posts: 23
Joined: Sun Nov 02, 2014 2:11 am

Re: Ask a simple question, get a simple answer

Post by Matlock19 »

Thanks for your help blichew.

1. Edit: Wait no, that gives me the error " function arguments expected near '=' "
2. I have not, and don't know what that does.
4. What I really need to know is how to define an edited item in a script by itself, so that I can call on it later for spawning or placing in containers. Like how do I create a cloned edited item without also immediately spawning one?
cameronC
Posts: 80
Joined: Wed Apr 11, 2012 10:54 pm

Re: Ask a simple question, get a simple answer

Post by cameronC »

Matlock19 wrote:Thanks for your help blichew.

1. Edit: Wait no, that gives me the error " function arguments expected near '=' "
try:

Code: Select all

skeleton_commander_1.monster:setLootDrop({percentchancetodrop, itemtodrop, percentchancetodrop1, itemtodrop2,  })
2. I have not, and don't know what that does.
I don't think setDescription changes the displaying of modifiers like that. I would -guess- you setResistCold(nil)?
Writer and sometimes artist of the very slightly acclaimed comic series Scrambled Circuits. A comic series about a robot written by a human.

Grimrock 2 socketSystem: viewtopic.php?f=22&t=8546 / Github
User avatar
jxjxjf
Posts: 33
Joined: Fri Oct 24, 2014 6:26 am

Re: Ask a simple question, get a simple answer

Post by jxjxjf »

Is there still room here for simple questions? :D

Anyone know how the dialogue in the Lindworm fight atop the castle was done? Not necessarily the triggers, just what function was used to display the text to the screen like that? It looks like maybe GraphicsContext is the answer(?), but I'm not sure how you access that outside of the onDraw hooks...
cameronC
Posts: 80
Joined: Wed Apr 11, 2012 10:54 pm

Re: Ask a simple question, get a simple answer

Post by cameronC »

jxjxjf wrote:Is there still room here for simple questions? :D

Anyone know how the dialogue in the Lindworm fight atop the castle was done? Not necessarily the triggers, just what function was used to display the text to the screen like that? It looks like maybe GraphicsContext is the answer(?), but I'm not sure how you access that outside of the onDraw hooks...
do you just mean:

Code: Select all

hudPrint("Text!!!")
?
Writer and sometimes artist of the very slightly acclaimed comic series Scrambled Circuits. A comic series about a robot written by a human.

Grimrock 2 socketSystem: viewtopic.php?f=22&t=8546 / Github
User avatar
jxjxjf
Posts: 33
Joined: Fri Oct 24, 2014 6:26 am

Re: Ask a simple question, get a simple answer

Post by jxjxjf »

@cameronC: No, in the Lindworm fight, text is written in a larger font in the center of the screen as dialog. I've tried things like GameMode.showImage(), but that's definitely not how it was done. I was expecting some kind of alternative to hudPrint(), but it doesn't seem like that exists. Was curious if anyone had replicated that effect.
User avatar
5angel
Posts: 7
Joined: Sat Nov 01, 2014 10:07 pm

Re: Ask a simple question, get a simple answer

Post by 5angel »

How do I make a correct multi-floor castle level? The walls on another floor appear to be too [damn] high.
Decayer
Posts: 65
Joined: Sat Oct 13, 2012 3:19 pm

Re: Ask a simple question, get a simple answer

Post by Decayer »

5angel wrote:How do I make a correct multi-floor castle level? The walls on another floor appear to be too [damn] high.
Edit the map properties and set module height to 4.
User avatar
jxjxjf
Posts: 33
Joined: Fri Oct 24, 2014 6:26 am

Re: Ask a simple question, get a simple answer

Post by jxjxjf »

Well, I have another one for you all. Has anyone found a way to trigger an event when a projectile passes THROUGH a tile?

If I disable projectilecollider on a wall_trigger it doesn't trigger anything. Can't seem to think of a way to do this. Teleporters trigger without stopping a projectile, so I must be missing how they do that. Any suggestions?
User avatar
5angel
Posts: 7
Joined: Sat Nov 01, 2014 10:07 pm

Re: Ask a simple question, get a simple answer

Post by 5angel »

Decayer wrote:
5angel wrote:How do I make a correct multi-floor castle level? The walls on another floor appear to be too [damn] high.
Edit the map properties and set module height to 4.
wat
It works.
Is there's some twisted logic behind this?
Post Reply