Page 1 of 1

Im making my own dungeon, i need some help with scripting :)

Posted: Mon Apr 07, 2014 4:28 pm
by The cube
So, i have not played/edited grimrock for about an year, and it is clearly visible from me. I no longer know how to script at all. I need some help :)

- How to remove players from the party/add players to the party/add custom players to the party.

- How to play a sound at a specific place?

- How to make doors that can be broken/can be broken by a specific spell?

- How to add an parameter that is then changed and checked by other scripts?

This is all help i need now, but i will most likely need more help in the future. Thank you for reading :)

Re: Im making my own dungeon, i need some help with scriptin

Posted: Mon Apr 07, 2014 6:20 pm
by JKos
- How to remove players from the party/add players to the party/add custom players to the party.
This is not a very easy task, it requires a lot of scripting, but you can check from griwidgets how it can be done: https://github.com/xanathar/grimwidgets

- How to play a sound at a specific place?
Easy one: playSoundAt(sound, level, x, y)
Quick reference of all functions:
https://sites.google.com/site/jkosgrimr ... heat-sheet


- How to make doors that can be broken/can be broken by a specific spell?
One solution could be an invisible receptor that calls a script which destroys the door and replaces it with broken door model.

- How to add an parameter that is then changed and checked by other scripts?
Script variables are read only for other scripts, so you can't set them from another script-entity, here is a workaround

script1

Code: Select all

props = {
   checkThis = true
}
script2

Code: Select all

script1.props.checkThis = false
or you can use setter functions

script1

Code: Select all

checkThis = false

function setCheckThis(value)
    checkThis = value
end
script2

Code: Select all

script1.setCheckThis(true)

Re: Im making my own dungeon, i need some help with scriptin

Posted: Mon Apr 07, 2014 8:51 pm
by The cube
I tried an hidden receptor earlier, it didin't work, unfortunatedly.

Thanks for helping me out!