Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.

In the meantime please join the new Discord Server!

If you have any questions please e-mail me through the Platinum Arts website.

Advice with Script: somethign weird with a ")"

Having issues not related to a specific Sandbox game mode? Get help here!
Please also read the rules for support when posting support requests.
Failure to comply with the forum rules may result in your topic being locked without resolution.
Locked
kentl
Member
Member
Posts: 9
Joined: October 17th, 2010, 2:18 am
Name: shawn

Advice with Script: somethign weird with a ")"

Post by kentl »

I got this Script form a older post but did not know your rules on "being threads back form the dead"
and I also edit the script (changed moneys to Coins)
so I hope this is okay

The weirdest part about this whole thing is that one if the script parts dose not work
yet i coped the others form this one and pasted
they all work fine

here is the script

Code: Select all

"level_trigger_2" = "showgui Shopkeeper"
newgui shopkeeper [
Guitext "What are you looking to buy?" chat
Guibar
Guilist [
guibutton "pie: 5 coins" [
if (> then $Coins 4)
Coins = (- $Coins 5)
Pie = (+ $Pie 1) 

I copied the Code above and pasted and edited the pie to swords or treasure
that being said when I talk to him the list appeaser fine

if i click on sword or treasure there is no problems (i have not yet put in him saying "you don't have enough gold " or words to those effects
but the script seems to work
how ever when I click Pie it says "missing )"

I'm thinking its a glitch since the others where coped form that same script and they work
but maybe I'm just blind
"Edit"
Maybe it is the rest of the scripts don't even work?

when i push the button maybe nothing happens?
I don't know
but it is a thought
User avatar
PizzaLover101
Member
Member
Posts: 1751
Joined: October 23rd, 2009, 1:33 pm
Name: NAME
IRC Username: DaItsicle
Location: By a computer
Contact:

Re: Advice with Script: somethign weird with a ")"

Post by PizzaLover101 »

Code: Select all

"level_trigger_2" 
Can i ask why you have "s around the level trigger? I don't think you need those
Project 1: Da Chest Collector [TBD]
Project 2: Tis a secret [End of summer] announcement June 22 2011
Project 3: An even bigger secret!

http://pizzagametime.tk/
http://forums.pizzagametime.tk/
User avatar
klimyriad
Support Team
Support Team
Posts: 969
Joined: December 23rd, 2009, 1:43 pm
Name: liam
Contact:

Re: Advice with Script: somethign weird with a ")"

Post by klimyriad »

level_trigger_2 = [showgui Shopkeeper]
newgui shopkeeper [
guitext "What are you looking to buy?" chat
guibar
guilist [
guibutton "pie: 5 coins" [
if (> then $Coins 4)
Coins = (- $Coins 5)
Pie = (+ $Pie 1)

There fixed your welcome i hope this helps.

Also btw you may need to improve it, it will not work great unless you make allot more to make it work %100.
Firstspace the attack Progress. Image
Maps= Image finishing the town of hisal map.
Models and textures Image Just started finding these.
Menus, script's and other stuff. Image
daltonds1
Member
Member
Posts: 368
Joined: September 13th, 2010, 12:26 am
Name: Dalton
IRC Username: Daltonds1
Location: Tomball, Texas

Re: Advice with Script: somethign weird with a ")"

Post by daltonds1 »

That's cool but what is it for?
im guessing 2.5?

There's tons of different ways to code on this program

i code different from you
User avatar
klimyriad
Support Team
Support Team
Posts: 969
Joined: December 23rd, 2009, 1:43 pm
Name: liam
Contact:

Re: Advice with Script: somethign weird with a ")"

Post by klimyriad »

Yes same as me too lol but i know allot of coding.
Firstspace the attack Progress. Image
Maps= Image finishing the town of hisal map.
Models and textures Image Just started finding these.
Menus, script's and other stuff. Image
kentl
Member
Member
Posts: 9
Joined: October 17th, 2010, 2:18 am
Name: shawn

Re: Advice with Script: somethign weird with a ")"

Post by kentl »

daltonds1 wrote:That's cool but what is it for?
im guessing 2.5?

There's tons of different ways to code on this program

i code different from you
2.6 but since there seems to be a hard time finding anything for 2.6, I use 2.5 stuff

most of 2.5 will work as far as I've seen
I have not yet seen a code that did not work for 2.6 that worked in 2.5

how do you code then?

PizzaLover101 wrote:

Code: Select all

"level_trigger_2" 
Can i ask why you have "s around the level trigger? I don't think you need those
funny story to that
I saw someone use those in a Example and I just thought " What ever its worth a shot"
the script would not work for some reason at all the list would not even come up, for a while I could not figure out why it would not work and I thought maybe the "" helped some how, however, after looking for what felt like hours, I finally figured it out and wow did i feel dumb when I realized one of my [ was a { :oops:

klimyriad wrote:level_trigger_2 = [showgui Shopkeeper]
newgui shopkeeper [
guitext "What are you looking to buy?" chat
guibar
guilist [
guibutton "pie: 5 coins" [
if (> then $Coins 4)
Coins = (- $Coins 5)
Pie = (+ $Pie 1)

There fixed your welcome i hope this helps.

Also btw you may need to improve it, it will not work great unless you make allot more to make it work %100.
Yeah, I tried it, it still says I'm missing a ) for some reason, I'm thinking its a glitch or my really bad script skills, either way I got a feeling it will turn out to be obvious.


Edit
it now works
Since I did nothing that big I think it was just a glitch
maybe the "" did mess it up but I don't know why that would make it say missing )
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Advice with Script: somethign weird with a ")"

Post by chocolatepie33 »

with if (> then $Coins 4) you don't need then, using " around level triggers is OK, from what I see, you don't have a ] (square bracket, not a parenthesis), which denotes the end of the code section.
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Advice with Script: somethign weird with a ")"

Post by arcones »

Yeah, that would be needed if it's not at the end of the code. You might want to check your code and see how many of these [ there are to these ] If there are the same amount of each, it should be fine.
Image
Want a user bar like this one? PM Leo!
Locked