Author Topic: GPDL scripting questions  (Read 83 times)

Offline marainein

  • Sr. Member
  • ****
  • Posts: 338
GPDL scripting questions
« on: March 11, 2017, 04:21:27 AM »
So I'm gradually learning GPDL. Mainly through the GPDL function option on logic block events. Most of the talk on the forums is about scripts called by hooks - I don't know if there are any important differences.

Some queries:
 - Is there a function to return the index of the first matching element in a delimited string? (yes, I know I can write one)
- I've accumulated a number of utility functions - can I make these globally accessible from other logic blocks?
- Sometimes when I have a script that does something to every square in the level, I get warnings about it taking too long to run. Is there a way to turn this off or adjust it?
- Are the scripts attached to events stored in any files in text format?
- What tools can we use for debugging scripts? So far I've only got $DEBUG()
- Anything else I obviously need to know?

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9368
Re: GPDL scripting questions
« Reply #1 on: March 11, 2017, 02:59:21 PM »
So I'm gradually learning GPDL. Mainly through the GPDL function option on logic block events. Most of the talk on the forums is about scripts called by hooks - I don't know if there are any important differences.
Hooks get used with SAs and determine when the script is called, not unlike using a script with a Logic black event.

Some queries:
 - Is there a function to return the index of the first matching element in a delimited string? (yes, I know I can write one)
 
No. The premade functions are generally not this complex. You would use a script (or write a fanction) that would use several of the premade functions to achieve this.
 
 
- I've accumulated a number of utility functions - can I make these globally accessible from other logic blocks?
- Sometimes when I have a script that does something to every square in the level, I get warnings about it taking too long to run. Is there a way to turn this off or adjust it?
Oh, Paul... ;)

- Are the scripts attached to events stored in any files in text format?
If you export the global data and the level data, scripts will be in text format.

- What tools can we use for debugging scripts? So far I've only got $DEBUG()
- Anything else I obviously need to know?
Have you used the debugging feature in the script editor? It is veru gppd fpr sumtax and supported contexts.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2081
Re: GPDL scripting questions
« Reply #2 on: March 11, 2017, 03:08:23 PM »
Quote
Is there a function to return the index of the first matching element in a delimited string?

But it might be a good idea to make one.  It would be
so very much more efficient than one you could write
using the scripting language.  On the other hand, it
may be that you are using the wrong tool for the job.
There are other methods of searching for string matches
that are very efficient and more scalable.  In particular,
you have access to content-addressable structures such
as ASL's.

Perhaps if you told us what you are trying to accomplish.

Quote
utility functions - can I make these globally accessible from other logic blocks
Sorry.  If they are universally useful, perhaps they could be
'built-in'.

Offline Mechanaut

  • Newbie
  • *
  • Posts: 37
Re: GPDL scripting questions
« Reply #3 on: March 11, 2017, 08:37:19 PM »
I was going to ask what GDPL is, but after some searching, I did find it... but for those that don't know (like I didn't), it's this (I think) : http://www.dianneandpaul.net/UAF/Help/GPDL.html
(Paul being Paul I assume.)

This looks neat... Is this ~kinda like Quake C?
« Last Edit: March 11, 2017, 08:39:09 PM by Mechanaut »

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2081
Re: GPDL scripting questions
« Reply #4 on: March 12, 2017, 12:25:34 AM »
Quote
Is this ~kinda like Quake C

If it is, it is a complete coincidence.  (I never heard of Quake C.)

What do they call that?  Convergent evolution?

Offline Mechanaut

  • Newbie
  • *
  • Posts: 37
Re: GPDL scripting questions
« Reply #5 on: March 12, 2017, 01:57:14 PM »

 

anything