Help. Opening Script.

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
MM037
Posts: 14
Joined: Thu Sep 20, 2012 3:12 am

Help. Opening Script.

Post by MM037 »

I hope I posted in the right place. I basically know nothing about scripting, but i decided to attempt an opening script similar to the "hello world" script in the 'how to" you posted only using a "hudPrint" instead and bound it to a hidden pressure plate under the starting location in my dungeon. It works fine in the dungeon editor, however, when exported and playing in a regular game, there is already an opening script that covers it up referencing "First time playing Grimrock...?" Any advice on how to either remove the default opening "hudPrint" or work around it?
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Help. Opening Script.

Post by Neikun »

hmm. Good question. That is likely happening in my game as well.
"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
  • Message me to join in!
Lmaoboat
Posts: 359
Joined: Wed Apr 11, 2012 8:55 pm

Re: Help. Opening Script.

Post by Lmaoboat »

I was asking the devs to add a function for clearing the hud text just recently, and someone suggested printing several blank lines first.
So something to the effect of:

Code: Select all

function text()
        hudPrint(" ")
        hudPrint(" ")
        hudPrint(" ")
        hudPrint(" ")
        hudPrint(" Hello world")
end
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Help. Opening Script.

Post by Komag »

yes, you can spam the hud print with blank spaces then put your real message:

- create a timer, called "newgametimer", set to 8.5 or 9 seconds
- create a script, called "newgamescript" with code:

Code: Select all

hudPrint(" ")
hudPrint(" ")
hudPrint(" ")
hudPrint(" ")
newgametimer:activate()
function newgametext()
	hudPrint("Welcome to the Dungeon of Luuuuvvvvv!!!!")
end
- connect the timer to the script (Action - newgametext)
- connect the timer to itself (Action - deactivate)
- all set!

It takes four blank hud prints to clear the default "played Grimrock before?" text, and the timer will give a chance for the initial "game saved" text to fade before showing your message. You don't need any hidden pressure plate or anything, the script will run on map start.
Finished Dungeons - complete mods to play
MM037
Posts: 14
Joined: Thu Sep 20, 2012 3:12 am

Re: Help. Opening Script.

Post by MM037 »

Thanks. That seemed to work great. Didn't even have to set the timer to 9. Set it to 0 and made all the default text disappear. Even the game saved didn't show up.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Help. Opening Script.

Post by Komag »

I tried various setups, tried many more blank hudprints, etc, and so long as I have the Autosave option on in my game settings, it always shows up no matter what I do, so perhaps you have turned Autosave off?
Finished Dungeons - complete mods to play
GoldCoast
Posts: 4
Joined: Tue Oct 09, 2012 6:19 pm
Location: Germany

Re: Help. Opening Script.

Post by GoldCoast »

Works perfect, thanks for this 8-).
Greetings... GoldCoast
User avatar
Trollmann
Posts: 24
Joined: Sun Apr 15, 2012 6:31 pm

Re: Help. Opening Script.

Post by Trollmann »

MM037 wrote:Thanks. That seemed to work great. Didn't even have to set the timer to 9. Set it to 0 and made all the default text disappear. Even the game saved didn't show up.
If it works this way, I think it should work just fine without timer. Just make script entity and add:

hudPrint(" ")
hudPrint(" ")
hudPrint(" ")
hudPrint(" ")
hudPrint("Betcha this isn't your first time playing Legend of Grimrock!")

You don't even need to define a function for it, so you can leave the "openingtext()" whateveryoucallit, and "end" out.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Help. Opening Script.

Post by Komag »

but if the player has autosave on there is an autosave message that cannot be removed, so the purpose of the timer is to wait until after that autosave message is gone
Finished Dungeons - complete mods to play
Post Reply