Any spear can be used underwater. If you want to make your own weapon that can be used underwater. Add the line “undervater” to its traits table. Unfortunately, the developer has not made sure that such weapons are visually different from normal ones. So you can check it only by trying to attack underwater.Eleven Warrior wrote: ↑Wed Dec 11, 2024 6:30 am Hi guys. I need a weapon that attacks under water. I think I saw one here in the forums. Thank you for help
Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
I have invented a range weappon called Watershooter.Eleven Warrior wrote: ↑Wed Dec 11, 2024 6:30 am Hi guys. I need a weapon that attacks under water. I think I saw one here in the forums. Thank you for help
You can find it in the recource pack of my mod:
https://www.nexusmods.com/legendofgrimr ... ?tab=files
- Zo Kath Ra
- Posts: 939
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
Hi Eleven WarriorEleven Warrior wrote: ↑Wed Dec 11, 2024 6:30 am Hi guys. I need a weapon that attacks under water. I think I saw one here in the forums. Thank you for help
Could you be more specific, e.g. by explaining why you don't just add the "aquatic" trait to the Item component?
Re: Ask a simple question, get a simple answer
I reply to scripting questions more often here than I do on DIscord. If you feel your question isn't simple enough for this thread, I suggest you make a new thread asking it.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
How well you are getting away with answering Minmay! I'm actually interested in the fate of your mod
viewtopic.php?f=23&t=9130
Even if you're not going to finish it, could you please tell me how you redesigned the skills? I understand that you turned off import standart assets, import skills. And importing standart assets manually. That's not what I'm interested in. I'm more interested in what's in your onDrawSkills hook. Can I take a look at it to see how you did it?
Re: Ask a simple question, get a simple answer
I don't know how simple a question that is. But does anyone know how GraphicsContext.translate() works? I haven't found a description of this function anywhere.
Re: Ask a simple question, get a simple answer
There was nothing fancy or even interesting in that onDrawSkills hook, any programmer that read the GraphicsContext documentation could write it in a few minutes even if they didn't know anything else about Grimrock (and from the untidiness you can see I wrote it in a few minutes too):
SpoilerShow
Code: Select all
function draw(p, context, champion)
for t = 1, #SKILL_TREES do
for s = 1, #SKILL_TREES[t] do
local butt = buttons[t][s]
local x = STARTX*context.width+butt.x*context.height
local y = butt.y*context.height
local size = BUTTON_SIZE*context.height
if context.mouseX >= x and context.mouseX <= x+size
and context.mouseY >= y and context.mouseY <= y+size then
-- context.button is currently broken in onDrawSkills. TODO.
-- if context.button("skillbutton",context.mouseX-1,context.mouseY-1,size,size) then
if context.mouseDown(0) then
skillButtonClicked(champion,t,s)
end
-- end
drawTooltip(p,context,champion,t,s)
end
local known = skills[champion:getOrdinal()][t][s]
local unlocked = true
if not known then unlocked = meetsReqs(champion,t,s) end
context.drawImage2(unlocked and IMG_TRAITS or IMG_TRAITS_LOCKED,x,y,(SKILL_TREES[t][s].icon%10)*75,(math.floor(SKILL_TREES[t][s].icon/10))*75,IMG_FRAME_SIZE,IMG_FRAME_SIZE,size,size)
local frameimg = known and IMG_FRAME_KNOWN or unlocked and IMG_FRAME_UNLOCKED or IMG_FRAME_LOCKED
context.drawImage2(frameimg,x,y,0,0,IMG_FRAME_SIZE,IMG_FRAME_SIZE,size,size)
end
end
end
Think of it as moving the origin point of the GraphicsContext on the screen. drawImage() and such add the context's translation to the x and y values you pass to them to determine where on the screen the image/whatever is drawn. One of the drawing hooks, onDrawAttackPanel, gives you a GraphicsContext that's already translated.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: Ask a simple question, get a simple answer
Does anyone have a potion of water breathing or a spell with the same effect thank you
Re: Ask a simple question, get a simple answer
The potion is in Final Adwenture. The spell can be found in the SpellpackEleven Warrior wrote: ↑Fri Dec 13, 2024 6:07 am Does anyone have a potion of water breathing or a spell with the same effect thank you
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: Ask a simple question, get a simple answer
What mod is the potion in? Thank you.