~Basic Scripting and Editor Help(Easy Scripting Updated!)

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!
A100N
Posts: 15
Joined: Sun Oct 19, 2014 1:53 pm

Re: Basic Scripting and Editor Help(Basic Script Reference)

Post by A100N » Sun Oct 19, 2014 2:00 pm

Hello all (sorry I use a translator)

Looking for help on the merits the scripts :(
namely,

*** I have 3 altars, and I want that when placed on each of them corresponding object automatically been opened one of the doors, ***

  Unfortunately, a lot of scripts game changed in August compared with the earlier ver of this game and already can not keep anything that would Find an :( helped me

So if someone would be so kind and wrote me these few lines of code how it should look ??
Thanks in advance for your help ...

User avatar
Rubilax
Posts: 51
Joined: Mon Oct 13, 2014 4:56 am

Re: Basic Scripting and Editor Help(Short Script Reference)

Post by Rubilax » Mon Oct 20, 2014 5:57 am

SnowyOwl47 wrote:-snip-

Code: Select all

startMessage = spawn("scroll")
startMessage.control:setScrollText("text")
party.party:getChampion(1):insertItem(11,startMessage)
Giving your code a go and this is all I get. http://gyazo.com/57da681d0ee613ccd68c11e5679aece0

Just to reiterate, this is a floor_trigger that is activating the script after a short delay that gives the player a note in their inventory with predefined text, along with a hudPrint to alert them to this.

User avatar
SnowyOwl47
Posts: 148
Joined: Fri Sep 12, 2014 10:41 pm

Re: Basic Scripting and Editor Help(Short Script Reference)

Post by SnowyOwl47 » Mon Oct 20, 2014 5:59 am

@Rubilax

My Bad,

Code: Select all

startMessage = spawn("scroll")
startMessage.scrollitem:setScrollText("text")
party.party:getChampion(1):insertItem(11,startMessage)
its startMessage.scrollitem I decided to check it out in the editor but the one thing I don't know how to do is add the item to there inv ill get back to you on that

NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Post by NutJob » Mon Oct 20, 2014 11:02 am

Terribly sorry to point this out (really don't want to hurt anyone's feelings) but these tutorials/examples really shouldn't be stickied to this forum. There's a lot of misinformation and the scripts are amateurish, at best. Perhaps best to wait until there's some solid development references.

Someone had to be the fall guy. ~shrugs~ Sorry, all the same.

NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Post by NutJob » Mon Oct 20, 2014 2:03 pm

Use a connector (can't be called without a trigger)

Excessively simple example:

Connector on a floor_trigger

Code: Select all

function dagger_to_the_eye()
	party_member_one = party.party:getChampion(1)
	fancydagger = spawn("dagger");
	party_member_one:insertItem(20, fancydagger.item)
end
Of course you'll want to iterate through the backpack slots (and/or character slots) to make sure the space is empty, of the right type of slot, etc; do some conditional testing; and lastly write in a fail safe (such as drop the item on ground instead if all slots are full).

User avatar
SnowyOwl47
Posts: 148
Joined: Fri Sep 12, 2014 10:41 pm

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Post by SnowyOwl47 » Mon Oct 20, 2014 3:40 pm

@NutJob I don't see what your problem is...
Lots of people find it helpful and they ask questions here just because it did not help you, doesn't mean it did not help anyone else. And, I've tested all of these methods and everything they're all working and if you don't like the way there laid out well then I'm sorry because I simply don't have enough time to make everything as easy as cake to read even though it is pretty easy to read.

User avatar
sapientCrow
Posts: 394
Joined: Sun Apr 22, 2012 10:57 am

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Post by sapientCrow » Mon Oct 20, 2014 10:45 pm

Is there a method to run a console command to add a multiplier to experience gains and will it run through the entire game session as long as I do not quit out of the game?

I would like to play a solo game at some point and increase the exp gain so I can gain more skills.
I would rather not just add in skill points or dump a large amount of exp on the champion.
thanks

User avatar
SnowyOwl47
Posts: 148
Joined: Fri Sep 12, 2014 10:41 pm

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Post by SnowyOwl47 » Mon Oct 20, 2014 10:52 pm

sapientCrow wrote:Is there a method to run a console command to add a multiplier to experience gains and will it run through the entire game session as long as I do not quit out of the game?

I would like to play a solo game at some point and increase the exp gain so I can gain more skills.
I would rather not just add in skill points or dump a large amount of exp on the champion.
thanks
Not that I can see but if you look at my easy scripting code you can see I started work on it, very complicated proccess make take a while.

User avatar
sapientCrow
Posts: 394
Joined: Sun Apr 22, 2012 10:57 am

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Post by sapientCrow » Mon Oct 20, 2014 11:21 pm

ok thanks.

I do not understand why they do not allow for the ability to override some of the core rules and formulas more easily.
I do not even see a way to alter attributes or add abilities to items in the editor itself.

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

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Post by Isaac » Tue Oct 21, 2014 5:40 am

sapientCrow wrote:ok thanks.

I do not understand why they do not allow for the ability to override some of the core rules and formulas more easily.
I do not even see a way to alter attributes or add abilities to items in the editor itself.
I don't understand why they ever would... :?

(They include the mod tools for people to mod what they like in their own maps; but I can't imagine allowing that in their official campaign. They likely balanced the game based on the predicted limits of the PCs.)

**If there is a Party hook for XP gains, then such a hack could probably work in a modded map; but I don't think (certainly don't know) if you can hook to that via console script in the running game; as would have to be done to patch the LoG2 campaign.

*** If there isn't such a hook, it's not a bad thing to ask for in a future patch or one of Petri's glögg sessions.

Once the scripting reference is made public, you could choose to add extra points at times when they level up... If you wanted a 20% xp bonus... just add 20% of their current XP after they level up; or (if possible) add the points directly after they level up, but before you've spent them.

Post Reply