Scripting - (Any questions on scripting ask here)

This forum is for discussing anything related to The Quest editor.

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

Postby KGold » Sun Jun 17, 2012 9:03 pm

OMG, it was only a small typing error, and I didn't notice it...
Thank you!
If you have been really too busy,
And you feel your head being dizzy,
It's recommended to have a rest,
I have a good offer-play the Quest! : )
User avatar
KGold
 
Posts: 142
Joined: Sun Jun 10, 2012 3:21 pm
Location: Hungary

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

Postby Catacomber » Mon Jun 18, 2012 2:33 am

Also here:

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

All your other setglobals are different. : ) Not eyex_
All your other globals are exp1_
User avatar
Catacomber
 
Posts: 1457
Joined: Tue Oct 25, 2011 5:20 am
Location: New York City

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

Postby KGold » Mon Jun 18, 2012 11:40 am

How inattentive I am! After making Eyeland with eyex identifier, I must accommodate to this one. Thank you!
If you have been really too busy,
And you feel your head being dizzy,
It's recommended to have a rest,
I have a good offer-play the Quest! : )
User avatar
KGold
 
Posts: 142
Joined: Sun Jun 10, 2012 3:21 pm
Location: Hungary

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

Postby Jacob » Fri Jan 31, 2014 12:12 am

What language is The Quest programmed in? Lua?
Jacob
Jacob
 
Posts: 91
Joined: Thu Oct 27, 2011 4:01 pm
Location: england

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

Postby UKayeF » Sun Aug 10, 2014 3:41 pm

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!! :)
UKayeF
 
Posts: 7
Joined: Mon Aug 04, 2014 9:12 pm

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

Postby KGold » Sat Jun 24, 2017 1:47 pm

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...
If you have been really too busy,
And you feel your head being dizzy,
It's recommended to have a rest,
I have a good offer-play the Quest! : )
User avatar
KGold
 
Posts: 142
Joined: Sun Jun 10, 2012 3:21 pm
Location: Hungary

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

Postby Elendil / Redshift » Sat Jun 24, 2017 5:26 pm

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.
User avatar
Elendil / Redshift
Site Admin
 
Posts: 787
Joined: Sun Oct 09, 2011 11:35 am

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

Postby KGold » Sun Jun 25, 2017 12:47 pm

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?
If you have been really too busy,
And you feel your head being dizzy,
It's recommended to have a rest,
I have a good offer-play the Quest! : )
User avatar
KGold
 
Posts: 142
Joined: Sun Jun 10, 2012 3:21 pm
Location: Hungary

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

Postby Elendil / Redshift » Sun Jun 25, 2017 5:40 pm

Code: Select all
setglobal("global", getglobal("global") + 1);
User avatar
Elendil / Redshift
Site Admin
 
Posts: 787
Joined: Sun Oct 09, 2011 11:35 am

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

Postby KGold » Mon Jun 26, 2017 7:17 pm

Elendil / Redshift wrote:
Code: Select all
setglobal("global", getglobal("global") + 1);

This is what I was looking for, thank you!
If you have been really too busy,
And you feel your head being dizzy,
It's recommended to have a rest,
I have a good offer-play the Quest! : )
User avatar
KGold
 
Posts: 142
Joined: Sun Jun 10, 2012 3:21 pm
Location: Hungary

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

Postby FelixDent@mail.com » Sun Mar 24, 2019 8:45 am

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

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

Postby Elendil / Redshift » Mon Mar 25, 2019 7:34 am

Here is the tutorial, which includes two pdfs, which have a list of all script functions.

http://www.redshift.hu/thequesteditor.htm
User avatar
Elendil / Redshift
Site Admin
 
Posts: 787
Joined: Sun Oct 09, 2011 11:35 am

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

Postby Lupinos » Tue Jun 30, 2020 2:11 pm

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:
„Eigentlich weiß man nur, wenn man wenig weiß. Mit dem Wissen wächst der Zweifel." Johann Wolfgang von Goethe
User avatar
Lupinos
 
Posts: 3
Joined: Fri Jun 26, 2020 8:21 am
Location: Datteln, Germany

Previous

Return to Editor

Who is online

Users browsing this forum: No registered users and 1 guest