Wagtunes' Modding Questions

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Zo Kath Ra
Posts: 931
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Wagtunes' Modding Questions

Post by Zo Kath Ra »

wagtunes wrote: Wed May 26, 2021 7:43 pm Champion set health blew up the editor

Code: Select all

Champion:setHealth(0)
only exists in LoG2.
In LoG1, it's

Code: Select all

champion:setStat("health", 0)
edit:
Please, don't ignore the documentation.
Yes, it could be better, especially the one for LoG2, which is often just a list of function prototypes.
But it can answer questions like this one.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Wagtunes' Modding Questions

Post by wagtunes »

Zo Kath Ra wrote: Wed May 26, 2021 7:55 pm
wagtunes wrote: Wed May 26, 2021 7:43 pm Champion set health blew up the editor

Code: Select all

Champion:setHealth(0)
only exists in LoG2.
In LoG1, it's

Code: Select all

champion:setStat("health", 0)
Well, all I did was use the command he gave me. Again, if I knew all the proper syntax, I wouldn't have to ask questions.

While I seriously doubt it will ever happen, maybe someday somebody will put together a comprehensive text book on the LoG syntax. Because right now it is woefully incomplete.
User avatar
Zo Kath Ra
Posts: 931
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Wagtunes' Modding Questions

Post by Zo Kath Ra »

wagtunes wrote: Wed May 26, 2021 8:05 pm While I seriously doubt it will ever happen, maybe someday somebody will put together a comprehensive text book on the LoG syntax. Because right now it is woefully incomplete.
For a while, I thought about doing that for LoG2.
I even had a cool name for it... "Grimoire Two"
But it's an incredible amount of work, so I understand why the developers didn't do it.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Wagtunes' Modding Questions

Post by wagtunes »

Zo Kath Ra wrote: Wed May 26, 2021 8:11 pm
wagtunes wrote: Wed May 26, 2021 8:05 pm While I seriously doubt it will ever happen, maybe someday somebody will put together a comprehensive text book on the LoG syntax. Because right now it is woefully incomplete.
For a while, I thought about doing that for LoG2.
I even had a cool name for it... "Grimoire Two"
But it's an incredible amount of work, so I understand why the developers didn't do it.
So it is equally understandable why scripters would look at some of these commands and not have a clue what to do with them or, don't know what their full capabilities are. Essentially what we have now is an appendix of commands. Hardly sufficient enough to actually learn how to code LoG.
User avatar
Zo Kath Ra
Posts: 931
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Wagtunes' Modding Questions

Post by Zo Kath Ra »

wagtunes wrote: Wed May 26, 2021 8:17 pm So it is equally understandable why scripters would look at some of these commands and not have a clue what to do with them or, don't know what their full capabilities are. Essentially what we have now is an appendix of commands. Hardly sufficient enough to actually learn how to code LoG.
I disagree, the Champion: functions in the LoG1 documentation have both the function prototypes and a short explanation, usually a few sentences.

For example:
Champion:damage(amount, type)
Deals damage to the champion. Type must be “physical”, “fire”, “shock”, “poison” or “cold”.
I don't see how that isn't enough information.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Wagtunes' Modding Questions

Post by wagtunes »

Zo Kath Ra wrote: Wed May 26, 2021 8:22 pm
wagtunes wrote: Wed May 26, 2021 8:17 pm So it is equally understandable why scripters would look at some of these commands and not have a clue what to do with them or, don't know what their full capabilities are. Essentially what we have now is an appendix of commands. Hardly sufficient enough to actually learn how to code LoG.
I disagree, the Champion: functions in the LoG1 documentation have both the function prototypes and a short explanation, usually a few sentences.

For example:
Champion:damage(amount, type)
Deals damage to the champion. Type must be “physical”, “fire”, “shock”, “poison” or “cold”.
I don't see how that isn't enough information.
For that, yes. Should I now go list 100 commands that have no explanation at all? It's easy enough to do.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Wagtunes' Modding Questions

Post by wagtunes »

Let's start with these.

Code: Select all

CastSpellComponent:deplete()	
CastSpellComponent:getCharges()	
CastSpellComponent:getEmptyGfxIndex()	
CastSpellComponent:getEmptyItem()	
CastSpellComponent:getFullGfxIndex()	
CastSpellComponent:getMaxCharges()	
CastSpellComponent:getPower()	
CastSpellComponent:getRequiredLevel()	
CastSpellComponent:getSkill()	
CastSpellComponent:getSpell()	
CastSpellComponent:recharge()	
CastSpellComponent:setCharges(number)	
CastSpellComponent:setEmptyGfxIndex(number)	
CastSpellComponent:setEmptyItem(string)	
CastSpellComponent:setFullGfxIndex(number)	
CastSpellComponent:setMaxCharges(number)	
CastSpellComponent:setPower(number)	
CastSpellComponent:setRequiredLevel(number)	
CastSpellComponent:setSkill(string)	
CastSpellComponent:setSpell(string)
Please point out to me the explanations. I'll wait.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Wagtunes' Modding Questions

Post by wagtunes »

How about these?

Code: Select all

Champion:addSkillPoints(amount)	
Champion:addStatModifier(name, amount)	
Champion:addTrait(name)	
Champion:attack(number, boolean)	
Champion:castSpell(number)	
Champion:consumeFood(amount)	
Champion:damage(dmg, damageType)	
Champion:gainExp(xp)	
Champion:getArmorSetPiecesEquipped(name)	
Champion:getBaseStat(name)	
Champion:getClass()	
Champion:getConditionValue(name)	
Champion:getCurrentStat(name)	
Champion:getDualClass()	
Champion:getEnabled()	
Champion:getEnergy()	
Champion:getEvasion()	
Champion:getExp()	
Champion:getFood()	
Champion:getHealth()	
Champion:getItem(slot)	
Champion:getLevel()	
Champion:getLoad()	
Champion:getMaxEnergy()	
Champion:getMaxHealth()	
Champion:getMaxLoad()	
Champion:getName()	
Champion:getOrdinal()	
Champion:getOtherHandItem(slot)	
Champion:getProtection()	
Champion:getRace()	
Champion:getResistance(element)	
Champion:getSex()	
Champion:getSkillLevel(name)	
Champion:getSkillPoints()	
Champion:hasCondition(name)	
Champion:hasTrait(name)	
Champion:insertItem(slot, item)	
Champion:isAlive()	
Champion:isArmorSetEquipped(name)	
Champion:isBodyPartWounded(slot)	
Champion:isDualWielding()	
Champion:isReadyToAttack(number)	
Champion:levelUp()	
Champion:modifyBaseStat(name, value)	
Champion:modifyFood(amount)	
Champion:playDamageSound()	
Champion:playHealingIndicator()	
Champion:playSound(name)	
Champion:regainEnergy(amount)	
Champion:regainHealth(amount)	
Champion:removeCondition(name)	
Champion:removeItem(item)	
Champion:removeItemFromSlot(slot)	
Champion:removeTrait(name)	
Champion:setBaseStat(name, value)	
Champion:setClass(class)	
Champion:setCondition(name)	
Champion:setConditionValue(name, value)	
Champion:setEnabled(enabled)	
Champion:setEnergy(energy)	
Champion:setFood(food)	
Champion:setHealth(health)	
Champion:setName(name)	
Champion:setPortrait(filename)	
Champion:setRace(race)	
Champion:setSex(sex)	
Champion:setSkillPoints(points)	
Champion:showAttackResult(any, string)	
Champion:swapItems(slot1, slot2)	
Champion:swapWeaponSets()	
Champion:trainSkill(name, times)	
Champion:upgradeBaseStat(name, value)
Again, please point out the explanations.

I'm sorry, this isn't how you learn a language.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Wagtunes' Modding Questions

Post by wagtunes »

All this page is, is a list of commands.

http://www.grimrock.net/modding/scripting-reference/

Maybe you're smart enough to learn how to program LoG from this. I'm not. I need more.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Wagtunes' Modding Questions

Post by wagtunes »

wagtunes wrote: Wed May 26, 2021 8:53 pm
Zo Kath Ra wrote: Wed May 26, 2021 8:22 pm
wagtunes wrote: Wed May 26, 2021 8:17 pm So it is equally understandable why scripters would look at some of these commands and not have a clue what to do with them or, don't know what their full capabilities are. Essentially what we have now is an appendix of commands. Hardly sufficient enough to actually learn how to code LoG.
I disagree, the Champion: functions in the LoG1 documentation have both the function prototypes and a short explanation, usually a few sentences.

For example:
Champion:damage(amount, type)
Deals damage to the champion. Type must be “physical”, “fire”, “shock”, “poison” or “cold”.
I don't see how that isn't enough information.
For that, yes. Should I now go list 100 commands that have no explanation at all? It's easy enough to do.
Also, for that command above, how about an example of a practical application so we can see it in use and maybe get a better understanding of how to use it?

Oh yes, I also taught programming for about 4 years, I was told I was the best teacher they ever had at that school. Sadly, they closed and I had to move on to something else.

Anyway, there is a way to teach a language and there is a way not to teach a language. The LoG scripting reference is the way not to teach a language.

Of course we can just agree to disagree. I mean what do I know? I've only been doing this stuff most of my life.
Post Reply