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

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
The cube
Posts: 94
Joined: Tue Apr 23, 2013 6:09 pm
Location: Barren Desert

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

Post 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 :)
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

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

Post 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)
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
The cube
Posts: 94
Joined: Tue Apr 23, 2013 6:09 pm
Location: Barren Desert

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

Post by The cube »

I tried an hidden receptor earlier, it didin't work, unfortunatedly.

Thanks for helping me out!
Post Reply