|
Page 1 of 1
|
[ 12 posts ] |
|
| Author |
Message |
|
Promethius
Ambassador
Joined: Mon Feb 09, 2004 3:00 am Posts: 3141 Location: Kansas
|
 Scripting......
CAUTION: Long winded post...... After helping people with script questions for a while, I have found that people with a true interest will have the desire, but many times no concept of how to formulate what they are going to do. They know the main things - "I want colos on x planet" for instance, but don't realize they need to setup what they are going to do. I usually end up with something like: Get ore for the trip to and from? No, you need to know the round trip distance to get the ore amount required. k, so our calculation is the first thing? Hmm, no, your script needs to know what sector you are in and where you are going before you can calculate. k, got my sector and getdistance didn't work. ... So what is the issue when we first start scripting? We want to not only walk before we crawl, we want to be a world class 100 yard dash sprinter before we crawl. By this rather poor analogy, I see people who want to write complicated scripts before even learning what is required to even setup a simple t-warp move. "Oh, t-warp move is simple - just use ' send "m " $targetSector "*yy" ' that is all there is to it". Yep, that is all there is to it alright. So now that our new scripter has managed to fuse himself with a simple t-warp move (if he moved at all), what is involved from a script? There are assumptions that you can make, but what if those assumptions are wrong? Maybe you xported into a ship a corpie brought in and he forgot to add twarp or ore? Does the ship have twarp capability? Does the ship have enough ore for the trip? If we don't have enough ore, what does the script do? --- Port? Is the port selling ore? Is there enough ore? Buying equ doesn't do much good. --- Land? Sure hope they are our planets. --- Halt Do you have a lock on the sector you are going to? You've launched to a sector. Did you remember to account for the possibility of enemy mines? If you are writing scripts for public use, you cannot make assumptions. Even private scripts where you are the only one using them needs safety checks, or at least be ready for the results if you don't use safeties. Sometimes you have to just go for it w/o safeties, and as long as you feel the possible good outweighs the possibility of sitting out for a day, go for it. What is all this leading to? Basically, you need to outline your script - pseudo code or whatever before you start writing it. Write the code in modular fashion - write part, test it, debug, test it again and then go to the next part. If you can write your code so that it is reusable, so much the better. Why keep reinventing the wheel? Well, sometimes the wheel is slightly square and you learn a better way of doing it. Now all you have to do is update your module and all is good. For the colo routine, what is the purpose? Put x colos on xyz planet. Sometimes working backward helps in figuring out what has to be done. Dump colos on planet. -- what is our (shudder) turn level? -- have we reached the desired number of colos? -- what product are we coloing? -- land -- needs planet number if more than 1 planet or have planet scanner -- T-warp move after getting lock (but it's a truce game - yeah and someone just killed your base figs) -- what is the sector? Should get at script startup. Get colos at TERRA  -- How many colos to get? Usually all we can carry. -- Land -- Lock on Fed or red jump point and move to terra (did you calc ore correctly for this)? -- Sector number for terra or jump point (you did check alignment at script start?) Now that part was simple except if you are red and want to stay alive. If you are red, you need to select your jump point carefully and then prepare it, and your script must note any intrusions. What other considerations are there when coloing in a non-truce game? Fedsafe blue? Hope so, but if not have you taken into account someone sitting at terra and powering up? Think your macro is fast enough not to get hit.. hope not. Scripting in itself can be fairly straight forward, but you have to realize that whatever you are doing, someone else is looking for a way to take advantage of it. Think of computing security - someone with enough time, knowledge, and imagination will find an exploit. If you are using a public script, chances are pretty good that a good player will counter it fairly quickly. At one time direct pdrops killed a lot of players - how often does that happen now? As a player, you evolve or die. Your scripts are the same, they must improve and evolve to counter what others are doing. The only way to evolve in scripting is to learn the game so you will know what has to be done - scripting is just figuring out how to do it and anticipating what others may do.
_________________
/ Promethius / Enigma / Wolfen /
"A man who has no skills can be taught, a man who has no honor has nothing."
|
| Tue Nov 25, 2008 3:57 pm |
|
 |
|
Admin 1
Site Admin
Joined: Sun Dec 24, 2000 3:00 am Posts: 1432 Location: USA
|
 Re: Scripting......
Promethius wrote: CAUTION: Long winded post...... After helping people with script questions for a while, I have found that people with a true interest will have the desire, but many times no concept of how to formulate what they are going to do. They know the main things - "I want colos on x planet" for instance, but don't realize they need to setup what they are going to do. I usually end up with something like: Get ore for the trip to and from? No, you need to know the round trip distance to get the ore amount required. k, so our calculation is the first thing? Hmm, no, your script needs to know what sector you are in and where you are going before you can calculate. k, got my sector and getdistance didn't work. ... So what is the issue when we first start scripting? We want to not only walk before we crawl, we want to be a world class 100 yard dash sprinter before we crawl. By this rather poor analogy, I see people who want to write complicated scripts before even learning what is required to even setup a simple t-warp move. "Oh, t-warp move is simple - just use ' send "m " $targetSector "*yy" ' that is all there is to it". Yep, that is all there is to it alright. So now that our new scripter has managed to fuse himself with a simple t-warp move (if he moved at all), what is involved from a script? There are assumptions that you can make, but what if those assumptions are wrong? Maybe you xported into a ship a corpie brought in and he forgot to add twarp or ore? Does the ship have twarp capability? Does the ship have enough ore for the trip? If we don't have enough ore, what does the script do? --- Port? Is the port selling ore? Is there enough ore? Buying equ doesn't do much good. --- Land? Sure hope they are our planets. --- Halt Do you have a lock on the sector you are going to? You've launched to a sector. Did you remember to account for the possibility of enemy mines? If you are writing scripts for public use, you cannot make assumptions. Even private scripts where you are the only one using them needs safety checks, or at least be ready for the results if you don't use safeties. Sometimes you have to just go for it w/o safeties, and as long as you feel the possible good outweighs the possibility of sitting out for a day, go for it. What is all this leading to? Basically, you need to outline your script - pseudo code or whatever before you start writing it. Write the code in modular fashion - write part, test it, debug, test it again and then go to the next part. If you can write your code so that it is reusable, so much the better. Why keep reinventing the wheel? Well, sometimes the wheel is slightly square and you learn a better way of doing it. Now all you have to do is update your module and all is good. For the colo routine, what is the purpose? Put x colos on xyz planet. Sometimes working backward helps in figuring out what has to be done. Dump colos on planet. -- what is our (shudder) turn level? -- have we reached the desired number of colos? -- what product are we coloing? -- land -- needs planet number if more than 1 planet or have planet scanner -- T-warp move after getting lock (but it's a truce game - yeah and someone just killed your base figs) -- what is the sector? Should get at script startup. Get colos at TERRA  -- How many colos to get? Usually all we can carry. -- Land -- Lock on Fed or red jump point and move to terra (did you calc ore correctly for this)? -- Sector number for terra or jump point (you did check alignment at script start?) Now that part was simple except if you are red and want to stay alive. If you are red, you need to select your jump point carefully and then prepare it, and your script must note any intrusions. What other considerations are there when coloing in a non-truce game? Fedsafe blue? Hope so, but if not have you taken into account someone sitting at terra and powering up? Think your macro is fast enough not to get hit.. hope not. Scripting in itself can be fairly straight forward, but you have to realize that whatever you are doing, someone else is looking for a way to take advantage of it. Think of computing security - someone with enough time, knowledge, and imagination will find an exploit. If you are using a public script, chances are pretty good that a good player will counter it fairly quickly. At one time direct pdrops killed a lot of players - how often does that happen now? As a player, you evolve or die. Your scripts are the same, they must improve and evolve to counter what others are doing. The only way to evolve in scripting is to learn the game so you will know what has to be done - scripting is just figuring out how to do it and anticipating what others may do. I just wanted to say thanks to you Prom for all your great scripts and ofcourse your patience with the numerous and redundent questions you get asked,,,,Seriously man thanks for all you have done and continue to do.
|
| Tue Nov 25, 2008 5:50 pm |
|
 |
|
V'Ger
Gameop
Joined: Tue Sep 25, 2007 7:27 pm Posts: 530 Location: Long Island
|
 Re: Scripting......
Prom, You do more for TW retired than most players do active. Keep up the good work! 
_________________ If you have a building game, they will come...
Proud Sysop of ICE9 TWGS Home of Building and Non Regulated Games http://www.oregonsouth.com/ice9 telnet://ice9-tw.com:2002
|
| Tue Nov 25, 2008 6:07 pm |
|
 |
|
Kaus
Gameop
Joined: Tue Nov 19, 2002 3:00 am Posts: 1050 Location: USA
|
 Re: Scripting......
*Long winded reply* /RANT At the risk of sounding conceded what set you off on this? For sake of argument I will (For now) assume it is in response to both personal tells you get from other new scripter’s AND my recent posting of inefficient tmilker with holds specification as an example. To defend myself I wrote that for Raja who had previous posted in three different threads (two different sites) requesting a script that will allow him to inefficiently pickup as few colonists as he wants. Maybe it was pure selfishness but I didn't "feel" like adding in precautions for it and in hindsight maybe was a shortcoming as I wasn’t attempting to make it some official release but more as something for him and maybe others to hopefully build off of. /Turn off ego that leads me to believe that -------------------------------------------------------------------------------------- I really appreciate all you and other scripter’s do for the newer players including myself. Your scripts are a resource as are the rest of the scripts publicly available. But there seems to be like this underlying issue of "DO IT YOURSELF" mentality that kills me. I mean where do you see well commented examples of said scripts. Sure you want people to crawl before they walk but Settextlinetriggers only go so far in twx. Take just about any script out there and I can think of a safety it would need. When in reality some of us can barely write directed response scripts. -How do you expect people to learn what while loops, BFS, and arrays work if they don’t ask? -Syntax examples are asinine and pointless to the non programmer. I can spout out about OSI layers but unless you’re a network guy you won’t get them. And publishing a reference with Code: ip route 0.0.0.0 0.0.0.0 < next-hop-IP or local exit interface> does absolutely jack squat for people not familiar with what it means. -What do you or anyone else purpose as a solution to the problem OTHER than pointing people to script.html? -We all have to start somewhere and allot of it is self taught/question oriented response from other more advanced scripter’s. Does that actually work for say someone like Joe Newbie who has no previous scripting experience? -Everyone thinks and reacts differently to different challenges. Because you work on your .TS with mission oriented programming (Read: Flowcharts, etc) doesn’t mean someone else should or does. To blanket the Classictw with a rant is counterproductive. What are you doing to help promote better scripting methods? So back to the original post. Most scripts should have protections like Code: Settextlinetrigger Yes1 :Cont "Locating beam" Settextlinetrigger No :No "No locating beam found" Doesn’t mean anyone other than me and the other scripter’s who have attempted to write this particular part of a script understand it does it? So what was the purpose of the rant? To bring attention to people constantly barraging you with questions? Bad scripting habits? Was it an attempt to point out everything people do wrong and outline with the correct way of scripting without any actual examples? I don't mean to come off negative; actually yes I do, its absolutely frustrating not knowing an answer to a question and not having a proper resource to consult to find said answer. If people (the better scripter’s) want us newbie’s (me included) to write our own scripts and be self sufficient there needs to be sufficient ways to facilitate that. Reading others .TS helps but it doesn’t explain what actual commands do or how they act (why one command is better than another). /End Rant P.S. Why is this in the Script forums? P.P.S. Often I feel like instead of actually wanting to help people SOME people choose to answer without answering questions. Point to websites to find there own answers. Or just don't care; FINE. But allot what seperates the "Elite" players from us "Newbies" include the level of scripting prowess that a person employs. And in the end its self serving, and prevents the progress of scripts to the few with the ability,TIME, and knowledge to deploy anything new.
_________________ Dark Dominion TWGS Telnet://twgs.darkworlds.org:23 ICQ#31380757, -=English 101 pwns me=- "This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."
|
| Tue Nov 25, 2008 6:21 pm |
|
 |
|
Promethius
Ambassador
Joined: Mon Feb 09, 2004 3:00 am Posts: 3141 Location: Kansas
|
 Re: Scripting......
Kaus, the post was not directed toward you or any script. I haven't seen the script you are talking about - saw the heading though.
Basically the point of my post, and the reason I placed it in the scripts forum is to get new scripters to open their eyes to look at all possibilities. Most players don't have a clue as to what is involved in a "simple" script so the post was an example of some of the things that may be taken into consideration.
A little bit of how to formulate a script is included to hopefully make the new scripter's life a bit easier. The use of modular coding can save an untold amount of time in script development and something most of us never think about when we are first starting out.
Yes, I have a bit of the "do it yourself mentality", but I want people to learn so they can adapt during a game and not wait on a scripter to make a change. I don't have a "you have to go it alone" mentality regarding someone learning and that is part of the reason for the post. If you've never written a script, where do you start? The goal oriented method seems to work pretty well when done in reverse to make a person think about what is required. Does everyone have to use this method to be successful - no, it is a possible way of writing a script that might make it easier.
Well commented scripts are not common from what I have seen. Maybe because I am not a programmer I have developed bad habits that include not commenting. I know there are many times I have been looking at a script and wondered why I did what I did - remove it and suddenly I have a day off from a game to remember why it was there in the first place.
Sorry that you assumed that this was a personal assault on you, as it wasn't. I won't trash another person's coding, because we all have our own areas that could take a hit.
As for people asking questions, that is how we learn and when I can help someone I do. As for BFS, I've never used one and don't have a clue on writing it.
Sorry again if the post upset you, and if the moderators feels the post should be moved that is fine by me.
_________________
/ Promethius / Enigma / Wolfen /
"A man who has no skills can be taught, a man who has no honor has nothing."
|
| Tue Nov 25, 2008 6:54 pm |
|
 |
|
Big D
Veteran Op
Joined: Tue Nov 28, 2006 4:04 pm Posts: 5025
|
 Re: Scripting......
I've noticed the same attitude lately. "Hey, I need a script to wash my socks and brush my teeth." type posts. A good script takes months to debug, and by the time you get it debugged, you'll need to upgrade it. I've released scripts that were debugged, only to find out they are outdated by the time you get it done, because someone has found a way to exploit one of the features. My scripts are never finished, but always a work in progress.
|
| Tue Nov 25, 2008 7:00 pm |
|
 |
|
ElderProphet
Commander
Joined: Tue Oct 07, 2003 2:00 am Posts: 1134 Location: Augusta, GA
|
 Re: Scripting......
To all: keep rants (even script related ones) out of the script forum.
_________________ Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.
|
| Tue Nov 25, 2008 7:03 pm |
|
 |
|
Big D
Veteran Op
Joined: Tue Nov 28, 2006 4:04 pm Posts: 5025
|
 Re: Scripting......
ElderProphet wrote: To all: keep rants (even script related ones) out of the script forum. Noted. Thank you.
|
| Tue Nov 25, 2008 7:06 pm |
|
 |
|
Promethius
Ambassador
Joined: Mon Feb 09, 2004 3:00 am Posts: 3141 Location: Kansas
|
 Re: Scripting......
ElderProphet wrote: To all: keep rants (even script related ones) out of the script forum. Sorry if the original post is considered a rant. I was hoping it might actually help someone in regard to possible ways to determine what they need to look at, and give maybe non-scripters a glimpse at some of the considerations that go into scripting. I was actually hoping that maybe yourself and sing would post in regard to how you go about scripting so maybe we could see other methods. As kaus pointed out, the new scripter has very little in the way of resources to learn other than the .html help file and asking questions. Writing a script from concept to finish can be overwhelming for most of us when we first start out because we don't know how to use the control structures or commands or what needs to be done first.
_________________
/ Promethius / Enigma / Wolfen /
"A man who has no skills can be taught, a man who has no honor has nothing."
|
| Tue Nov 25, 2008 7:34 pm |
|
 |
|
ElderProphet
Commander
Joined: Tue Oct 07, 2003 2:00 am Posts: 1134 Location: Augusta, GA
|
 Re: Scripting......
I am willing to offer more script classes, followed by a question & answer session. In previous ones, I managed to twist Sing's arm to help out and to field questions with me. You up for another one Sing? We may be able to hear one another without Jester's keyboard in the background  I'll create a Script Class poll / vote in another thread. I'll try and record them from now on, for posterity.
_________________ Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.
|
| Tue Nov 25, 2008 7:43 pm |
|
 |
|
Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA
|
 Re: Scripting......
Quote: But there seems to be like this underlying issue of "DO IT YOURSELF" mentality that kills me. I mean where do you see well commented examples of said scripts. Sure you want people to crawl before they walk but Settextlinetriggers only go so far in twx. Take just about any script out there and I can think of a safety it would need. When in reality some of us can barely write directed response scripts. Sad truth of the whole "scripting" thing is... you're either a programmer or you aren't. I don't mean in terms of training, I mean in terms of skill. A person either gets it, or they don't. If a person does, most training, most examples, aren't really neccessary. Sure there is some crawling and some walking, but it doesn't last long. If a person doesn't have the skill, well... then no training or examples will ever be enough. For myself (about the only example I'm qualified to give, lol)... I've been "writing code" since I was 6 years old. We had GWBASIC and LOGO on a school PC. Have never had a problem picking up any language from assembler to OO C++. When I went to learn TWXproxy all I did was crack open the TWXproxy command reference, a handful of public scripts, and starting writing stuff to solve issues in live games. I can't tell you the number of screw-ups I've written into code, and how many times it's gotten me #SD# or in trouble, but that's part of the learning process. But that's the way it's gone for every language. Some take a little longer to learn than others, TWXproxy is really straight-forward, but it's all the same thing really. It's all just logic flow. Quote: -How do you expect people to learn what while loops, BFS, and arrays work if they don’t ask? Well search algos like BFS and DFS are common in programming (esp w/ linked lists), and FOR/NEXT loops are taught in within the first few weeks of every class I've ever had. They're considered elementary. I was technically familiar with BFS before I started playing here, but never bothered to write one. My first exposure to TWXproxy's approach was with some of Supg's stuff, but it was a bit complex and I didn't see the need until later. Then one day I had a few questions and asked EP about them. He sent me a copy of his BFS and walked me thru a few of the steps. After that it was self-explanatory. If you want those examples... well they're all over the place now. EP posted his on grimy, and I'm sure there's one in the search feature here. You can learn a lot from using the forum search. If you look thru posts you'll notice he's gone over his example numerous times. Quote: -Syntax examples are asinine and pointless to the non programmer. I can spout out about OSI layers but unless you’re a network guy you won’t get them. And publishing a reference with Yea but that's where a command reference comes in. With a command reference I can look up the specifics to that example and be done w/ it. Nobody expects you, or anyone, to know all the syntax up front. That's why it's included w/ TWXproxy in the script.html file. Almost everything you need is there. Quote: Most scripts should have protections like Yes, but you can look up the trigger syntax in the command ref, then you know exactly what it does. Quote: Basically the point of my post, and the reason I placed it in the scripts forum is to get new scripters to open their eyes to look at all possibilities. Most players don't have a clue as to what is involved in a "simple" script so the post was an example of some of the things that may be taken into consideration. This is a problem that pervades the non-technically-minded in all walks of life. I've routinely had clients say "I just want an app that does..." without realizing exactly how complex such functions really are. In part that's good, since it's the job of a programmer to get the work done w/o exposing all of the nitty-gritty details, but it also leads to a lot of unrealistic expectations. Some of it's just the way techies are seen by our society, as low-level functionaries or hip "hackers" that can crack a billion-bit cipher in a matter of seconds. Unless you're acquainted by the limitations of technology, it's easy to underestimate the complexity of things. Quote: To all: keep rants (even script related ones) out of the script forum. Too bad I can't move threads... lol. Quote: Sorry if the original post is considered a rant. I was hoping it might actually help someone in regard to possible ways to determine what they need to look at, and give maybe non-scripters a glimpse at some of the considerations that go into scripting. I was actually hoping that maybe yourself and sing would post in regard to how you go about scripting so maybe we could see other methods. Hehe, I try to keep out of rants. Otherwise I write really long posts like this that nobody ever reads... lol. Makes me feel like I've caught a a case of rexxcrow-itis or something  . I think everyone has their own method. For me it's just logic flow. I start with a .ts file and in it I write up what I want as psuedo-code, then break it down into bits and pieces. I use comments, then separate the comments and fill them in w/ code. If you look at my public stuff, well the stuff on navhaz, you'll see comments. That's literally how I code, I start w/ those comments and fill them out. Quote: I am willing to offer more script classes, followed by a question & answer session. In previous ones, I managed to twist Sing's arm to help out and to field questions with me. You up for another one Sing? We may be able to hear one another without Jester's keyboard in the background Hahaha, that was fun tho. If we can get enough ppl, sure. I'll have to get new headphones tho, I broke my last set.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com
|
| Tue Nov 25, 2008 9:22 pm |
|
 |
|
Kaus
Gameop
Joined: Tue Nov 19, 2002 3:00 am Posts: 1050 Location: USA
|
 Re: Scripting......
Promethius wrote: Sorry that you assumed that this was a personal assault on you, as it wasn't. I won't trash another person's coding, because we all have our own areas that could take a hit.
No need to appologise I was off base in lala land apparently. If anyone owes a appology its me, I really do appreciate all you and the other more advanced scripters do for our small community. If anything it was my frustration of lack of reasources outside bugging you,sing,ep that lead to my "rant". I still think we need more scripting reasources in specific examples with detail explainations. Maybe when I feel confident enough I'll take the time to write some. At the very least I think we need a sticky in this forum with all currently available scripting reasources for newer players to find some common answers to their questions.
_________________ Dark Dominion TWGS Telnet://twgs.darkworlds.org:23 ICQ#31380757, -=English 101 pwns me=- "This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."
|
| Tue Nov 25, 2008 10:23 pm |
|
 |
|
|
Page 1 of 1
|
[ 12 posts ] |
|
Who is online |
Users browsing this forum: Google [Bot] and 16 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
|
|