Mystery Topic Revealed: Glögg Session Part 3!

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
bongobeat
Posts: 882
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by bongobeat » Mon Mar 09, 2015 1:44 pm

Hi,

I don't know if the glög session is still runing?

I think of something about the spawner object in the editor:
can a "component" spawndedItem be added?

like the spawnedEntity, but when you choose a monster, some kind of items component shows himself, makes when you kill this monster, it drops an item.

Then, a "spawnedMonster component", when a monster is spawned, you can choose that it spawn another monster.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505

User avatar
Eleven Warrior
Posts: 664
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by Eleven Warrior » Fri Mar 13, 2015 3:33 am

I found something interesting in a game called Dungeon Quest. The editor allow you to click on a object eg: wall, statue etc... and add a message to it.
I used a Coffin01 object in the editor, right clicked it and it has some properties id name, script and a few others. So the idea of the Script to the object was really cool you can add a script to the object in so many ways eg: The party can die, heal, spawn monster etc...

So I think it would be cool to right click a object in the editor and be able to add a script to it :) Also the beauty of this idea is there are no added lua script objects or external lua file the whole object is the script :) Imagine right clicking a object in the editor and you can add the scripting to it eg: onhit, onuse, any of the hooks that LOG 2 uses can be applied to the object it's self. If you download the Editor of this game you can see how objects are used this way so simple :) Yes the game is for phones yeah but the idea is cool :)

The Game Forum:
http://linux.redshift.hu/forums/

Right Click Coffin Object Scripting Function:

if(evtuse())
{
message("Here lies Kealdar, king of goblins.");
}

Now let’s examine that piece of code to see what it actually does.
The first line is:
if(evtuse())

Basically it makes something happen upon clicking the coffin. The line could be ”translated” into:
If event use Which is not so hard to understand. In event of using. There are a number of these ”if lines” - for example writing:
if(evthit())

makes something happen if the object is attacked (If event hit). I’ll go through the actual reason for writing if(evtuse()) and not If event use in the last, coding part of this manual.
The second line is a brace:
{
The last line is also a brace but turned the other way around.
}
You will have to write these two braces after an if line. Because what’s inside these, is what will happen if the if condition is met. And what is the middle line in this case?
It’s message(”Here lies Kealdar, king of goblins”);
Which is pretty self-explanatory.

All these commands are called functions. Your script contains two functions: an if() function and a message() function.
Why do I have to enter all these strange symbols, you may ask. These are simply commands to say what to do. Take the message example above. Without text it looks like:
message(””)

The () is a signal to the Editor: within these is what the message will say. The ”” means that it’s text the message will say.
It’s almost the same with this line:
if(evtuse()) If is the function itself, and the condition is within the (). Evtuse is actually another functions, hence the (). But in this case nothing is needed - we’ll dig deeper into that in the script section.
So, in short the code says:
In event of using, show the message ”Here lies Kealdar, king of goblins”.
Not that hard, eh?

minmay
Posts: 2436
Joined: Mon Sep 23, 2013 2:24 am

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by minmay » Fri Mar 13, 2015 4:02 am

You can already do that by adding ScriptComponents to any object.

User avatar
Eleven Warrior
Posts: 664
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by Eleven Warrior » Fri Mar 13, 2015 7:17 am

Yes true Minmay you have to add that stuff to the object in it's lua file. In the Editor that I found you add it to the object within the editor yeah.

If you did check out the web site I put here and checked out the editor like I di then you will see what I mean yeah. eg:

In there editor you can right click the object and add lots of things to it, scripts have to be complied though in there editor, but the meaning behind it is cool. Why edit lots of objects in a item.lua, object.lua file when it can be done in the editor like thier's? Minmay scriptcomponets have to be added to the object within the lua file, takes time and theirs is in the editor better. Did you check the web site to see how it's done mate? I don't doubt anything you say cause I respect you and your wisdom errrr your much better than me - Right click object in editor and do what you want yeah, you cant right click a object in LOG 2 and get it to do something. This is what I am saying bro........Kill me if imam wrong

I have placed a coffin on the floor in the their editor and like LOG 2 it has properties, but more a script add on
+++++ it gives you a nice scroll for the text :) K just check it out Minmay Pleaseeeeeeeeeeeee lol

EDIT: Ok what you have to understand is that all objects don't have a Script component added to them in LOG 2 unless you do it in a lua file yeah. In Dungeon Quest every object has the added script function you don't have to add it like LOG 2 or 1

User avatar
BuzzJ
Posts: 160
Joined: Sat Jan 12, 2013 4:06 pm

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by BuzzJ » Mon Mar 23, 2015 11:02 am

I havn't finished the singleplayer campaign, but do we have working elevators and a way to rotate single tiles or whole rooms? Those would be nice.

User avatar
Isaac
Posts: 2629
Joined: Fri Mar 02, 2012 10:02 pm

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by Isaac » Mon Mar 23, 2015 12:56 pm

BuzzJ wrote:I havn't finished the singleplayer campaign, but do we have working elevators and a way to rotate single tiles or whole rooms? Those would be nice.
It's possible to do as effects.

Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by Granamir » Wed May 06, 2015 10:01 am

Hi,
this is just an idea come in my mind (maibe someone already had it).
I post here because i guess i'll lose next glog session like this...so maybe someone is still reading this session.

Idea is tu put an object that work like a trigger but instead beeing activated by pressure is activated by choice of player.
It would have a text field to put lets say a question.
A check box to chose if text and choices would appear in a window or just as free graphics/buttons in game.
An add option to add multiple button/trigers, each with a small text field plus same fileds like a floor trigger.
A check box to select 1 answer allowed (that make disapper other choices and activate trigger when clicked) or multiple answer (that make appear a check over or near selected buttons and a standard ok button at the end).

minmay
Posts: 2436
Joined: Mon Sep 23, 2013 2:24 am

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by minmay » Wed May 06, 2015 10:06 am

That doesn't require any changes to Grimrock. You can do it with the existing scripting interface, look at the onDraw hooks. GrimTK may also be of interest.

Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by Granamir » Wed May 06, 2015 11:32 am

Thank you minmay, it seems interesting...and more or less what i had in mind.

User avatar
Eleven Warrior
Posts: 664
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by Eleven Warrior » Tue Jul 14, 2015 6:43 pm

Hi.

I know you can do this in scripts: GameMode.setGameFlag("DisableMouseLook",true) or false.

Is there a way to actually hide the Mouse Pointer? and the mouse clicks cannot be used until it becomes a True statement.

Post Reply