Page 2 of 2

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Sun Jun 17, 2012 9:03 pm
by KGold
OMG, it was only a small typing error, and I didn't notice it...
Thank you!

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Mon Jun 18, 2012 2:33 am
by Catacomber
Also here:

(posx==11) && (posy==11)) { setglobal("eyex_secretwalls",2);

All your other setglobals are different. : ) Not eyex_
All your other globals are exp1_

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Mon Jun 18, 2012 11:40 am
by KGold
How inattentive I am! After making Eyeland with eyex identifier, I must accommodate to this one. Thank you!

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Fri Jan 31, 2014 12:12 am
by Jacob
What language is The Quest programmed in? Lua?

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Sun Aug 10, 2014 3:41 pm
by UKayeF
I have problems when trying to create a new spell. This comes up when I'm trying to cast a spell that improves the player's stealth skill. According to the description given in the player's menu it is supposed to work but when casted there is absolutely no effect at all.
here are the details of the spell:

id: tqrw_spellhide
name: Hide
category: environment
target: self
price: 80 (don't think that matters though tbh)
sp base: 20
sp/skill level: 1.00
effect : fortify stealth skill by 4.00/0.00 for 10/1.00 turns

the animation on the target I used is bres_spellself01 but that's rather irrelevant I guess

thanks if you can help me!! :)

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Sat Jun 24, 2017 1:47 pm
by KGold
Is it possible to modify the value of a global by adding to it or subtracting from it instead of typing in a particular one with a script?
I'm pretty sure it is, I just forgot how...

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Sat Jun 24, 2017 5:26 pm
by Elendil / Redshift
KGold wrote:Is it possible to modify the value of a global by adding to it or subtracting from it instead of typing in a particular one with a script?
I'm pretty sure it is, I just forgot how...

You can only access globals with getglobal and setglobal. Of course, after you get the value, you can add and subtract to/from it.

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Sun Jun 25, 2017 12:47 pm
by KGold
Elendil / Redshift wrote:
KGold wrote:Is it possible to modify the value of a global by adding to it or subtracting from it instead of typing in a particular one with a script?
I'm pretty sure it is, I just forgot how...

You can only access globals with getglobal and setglobal. Of course, after you get the value, you can add and subtract to/from it.


What's the script for it?
The only way I can modify a global's value is using this: setglobal("test_example",1); (at least the one I'm aware of)
But this uses a particular value...
In case I want the value to increase by 1 every time I touch a certain statue for instance, this won't work. Is there a way to achieve this?

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Sun Jun 25, 2017 5:40 pm
by Elendil / Redshift
Code: Select all
setglobal("global", getglobal("global") + 1);

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Mon Jun 26, 2017 7:17 pm
by KGold
Elendil / Redshift wrote:
Code: Select all
setglobal("global", getglobal("global") + 1);

This is what I was looking for, thank you!

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Sun Mar 24, 2019 8:45 am
by FelixDent@mail.com
Hello, there. I just joined and wanted to ask if there was an API or a list of methods/commands/etc. for scripting purposes?

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Mon Mar 25, 2019 7:34 am
by Elendil / Redshift
Here is the tutorial, which includes two pdfs, which have a list of all script functions.

http://www.redshift.hu/thequesteditor.htm

Re: Scripting - (Any questions on scripting ask here)

PostPosted: Tue Jun 30, 2020 2:11 pm
by Lupinos
Hi,
I hope you can help me with following problem. I was reading back and forth in the tutorial and on the forum but could not figure out what I am doing wrong.
My intend is to show and hide some monsters. There are 4 monsters which shall show only at night. Since there seems to be no other way than activating a script by use, hit, arrive at a world, etc, my thought was to run the script right before the player enters the cemetery where the mosters show up. Another thought was that the script does not have to run anymore as soon all monsters are dead.
So each monster contains a script which adds +1 to the global "Test_DeadDied" to keep track of the killed number of monsters. And as I said I wrote a script to setvisible or to sethidden the monsters.
The hide and show script works fine as long as I do not use the && operater.
So what exactly is wrong?
Code: Select all
if(evtstepon() && (getstate()<4))
{
    if(isnight())
    {Test_Skel01.setvisible();
     Test_Skel02.setvisible();
     Test_Skel03.setvisible();
     Test_Ghoul01.setvisible();}
    else
      if(isdaylight())
      {Test_Skel01.sethidden();
       Test_Skel02.sethidden();
       Test_Skel03.sethidden();
       Test_Ghoul01.sethidden();}}


Thanks in advance. :D

Edit: OMG! I feel so silly right now. Of course it works. It just does not work in the darn editor. I tested it ingame and it works perfectly. :roll: :oops: