Hardcoded things to watch for

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
nichg
Posts: 48
Joined: Thu Oct 11, 2012 12:38 pm

Hardcoded things to watch for

Post by nichg »

There are a number of things that are hard-coded and don't seem to have obvious hooks in the asset pack. For example, the goromorg's shield and the necklace that gives you bonus xp gain. Does the engine use the item names to determine this (e.g. will a monster called 'goromorg' always have a shield, any any monster not called 'goromorg' will not?). Similarly, the glowing orb is an item that provides light when equipped but is not a torch (all torch-class items have their graphics replaced dynamically by a torch icon, since thats how the engine displays the current fuel level I guess) - I'm pretty sure thats also a hard-coded effect, since cloning it doesn't create an item that glows.

Do you think it'd be worth accumulating a list of all the hard-coded effects in the engine and the names that produce them? We could have links along-side with solutions to achieve the effects via non-hardcoded means when possible (e.g. for the bonus xp necklace you could add something in the onDeath hook of every monster to grant that xp manually, and for the glowing orb you could have a 1-second timer that spawns an fx lightsource on the party or even do something using the party's onMove to save on the constant creation/destruction of fx objects), and so on.

List so far

Items Monsters
  • Goromorg: Shield effect
Spells
Last edited by nichg on Wed Oct 24, 2012 3:25 am, edited 1 time in total.
User avatar
Komag
Posts: 3654
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Hardcoded things to watch for

Post by Komag »

absolutely this is a very good idea!
Finished Dungeons - complete mods to play
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Hardcoded things to watch for

Post by JKos »

This is a very good idea.

Couple of things that I have noticed:

- The only container that can be inserted manually to another container(chest or sack) is mortar, and it's restricted by name (not containertype as it should be) because cloned mortars can't be inserted to another container. You can add any container to another container from script though by using item:addItem(item). Btw. For some reason item:addItem is undocumented.
- You can't override containers onUseItem-hook. If you do, the container will not open no matter what value the hook returns.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: Hardcoded things to watch for

Post by Grimwold »

all the original spells are hard-coded by name, even though there are spell definitions in the asset pack.. for example if you define a spell and have

Code: Select all

onCast = "ice_shards"
This will attempt to cast the original Ice Shards spell. Several people have tried to define new spells that use the ice shards ranged effect (say for a fire based spell), but to no avail.
User avatar
Merethif
Posts: 274
Joined: Tue Apr 24, 2012 1:58 pm
Location: Poland

Re: Hardcoded things to watch for

Post by Merethif »

Is skull bonus hardcoded as well? I tried to make tribal painted skull some time ago which would give some Energy/Will bonuses but still count as a skull for a Head Hunter (an item suitable especially for those rare minotaur mages, but also usefull for other minotaurs and non-minotaur mages). But sadly the skull seemed to lost its Head Hunter bonus.
User avatar
LordYig
Posts: 175
Joined: Wed Jul 04, 2012 5:45 pm

Re: Hardcoded things to watch for

Post by LordYig »

This is an excellent idea to make this kind of listing ! It should be helpful to every modder out there...

While making some quick tests with containers, I have spotted another thing that seams to be hardcoded in some way, at least adding limits to what you can do.

If you make a new chest class container, you cannot make it with more than the default of 12 slots.
You can make a chest with a lower number of slots, say 8 or 10, but the GUI is measleading since it displays all 12 slots while enabling slots up to the number you have specified.
If you have specified 10 slots for your chest, you would have 10 useable slots with 12 displayed and you cannot interact and put items in the last two slots in the GUI.
The sack class of containers works with the same constraints but with a maximum of 6 slots.
Slots numbers also has to be an even number.

When opening a container in the dungeon preview with an odd number of slots or with more slots than the limit it crash the editor.
I don't know if it would crash the game in a compiled dungeon but i guess it would.

I have not tested new graphics yet to see if you can reproduce the icon effect for sacks containing objects (the icon change), but i have not been able to see this feature anywhere in the asset pack for this.
It could or could not be hardcoded as well.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Hardcoded things to watch for

Post by akroma222 »

Hey folks!

This is an old thread but it touches on my question -
I have a 'Blazing Runelantern' item in Labyrinth of Lies (similar to the goromorg lantern but it emits a torch light effect)

In the definition I have placed -
torch = true,
fuel = math.huge,

I can see that as soon as it is equipped in any slot - the icon is overridden (as is mentioned in the original post)
I have tried to place icons in gfx 131 - 135 of my atlas but this does not seem to work :oops:

Has anyone come up with a solution for this?

Akroma
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: Hardcoded things to watch for

Post by Xanathar »

Additions:
  • Healing crystals all use the "healing_crystal" material. But, you can change the material and the change applies (of course, to all crystals).
  • Sounds used in pits (and probably others) are hardcoded. But, you can change the sound and the change applies (of course, to all pits). One easy hack is to use a silent wav file as a sound for pits and everytime a pit is opened/closed, play a custom sound by script (I did this in my mod).
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
Post Reply

Return to “Modding”