for those who are interested by an area of text input
(example, open a secret door with a password)
Sample script
- connection between a pressure plate, and buttons in the interface (onDrawGui). (change properties of the buttons)
- input text
connection between a wall_button, textinput , secretdoor
to open the secret door, type "OPENSECRET" in the text area
you can use and modify this code
dungeon with source files
http://grimrock.nexusmods.com/mods/182
sample script (lua oop) textinput and buttons
Re: sample script (lua oop) textinput and buttons
wow, thanks for working up this proof of concept, good example of what can be done
Finished Dungeons - complete mods to play
Re: samples scripts (textinput, buttons trace projectile)
A simple function that can target a projectile
no timer, but the function ondrawGui
example:
when the projectile passes under a wooden door, the door closes.
spawn your projectile with a id=myspell
in your script1
The projectile closes all the doors under which it passes and display the names of all entities on its way.
no timer, but the function ondrawGui
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onDrawGui = function (g)
script1.traceProjectile()
end
}
when the projectile passes under a wooden door, the door closes.
spawn your projectile with a id=myspell
Code: Select all
defineSpell{
name = "myspell",
uiName = "myspell",
skill = "air_magic",
level = 0,
runes = "CH",
manaCost = 10,
onCast = function()
script1.mySpell()
end
}
function mySpell()
local spell
local dx, dy = getForward(party.facing)
local x = party.x + dx
local y = party.y + dy
if x<0 then x=0 end
if x>31 then x=31 end
if y<0 then y =0 end
if y>31 then y = 31 end
spawn("lightning_bolt",party.level,party.x+dx,party.y+dy,party.facing,"myspell")
end
Code: Select all
xt = 50
yt = 50
function traceProjectile()
if myspell then
local x=myspell.x
local y=myspell.y
if xt ~= x or yt ~=y then -- execute only if the coordinates are changed
xt = x
yt = y
for i in entitiesAt(party.level,x,y) do
if i.name ~= "lightning_bolt" then
hudPrint(i.name)
end
if i.name == "dungeon_door_wooden" then i:close() end
end
end
else
xt = 50
yt = 50
end
end
Re: sample script (lua oop) textinput and buttons
another very cool example, thanks!
Finished Dungeons - complete mods to play
Re: sample script (lua oop) textinput and buttons
This is the principle I've been using to track spells in exsp (viewtopic.php?f=14&t=4459). I do not know if you were aware of it or if you checked the code...
I track spellProjectiles by Id, creating a spell object with properties and methods which is handled oop-style across the different functions. It also includes detection algorithms for various collisions and a hooks system, effects, monster methods, helper functions...
I track spellProjectiles by Id, creating a spell object with properties and methods which is handled oop-style across the different functions. It also includes detection algorithms for various collisions and a hooks system, effects, monster methods, helper functions...
Re: sample script (lua oop) textinput and buttons
That's a pretty cool script. I think that it would be a nice addition to the grimwidgets framework: https://github.com/xanathar/grimwidgets
Thread: viewtopic.php?f=14&t=4454
Would you like to participate and convert your script for the grimwidgets? We already have a similar 3D button made by Xanathar, but we don't have a text input field.
Thread: viewtopic.php?f=14&t=4454
Would you like to participate and convert your script for the grimwidgets? We already have a similar 3D button made by Xanathar, but we don't have a text input field.
- 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
- cloneObject viewtopic.php?f=22&t=8450
Re: sample script (lua oop) textinput and buttons
You can use this code as you want, it's just an exemple it needs to be improved.