All times are UTC





Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: saving jass code on more then one line
PostPosted: Fri Jun 19, 2009 5:13 pm 
Offline
Light User

Joined: Wed Jun 17, 2009 3:21 am
Posts: 13
when you save code in a trigger you cant (or i dont see any were telling you how) put the code on more then one line.

example
getTriggerByName(map, "triggername").code = "udg_varrable = 1 udg_varrable2 = 2";

the code in the trigger = udg_varrable = 1 udg_varrable2 = 2

if you were to try to save the map it would give you an error message because the code cant be on the same line. It needs to be like this.
udg_varrable = 1
udg_varrable2 = 2

PS: yes i know that example would never work for missing all the function stuff


Top
 Profile  
 
 Post subject: Re: saving jass code on more then one line
PostPosted: Fri Jun 19, 2009 6:04 pm 
Offline
Power User

Joined: Fri Jan 04, 2008 1:50 pm
Posts: 818
huh i didn't know you could dynamically set a trigger's code like that.

how about you define a function with multiple lines, and then you could set a trigger to use it with just one line to call it.


Top
 Profile  
 
 Post subject: Re: saving jass code on more then one line
PostPosted: Fri Jun 19, 2009 6:20 pm 
Offline
Light User

Joined: Wed Jun 17, 2009 3:21 am
Posts: 13
thats the problems you can define a function with multiple lines


Top
 Profile  
 
 Post subject: Re: saving jass code on more then one line
PostPosted: Fri Jun 19, 2009 6:35 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Jul 21, 2006 11:31 pm
Posts: 4714
Location: Munich, Germany / Sydney, Australia
YouTD Score: 240
just like in jass you can use \n inside a string to start a new line, so

getTriggerByName(map, "triggername").code = "udg_varrable = 1\nudg_varrable2 = 2";

should do the job.


Top
 Profile  
 
 Post subject: Re: saving jass code on more then one line
PostPosted: Fri Jun 19, 2009 7:32 pm 
Offline
Light User

Joined: Wed Jun 17, 2009 3:21 am
Posts: 13
\n does not work, and it does vanshish as if it did something


Top
 Profile  
 
 Post subject: Re: saving jass code on more then one line
PostPosted: Fri Jun 19, 2009 8:08 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Jul 21, 2006 11:31 pm
Posts: 4714
Location: Munich, Germany / Sydney, Australia
YouTD Score: 240
that is really strange. For me it works :/. Can you do some further testing?


Top
 Profile  
 
 Post subject: Re: saving jass code on more then one line
PostPosted: Fri Jun 19, 2009 8:53 pm 
Offline
Light User

Joined: Wed Jun 17, 2009 3:21 am
Posts: 13
um ok what do you want me to even try? I ran out of ideals thats y i posted here.


Top
 Profile  
 
 Post subject: Re: saving jass code on more then one line
PostPosted: Fri Jun 19, 2009 10:00 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Jul 21, 2006 11:31 pm
Posts: 4714
Location: Munich, Germany / Sydney, Australia
YouTD Score: 240
can you compile youTD towers? These produces many lines of jass.


Top
 Profile  
 
 Post subject: Re: saving jass code on more then one line
PostPosted: Fri Jun 19, 2009 11:18 pm 
Offline
Light User

Joined: Wed Jun 17, 2009 3:21 am
Posts: 13
umm, i never even messed with youTD


Top
 Profile  
 
 Post subject: Re: saving jass code on more then one line
PostPosted: Sat Jun 20, 2009 6:08 am 
Offline
User

Joined: Thu May 07, 2009 4:16 pm
Posts: 62
Are you sure it isnt |n and not \n? (Same button, but holding shift for the former...on my keyboard at least).

Just an idea...


Top
 Profile  
 
 Post subject: Re: saving jass code on more then one line
PostPosted: Sat Jun 20, 2009 7:54 pm 
Offline
Light User

Joined: Wed Jun 17, 2009 3:21 am
Posts: 13
no thats for things like tooltips


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group