Hello + Script Question
Hello + Script Question
hello grimrock fans,
I just got the game and wanted to say hello to the modders. the release of the editor made me finally buy the game and while i am fighting and puzzling my way through the official storyline, im thinking about starting my own little dungeon mod. back in the good old days i enjoyed neverwinternights scripting and modding, and as i really like the old beholder games - grimrock is the new way to go.
okay, besides that - i have two questions regarding scripting. im still learning and checking out the editor and available online resources, maybe some of you can help me:
1. text display by walking over
to spice up my dungeon maps, i would like to display text whenever the party walks over or bumps into objects/tiles. i figured out how to display text when the party is interaction (for example with a button) but not by simply walking. is there a way to place a trigger on a tile and whenever the party walks over it a text like "the smell of decayed flesh is in the air" is displayed?
and: do the print() and hudprint() functions display text like seen in "walltext" (black box with white text in the middle of the screen), or is there a way to format text or display it in a more decent way? like a textbox at the bottom of the screen?
2. boat movement
okay, this is something i do not really plan to do - as it sounds crazy complicated already. im rather interested if something like this would theoretically be possible. in the old amiga game Knightmare, there was water in some maps and the player could move onto a boat and travel on the water, finally leaving the boat again.
as far as i know, grimrock does not support different floor tiles. so this would require a impassable asset that looks like water, placed on every tile you want to be water. the boat itself would also be an asset - but its beyond my scope if its possible to move the boat plus the party across water assets.
again: i dont plan to script this, im just asking out of curiosity (of course, if someone has a solution - this would be a real cool way to spice up maps).
thanks for your help!
I just got the game and wanted to say hello to the modders. the release of the editor made me finally buy the game and while i am fighting and puzzling my way through the official storyline, im thinking about starting my own little dungeon mod. back in the good old days i enjoyed neverwinternights scripting and modding, and as i really like the old beholder games - grimrock is the new way to go.
okay, besides that - i have two questions regarding scripting. im still learning and checking out the editor and available online resources, maybe some of you can help me:
1. text display by walking over
to spice up my dungeon maps, i would like to display text whenever the party walks over or bumps into objects/tiles. i figured out how to display text when the party is interaction (for example with a button) but not by simply walking. is there a way to place a trigger on a tile and whenever the party walks over it a text like "the smell of decayed flesh is in the air" is displayed?
and: do the print() and hudprint() functions display text like seen in "walltext" (black box with white text in the middle of the screen), or is there a way to format text or display it in a more decent way? like a textbox at the bottom of the screen?
2. boat movement
okay, this is something i do not really plan to do - as it sounds crazy complicated already. im rather interested if something like this would theoretically be possible. in the old amiga game Knightmare, there was water in some maps and the player could move onto a boat and travel on the water, finally leaving the boat again.
as far as i know, grimrock does not support different floor tiles. so this would require a impassable asset that looks like water, placed on every tile you want to be water. the boat itself would also be an asset - but its beyond my scope if its possible to move the boat plus the party across water assets.
again: i dont plan to script this, im just asking out of curiosity (of course, if someone has a solution - this would be a real cool way to spice up maps).
thanks for your help!
--
Fhizban's Asset Repository - the place where you find all my LoG contributions:
viewtopic.php?f=14&t=3904
Fhizban's Asset Repository - the place where you find all my LoG contributions:
viewtopic.php?f=14&t=3904
Re: Hello + Script Question
You can use a hidden pressure plate with activate once attached to your hudPrint script :3
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
Re: Hello + Script Question
Thanks Neikun!
Is there also a invisible object i can place to make a message appear when the player clicks on something? Like a cave-in the player can click on and then it displays a message.
Is there also a invisible object i can place to make a message appear when the player clicks on something? Like a cave-in the player can click on and then it displays a message.
--
Fhizban's Asset Repository - the place where you find all my LoG contributions:
viewtopic.php?f=14&t=3904
Fhizban's Asset Repository - the place where you find all my LoG contributions:
viewtopic.php?f=14&t=3904
Re: Hello + Script Question
That is a good question. I am not sure how you'd go about that
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
Re: Hello + Script Question
make sure the P is capitalized in hudPrint and activate once. You can script the hudprint to clicking on an object, but it must be interactive to choose the trigger (alcove, hidden plate,etc) junk has no trigger to call
Last edited by msyblade on Sun Oct 21, 2012 6:57 pm, edited 1 time in total.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
Re: Hello + Script Question
Try putting a very large, silent and invisible button just in front of the cave-in and linking it to a script entity. I haven't looked at buttons much, but Neikun might be able to help you there.Fhizban wrote:Thanks Neikun!
Is there also a invisible object i can place to make a message appear when the player clicks on something? Like a cave-in the player can click on and then it displays a message.
Re: Hello + Script Question
I think a button is a good idea, but you might be restricted to only using it on objects that are integrated into a 'solid' wall (as opposed to e.g. a hidden door, a blocker, a floor decoration, etc). It doesn't look like you can script the hitbox of a button though, so thats tricky.
Aha, I know. Give the party a 'magnifying glass' item. If they want to examine something, they hold the item in hand and click on it. Meanwhile, make a custom alcove for each unique examinable object that accepts no items, but in the check to see if it should accept an item have it do a hudPrint displaying the message you want.
Even better, make one class of alcove and then create a 'descriptor-holding' item that is a scroll but has an empty model or something, tied to the specific id of the alcove object. Use an init script to create a bunch of these and load them into the observable objects you want. Then, when the party clicks on the alcove with the magnifying glass, have the alcove check its containedItems for the descriptor object and display that object's getScrollText (which you can set in the init script). That will stop you from having to have three dozen new objects in your asset list all the time, and all the game's description text will be in a single more-or-less convenient script entity.
Aha, I know. Give the party a 'magnifying glass' item. If they want to examine something, they hold the item in hand and click on it. Meanwhile, make a custom alcove for each unique examinable object that accepts no items, but in the check to see if it should accept an item have it do a hudPrint displaying the message you want.
Even better, make one class of alcove and then create a 'descriptor-holding' item that is a scroll but has an empty model or something, tied to the specific id of the alcove object. Use an init script to create a bunch of these and load them into the observable objects you want. Then, when the party clicks on the alcove with the magnifying glass, have the alcove check its containedItems for the descriptor object and display that object's getScrollText (which you can set in the init script). That will stop you from having to have three dozen new objects in your asset list all the time, and all the game's description text will be in a single more-or-less convenient script entity.
Re: Hello + Script Question
Darn, I though buttons had definable sizes in their definitions like the alcoves.
- Edsploration
- Posts: 104
- Joined: Wed Sep 19, 2012 4:32 pm
Re: Hello + Script Question
I have a solution for this I'm currently using in a dungeon about to be entered into Editing Challenge II.Fhizban wrote:Is there also a invisible object i can place to make a message appear when the player clicks on something? Like a cave-in the player can click on and then it displays a message.
Define an item to use the one-sided gobelin model:
Code: Select all
cloneObject{
name = "invisible_item",
baseObject = "rock",
model = "assets/models/env/gobelin.fbx",
}
Code: Select all
defineObject{
name = "speech_alcove",
class = "Alcove",
anchorPos = vec(0, 0.5, -0.01),
anchorRotation = vec(0, 180, 0),
targetPos = vec(0, 0.5, -0.01),
targetSize = vec(0, 0, 0),
placement = "wall",
replacesWall = false,
editorIcon = 96,
}
Code: Select all
function speechOn()
speech_alcove_1:addItem(spawn("invisible_item"))
end
function speechOff()
local temp = speech_alcove_1:containedItems()
temp():destroy()
end
Code: Select all
onPickUpItem = function(party, item)
if item.name == "invisible_item" then
speech:talk()
return false
end
end,
Open Project -> Community FrankenDungeon: viewtopic.php?f=14&t=4276
Re: Hello + Script Question
thank you all very much! the invisible pressure plate is already working and Edsploration's solution seems to be the best to display klick-text. i will try to get this into my project as soon as possible. thanks again for being so helpful!
--
Fhizban's Asset Repository - the place where you find all my LoG contributions:
viewtopic.php?f=14&t=3904
Fhizban's Asset Repository - the place where you find all my LoG contributions:
viewtopic.php?f=14&t=3904