Page 2 of 3
Re: Spell – rune order
Posted: Mon Oct 16, 2017 5:42 pm
by Isaac
Zo Kath Ra wrote:Another side note:
Clicking "Select all" above the code sample should select the entire code, but it takes me to the beginning of the thread instead.
Tested on Firefox and Chromium.
Are you limiting Javascript in your browser?
Re: Spell – rune order
Posted: Mon Oct 16, 2017 6:00 pm
by Zo Kath Ra
Isaac wrote:Zo Kath Ra wrote:Another side note:
Clicking "Select all" above the code sample should select the entire code, but it takes me to the beginning of the thread instead.
Tested on Firefox and Chromium.
Are you limiting Javascript in your browser?
Not that I'm aware.
The problem still occurs when I start FF with all add-ons disabled.
Re: Spell – rune order
Posted: Mon Oct 16, 2017 6:09 pm
by .rhavin
I really dont know why postig the above code didnt do the trick, but here is a working project:
http://doc.rhavin.de/dmf/spelltome_demo.zip
Re: Spell – rune order
Posted: Mon Oct 16, 2017 6:27 pm
by Isaac
Zo Kath Ra wrote:Isaac wrote:Zo Kath Ra wrote:Another side note:
Clicking "Select all" above the code sample should select the entire code, but it takes me to the beginning of the thread instead.
Tested on Firefox and Chromium.
Are you limiting Javascript in your browser?
Not that I'm aware.
The problem still occurs when I start FF with all add-ons disabled.
It does the same for me in Firefox. My guess is that it's because of the SID parameter in the Firefox version of the page; the URL parameter (a session id?) ends in a hash sign, which works with anchor tags to allow links to specific sections of a page. The link URL is actually different for Firefox, than for Opera.
Re: Spell – rune order
Posted: Mon Oct 16, 2017 6:38 pm
by Zo Kath Ra
It works great!
The panel is perfectly responsive.
I'm still trying to understand the code, though.
Re: Spell – rune order
Posted: Tue Oct 17, 2017 12:35 am
by .rhavin
Zo Kath Ra wrote:I'm still trying to understand the code, though.
Next version will add more doku
BTW – can someone show me how I can put this in an external file and call it from the internal one? I want this…
Code: Select all
function showPanel()
party.party:addConnector('onDrawGui', self.go.id, -#???#- )
end
function hidePanel()
party.party:removeConnector('onDrawGui', self.go.id, -#???#- )
end
…inside the internal file and everything else in an external so one can just add my stuff where it is appropriate. But all my tries give me strange errors that I dont understand.
Re: Spell – rune order
Posted: Tue Oct 17, 2017 3:18 am
by Isaac
Make your external file, and on the map place a script_entity for your external code. (With the script_entity selected) In the editor's property inspector change the setting for the script source from embedded to external. Call it as you would any other script_entity.
*Note: Scripts in objects reside in the object's script component; so to call myFunction in 'my_object', you include the script component:
my_object.script:myFunction()
**If you disable a level in the editor, its scripts do not load.
Re: Spell – rune order
Posted: Wed Oct 18, 2017 8:26 am
by akroma222
This is fantastic .rhavin!
I had shelved the idea of implementing a ultima underworld-ish type rune system for spell casting as my skills arent up to the task atm with Gui stuff...
So thank you for sharing your work on this system!
Tested the demo and things look great...
Im guessing your plan is to place the rune panels over the champion's attack panel (and implement a 'Cast' button) ?
Its almost tempting to make players collect the Rune stones to place in their Runestone collection (bag
) ... but probably not worth the hassle!
Look forward to updates
Akroma
Re: Spell – rune order
Posted: Wed Oct 18, 2017 9:56 am
by Isaac
akroma222 wrote:Its almost tempting to make players collect the Rune stones to place in their Runestone collection (bag
) ... but probably not worth the hassle!
Have you played Arx Fatalis? (That is exactly what they did.)
Re: Spell – rune order
Posted: Wed Oct 18, 2017 10:51 am
by .rhavin
Well, let me surprise you what the next version already can do once I figured out how to effectively control the mouse. The current method to get the mouse position in the editor is a ridiculous complicated hack. Im currently trying to put all those nasty workarounds in one part of my script so i can easily unfuck them once Petri read my bugreport and hopefully has some spiced wine
akroma222 wrote:but probably not worth the hassle!
First having to unlock the runes is already a configurable feature