Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / [Game] The DBP experiment project. Post the next line of code.

Author
Message
tiffer
20
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Scotland
Posted: 7th Jun 2014 23:56 Edited at: 7th Jun 2014 23:56
You want to keep this as simple as possible otherwise people will get confused, bored and then leave (in that order).
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Jun 2014 00:04
I don't really see the point of limiting to 500 characters. DBP limits you to 1024 anyway, why not just go with that?

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 00:09 Edited at: 8th Jun 2014 00:11
Quote: "What about images? this not "code", this "metadata" or "media script", it just has to be strictly less than 500 characters?"


As far as I can see that is a string assignment; there are no image commands there. It is fine.

Quote: "You want to keep this as simple as possible otherwise people will get confused, bored and then leave (in that order). "


If you have fully read new incentives then I do value your point; and I am sorry if it confuses and bores you.

If you have already read the documentation and but confused let me know the point you do not understand.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 00:11
Quote: "I don't really see the point of limiting to 500 characters. DBP limits you to 1024 anyway, why not just go with that?"


When posting block statements like functions or types you can use multiple lines. 500 is easier to add up than 1024.

Your python script is working; I will update the levels and badges.

VisualProg
17
Years of Service
User Offline
Joined: 31st Mar 2009
Location: RussianFederation, Smolensk
Posted: 8th Jun 2014 00:22
Quote: "It is fine."

sorry, i am not understand - i may add image in length 3-5KB? If i make piecemeal image TextBitMap - this be endure 5-6 revisions for add 1 image in project...

MZh[NUL] <---

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 00:23 Edited at: 8th Jun 2014 00:24
For now, just add 500 characters at a time. Or perhaps make it smaller.

Very impressive by the way.

In future, that is; add 500 at a time. Look at your name in the first post to see your limit and any instructions.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 00:27 Edited at: 8th Jun 2014 00:28
Hmm, the script states:

contribution statistics
====================================
Chris Tate : contributed 9 versions, 5 unique versions, and a total of 1193 characters of code
TheComet : contributed 13 versions, 8 unique versions, and a total of 2440 characters of code
VisualProg : contributed 12 versions, 10 unique versions, and a total of 6879 characters of code

author statistics
======================
Chris Tate : Level 2 - "Colon Apprentice"
TheComet : Level 2 - "Colon Apprentice"
VisualProg : Level 2 - "Colon Apprentice"

VisualProg and TheComet have much more unique contributions than me; but we are the same level; level 2? Is that correct TheComet?

VisualProg
17
Years of Service
User Offline
Joined: 31st Mar 2009
Location: RussianFederation, Smolensk
Posted: 8th Jun 2014 00:28 Edited at: 8th Jun 2014 00:32
Quote: "just add 500 characters at a time."

now it is clear.

May i use WinApi? ("user"/"kernel"/"advapi")

MZh[NUL] <---

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 00:31
v0.035 - Item array for characters, enemies and who knows what might come up...

Your beer image makes my effort look like rubbish.



TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Jun 2014 00:43 Edited at: 8th Jun 2014 00:48
Oh so wait, you can add 500 characters of code over multiple lines? Well ok, that sounds reasonable. Does that mean we can remove the "1 line of code" rule and replace it with "500 characters"?

Quote: "level 2? Is that correct TheComet?"


Depends. I didn't implement the formula you used, so you might want to give the formula a tweak. It's located in the following method:


Small explanation:

self.get_list_of_unique_versions(author) returns a list of all of the different unique versions the specified author contributed (as you requested earlier).

I then use len() to determine the length of said list, which I then divide by 1.25, and take the floored square root of the result.

i.e. level = floor(sqrt(unique_versions/1.25))

The way I understand it, though, your formula is level = floor(pow(3, 1.25*unique_versions)-1). Is that correct?

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 00:47
Quote: "May i use WinApi? ("user"/"kernel"/"advapi")"


Quote: "3: No plugin commands, just native commands; the ones you see in the official documentation."


Call DLL is not a plugin command, so you can use it; providing it can run on any Windows machine, does not call third party DBP plugins and what you do with it is considered harmless.

Otherwise it is not
Quote: "safe, secure ... should not cause any crashing ... not violate any of TGC's policies or any law"


Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 00:49 Edited at: 8th Jun 2014 00:51
@TheComet, it is your call. I just wanted to confirm that the new level system would mean that we both would go down one level; lol.

As long as you get to level 30 or so with 1000 or so contributions, that seems fair.

Ideally those who contribute more, get to add more by boosting their limits. So the early levels, particually the first 10 should be easier to improve than the levels to follow.

Once you get bored of adding bit by bit, you get to do more things later on in the year.

VisualProg
17
Years of Service
User Offline
Joined: 31st Mar 2009
Location: RussianFederation, Smolensk
Posted: 8th Jun 2014 00:49
Quote: "Your beer image makes my effort look like rubbish."

try

looks like animation)

MZh[NUL] <---

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 00:52
I was considering making some bubbles, but I feel like venturing off into some of the other parts of the story for a while. Too much beer code from me in the same week.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Jun 2014 00:55
Quote: "As long as you get to level 30 or so with 1000 or so contributions, that seems fair."


With the current formula, 1000 unique contributions gets you to level 28. For level 30, you need 1125 unique contributions.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 00:56
Before I forget:

BADGE : BRONZE Terminator
Awarded to TheComet for inserting at least one valid END statement in the program

VisualProg
17
Years of Service
User Offline
Joined: 31st Mar 2009
Location: RussianFederation, Smolensk
Posted: 8th Jun 2014 01:02 Edited at: 8th Jun 2014 01:04
v0.036


MZh[NUL] <---

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 02:00 Edited at: 8th Jun 2014 02:02
v0.037 - Player answers "I have something to give to you" sub routine preparation



VisualProg
17
Years of Service
User Offline
Joined: 31st Mar 2009
Location: RussianFederation, Smolensk
Posted: 8th Jun 2014 11:32 Edited at: 8th Jun 2014 11:35
v0.038 - kernel for sound note


MZh[NUL] <---

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jun 2014 13:49 Edited at: 8th Jun 2014 14:28
I can't seem to get any of the recent versions to compile.

I keep getting messages like:

Quote: "Could not determine parameter type of '"000~~~222665999~888777~~877888988~A99999777555443333111000~~~~~~~~~~~FFF\000~~444BBBEEE~~EED~~~~~EDD~~EEDEDDDDCCCBBAA988444000~~~~~~~~~~FFF\000~333CCBEEE~EED~EEEEEDEDDDDDDCCCCBCBA~~~~~~~~AA9221000~~~~~~~~~FFF\000~55"


An earlier version gave the simpler

Quote: "Could not determine parameter type of '\"1\""


or something like that.

[I suspect I might need to reboot and try again. Hold your ponies and I'll check and report back. ]

Edit Hmm? Still the same problem. For some odd reason lots of extra backslashes seem to have been inserted into the code. I've just tried V0.033 again and got:

Quote: "Could not determine parameter type of '\"1\"' at line 23."


Anyone know what the problem is likely to be. I think I've noticed this before from time to time but don't know the cause or solution. Is it a forum or browser issue perhaps? Everything was fine yesterday.

Edit2 Done a bit more checking and this problem doesn't affect all posts. This is what I see when I open the code box for v0.033 (v0.032 is fine):



This has been discussed before but I can't recall the explanation/solution (other than manually going through the code to delete the extra backslashes)



Powered by Free Banners
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jun 2014 15:36 Edited at: 8th Jun 2014 15:46
I'm rather baffled. The line that's still giving problems (see the first long error message in my previous post) seems to be about 3600 bytes long and gets split into two lines by the DBPro editor which is why it doesn't compile. The problem with the extra \ characters seems to be a separate issue.

How are the rest of you compiling the latest versions?

Edit I managed to get the thing to compile by splitting the long line into 4 lines using the long line concatenation character. It would help me at least if the poster of that line could edit their post in the same way. (I'm sure CT would accept such a change since the code was posted before the new, and apparently essential, line length limit came into force.)

I'm using DBP version U77RC7 with the default editor version 23/6/2010 in case that is relevant.

Edit2 Forgot to add: I'm now rather thirsty having finally seen the glass of beer.



Powered by Free Banners
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 8th Jun 2014 16:20 Edited at: 8th Jun 2014 16:22
Quote: "I'm now rather thirsty having finally seen the glass of beer."


You get something like this....



I just realized you managed to see the image...for someone else that can't see it!

Cheers.

I'm not a grumpy grandpa
VisualProg
17
Years of Service
User Offline
Joined: 31st Mar 2009
Location: RussianFederation, Smolensk
Posted: 8th Jun 2014 18:24
Quote: "Edit I managed to get the thing to compile by splitting the long line into 4 lines using the long line concatenation character. It would help me at least if the poster of that line could edit their post in the same way. (I'm sure CT would accept such a change since the code was posted before the new, and apparently essential, line length limit came into force.)"

ok, thanks for the analysis. I am will correct this error.

MZh[NUL] <---

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jun 2014 19:06
Quote: "I am will correct this error."


Thanks.



Powered by Free Banners
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 20:48 Edited at: 8th Jun 2014 20:53
At a quick glance it seems like a forum escape character problem. It happen when you submit an post edit, without changing anything in the post; all of the escape characters are added to the code.

I'll leave it to VisualProg to correct.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 21:01 Edited at: 8th Jun 2014 21:05
Quote: "Python 2.7.7 (default, Jun 1 2014, 14:17:13) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
sorted version list
=====================
v0.001: Chris Tate : ""
v0.002: VisualProg : ""
v0.003: TheComet : "Fixed new lines, now uses printa instead of print"
v0.004: Chris Tate : "Move input down a bit"
v0.005: TheComet : "- (DEPRECATED) Use this to add new lines inside print statements, e.g. "this line"+nl+"is over this line""
v0.006: VisualProg : "- start program. Above will be functions"
v0.007: Chris Tate : "- Type in progress..."
v0.008: TheComet : "Fixed new lines, now uses printa instead of print"
v0.009: VisualProg : "- form the space for code"
v0.010: TheComet : "For when the player is too stupid to press the given keys"
v0.011: Chris Tate : "Move input down a bit"
v0.012: TheComet : "The character chose a drink!"
v0.013: Chris Tate : "Bartender reply"
v0.014: TheComet : "- Looks like the player is too stupid - added insults"
v0.015: VisualProg : ""
v0.016: Chris Tate : "- Background transition indicating the filling of beer; version 0.016; Had to reinsert because the code was incorrectly altered"
v0.017: VisualProg : "- this bitmap container, from 2D graphics"
v0.018: Chris Tate : "- Background transition indicating the filling of beer; version 0.016; Had to reinsert because the code was incorrectly altered"
v0.019: Chris Tate : "- Background transition indicating the filling of beer; version 0.016; Had to reinsert because the code was incorrectly altered"
v0.020: TheComet : "- Looks like the player is too stupid - added insults"
v0.021: VisualProg : "out BitMap to [x,y] read size [width,height]"
v0.022: Chris Tate : "- Type in progress..."
v0.023: VisualProg : "convert for loading TextBitMap"
v0.024: TheComet : "printa supports colour changes mid-sentence, and doesn't screw up DBPs internal cursor when mixing with newlines. "nl" IS DEPRECATED. Colours are specified between {} brackets, w=white, r=red, g=green, b=blue, y=yellow, m=magenta, l=lightblue. You may also specify a CAPITAL hex value, e.g. {FF00FFFF}. New lines are specified with \n."
v0.025: VisualProg : "loading TextBitMap12Bit"
v0.026: TheComet : "Fixed new lines, now uses printa instead of print"
v0.027: VisualProg : ""
v0.028: TheComet : "- Looks like the player is too stupid - added insults"
v0.029: VisualProg : "out BitMap to [x,y] read size [width,height]"
v0.030: TheComet : "Not trollling - if execution reaches here, it's time to exit (as to not flow into functions and subroutines)"
v0.031: VisualProg : "- image beer"
v0.032: TheComet : "- (DEPRECATED) Use this to add new lines inside print statements, e.g. "this line"+nl+"is over this line""
v0.033: VisualProg : "drink"
v0.034: TheComet : "User chose for bartender to tell a story!"
v0.035: Chris Tate : "- Items for the characters, enemies and who knows what"
v0.036: VisualProg : "sound beep"
v0.037: Gosub _something_to_give_bartender_at_start Chris Tate: "Preparing story branch related to giving the bartender something"
v0.038: VisualProg : "kernel for sound"
v0.039: Chris Tate : "Added 'I have something to give to you' story path sub routine"

contribution statistics
====================================
Chris Tate : contributed 11 versions, 7 unique versions, and a total of 1441 characters of code
Gosub _something_to_give_bartender_at_start Chris Tate: contributed 1 versions, 1 unique versions, and a total of 328 characters of code
TheComet : contributed 13 versions, 8 unique versions, and a total of 2444 characters of code
VisualProg : contributed 14 versions, 12 unique versions, and a total of 6926 characters of code

author statistics
======================
Chris Tate : Level 2 - "Colon Apprentice"
Gosub _something_to_give_bartender_at_start Chris Tate: Level 0 - "Total n00b"
TheComet : Level 2 - "Colon Apprentice"
VisualProg : Level 3 - "Programmer with no Life"
"


VisaulProg's Status


VisualProg and has acquired experience level 3

VisualProg has acquired the BRONZE Ping Pong badge for contributing twice in a row after the same contributor (Chris Tate) since v0.038

Chris Tate's Status


Chris Tate has acquired the BRONZE Ping Pong badge for contributing twice in a row after the same contributor (VisualProg ) since v0.039


-------------------------------




v0.039 - "I have something to give to you" story path sub routine.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Jun 2014 21:54 Edited at: 8th Jun 2014 21:56
@Chris

I was bored so I updated the script to download the latest version of code directly from the internetz. No more of that pesky copying and pasting into "code.txt", just run the script and boom, you're in business.



I'd like to mention a few things.

1) Add some more ranks
At the top of the code you will find:

Feel free to fill that up some more with some cool ranks.


2) Backwards compatibility

If for whatever reason you still want to use code.txt and not download it from the internet, you can still do that by running:

instead of:



3) Make it even easier to run

You should probably create a .bat file in the same folder with the content:


Which will stream the statistical results into the file "out.txt" when you double-click the .bat file.


4) Dependencies

If the script "fails to load module bs4" or something like that, you will need to open a command line prompt and enter:


If you do not have pip installed, get it here: https://pypi.python.org/pypi/pip

I really wished to just use the standard library, but the default HTML parser is the dumbest piece of **** I've seen in a long time, so sorry about that.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 21:55 Edited at: 8th Jun 2014 21:56
How to contribute a line of code


Step 1 : Update


- Locate the latest version of the mysterious program towards the end of the thread.


Step 2 : Copy


- Open the code tag.
- Select all of the code and all comments in the tag.
- Copy your selection of the entire program.
- Paste into your DarkBASIC editor of choice.


Step 3 : Test before contribution


- Make an observation of the code.
- Run the program to test for syntax errors
- If no errors occur, it should be safe for you to contribute


Step 3 : Determine what to contribute


- Run the program
- Advance through the content
- Determine what you would like to add, thinking of the user


Step 4 : Determine where you can contribute


- The following text is an attribute: [Attribute]
- It is an attribute because it has square brackets and is not part of a string assignment
- Determine if there is an attribute in the location you want to work in

If there is no attribute, a comment square brackets, you may add any your valid line of code.

Function FuncByTeddy() rem Teddy (v0.233)
For i = 1 to 10
Print i
"I want to add my line here, and can do so!"
Next
EndFunction

Do rem Teddy (v0.233) [AttributeName:ID]
For i = 1 to 10 rem Teddy (v0.233)
Print i
"I see text in brackets in the comment above. This contribution has an attribute! What should I do?"
Next
Loop

rem Teddy (v0.233) [AttributeName:ID]
Function FuncByTeddy()
For i = 1 to 10 rem Teddy (v0.233)
Print i
"This contribution has the attribute before and after! What does this mean?"
Next
EndFunction
[/AttributeName:ID]

- When you spot an attribute, you can ask an experienced player what it means.

Or

- You may find out yourself by copying the name of the attribute, and search for its meaning in the documentation.
- You will then be able to determine whether you can contribute in this place or not.

Step 5 : Design your line of code


- Once you are permitted to post, proceed
- Copy and paste the following line where you want to contribute

INSERT_CODE_HERE rem INSERT_YOUR_NAME_HERE (v0.INSERT_THE_NEW_VERSION_HERE) INSERT_REASON_FOR_CONTRIBUTION_HERE

- Double click each part to enter the required information as it has been done by the other players
- Enter your code

It must not contain any plugin commands which do not exist in the native documentation

Your code must be less than 500 characters including the comment after the version information

"How do I check how many characters my code has?"

- Look at the column number of the caret (that flashing line) when it is placed at the end of the line of code

or

- Copy and paste the code into an editor which can count the number of characters

"How do increase this limit?"

- Keep contributing and you will be rewarded with less constraints

Step 6 : Check the forum


- Someone may have contributed the version you are working on, refresh the forum thread again
- If this occurs, obtain the latest version and test it before committing your work


Step 7 : Test your code


- Compile the program

Did it compile? If not, please correct any mistakes.

- Test your code by advancing through the mysterious program to your point of contribution

You are permitted to 'cheat' your way to get to your part of the program for testing purposes. Be sure
to remember to remove the cheat code! It is important for the all previous code to be left as is provided so that dependencies are maintained

- If you are not happy with the result, that is fine; you can go back to step 5 and improve your work
- If you are happy, insert your version in the following part of the program header: `%Version 0.???%

For example, 0.070 would be inserted:

`%Project 'Untitled'%
`%Version HERE%
`======================

Step 8 : Submit your code


Copy and paste the latest mysterious program and insert into code tags in your forum reply.

You may also write something about your contribution and post a screenshot.

Thank you for completing the tutorial, now go create.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 22:02 Edited at: 8th Jun 2014 22:08
How to contribute a block of code


Step 1 : Update


- Locate the latest version of the mysterious program towards the end of the thread.


Step 2 : Copy


- Open the code tag.
- Select all of the code and all comments in the tag.
- Copy your selection of the entire program.
- Paste into your DarkBASIC editor of choice.


Step 3 : Test before contribution


- Make an observation of the code.
- Run the program to test for syntax errors
- If no errors occur, it should be safe for you to contribute


Step 3 : Determine what to contribute


- Run the program
- Advance through the content
- Determine what you would like to add, thinking of the user


Step 4 : Determine where you can contribute


- The following text is an attribute: [Attribute]
- It is an attribute because it has square brackets and is not part of a string assignment
- Determine if there is an attribute in the location you want to work in

If there is no attribute, a comment square brackets, you may add any your valid line of code.

Input "Enter the door number you wish to enter: ", door$ rem Teddy (v0.233)
"I want to add my block of code here, and can do so!"

Input "Enter the door number you wish to enter: ", door$ rem Teddy (v0.233) [AttributeName:ID]
"I want to add my block of code here, but there is an attribute!"


rem Teddy (v0.233) [AttributeName:ID]
Function FuncByTeddy()
Input "Enter the door number you wish to enter: ", door$
"This contribution has the attribute before and after! What does this mean?"
EndFunction
[/AttributeName:ID]

- When you spot an attribute, you can ask an experienced player what it means.

Or

- You may find out yourself by copying the name of the attribute, and search for its meaning in the documentation.
- You will then be able to determine whether you can contribute in this place or not.

Step 5 : Design your line of code


- Once you are permitted to post, proceed
- Copy and paste the following line where you want to contribute

rem INSERT_YOUR_NAME_HERE (v0.INSERT_THE_NEW_VERSION_HERE) INSERT_REASON_FOR_CONTRIBUTION_HERE
INSERT_YOUR_OPENING_DECLARATION_KEYWORD_HERE

INSERT_YOUR_CLOSING_DECLARATION_KEYWORD_HERE

- Double click each part to enter the required information as it has been done by the other players
- If you are creating an if statement, the opening declaration keyword is 'If' and the closing one is 'EndIf'
- If you are creating a type, the opening declaration keyword is 'Type' and the closing declaration keyword is 'EndType'
- Add all necessary code up to 500 characters

Your code block must be less than 500 characters including the comment after the version information

It must not contain any plugin commands which do not exist in the native documentation

"How do I check how many characters my code has?"

- Copy and paste the code into an editor which can count the number of characters

"How do increase this limit?"

- Keep contributing and you will be rewarded with less constraints

Step 6 : Check the forum


- Someone may have contributed the version you are working on, refresh the forum thread again
- If this occurs, obtain the latest version and test it before committing your work


Step 7 : Test your code


- Compile the program

Did it compile? If not, please correct any mistakes.

- Test your code by advancing through the mysterious program to your point of contribution

You are permitted to 'cheat' your way to get to your part of the program for testing purposes. Be sure
to remember to remove the cheat code! It is important for the all previous code to be left as is provided so that dependencies are maintained

- If you are not happy with the result, that is fine; you can go back to step 5 and improve your work
- If you are happy, insert your version in the following part of the program header: `%Version 0.???%

For example, 0.070 would be inserted:

`%Project 'Untitled'%
`%Version HERE%
`======================

Step 8 : Submit your code


Copy and paste the latest mysterious program and insert into code tags in your forum reply.

You may also write something about your contribution and post a screenshot.

Thank you for completing the tutorial, now go create.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Jun 2014 22:02 Edited at: 8th Jun 2014 22:02
Hmm, it's now recognizing my python script as the latest version of code... Give me a few minutes.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Jun 2014 22:05 Edited at: 8th Jun 2014 22:06
Okay, fixed.



Looks like VisualProg has leveled-up to level 3 "Programmer with no Life". Congrats!

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jun 2014 22:07 Edited at: 8th Jun 2014 22:10
Thanks a lot TheComet; the old one stated he is level 3, I updated the statistics earlier.

I will start using the new one from now on. I have to go.

In the future you should do a TGC forum formatting version with tags, or the option so we can post here and make it look more easy to read. No hurry is necessary.

Do not forget to put your name in there as the creator of the leveling system.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jun 2014 23:44
Quote: "At a quick glance it seems like a forum escape character problem. It happen when you submit an post edit, without changing anything in the post; all of the escape characters are added to the code."


Thanks. I knew there'd be a simple explanation.

Still not sure why I'm the only one having difficulty compiling the versions with the (very) long line. Anyway, VisualProg has offered to correct that as well.



Powered by Free Banners
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 9th Jun 2014 00:28
@GG

Which of the IDE's have you been using may I ask?

@TheComet

The new script raises an indentation error on line 292



Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jun 2014 00:31 Edited at: 9th Jun 2014 00:33
Quote: "Which of the IDE's have you been using may I ask?"


The default Synergy one as I stated here:

http://forum.thegamecreators.com/?m=forum_view&t=211263&b=1&msg=2522673#m2522673



Powered by Free Banners
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Jun 2014 04:05
@Chris
Quote: "The new script raises an indentation error on line 292"


Fixed.


Accidentally used a tab instead of 4 spaces. Python relies on correct indentation.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 9th Jun 2014 11:01
One step ahead, I seem to need to install some module:

Quote: "from bs4 import BeautifulSoup # use 'pip install beautifulsoup4' to install this module
ImportError: No module named bs4"


TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 9th Jun 2014 14:59
Excuse me for not reading that bit; got too excited. Will test now.

If you do not want to add the level names yourself, let me know. I thought you would have liked to have done that.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 9th Jun 2014 15:10
Grrr.
Quote: "Python.exe can't find '__main__' module in pip"


Now googling this error pip install beautifulsoup4 problem.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Jun 2014 16:06
Quote: "If you do not want to add the level names yourself, let me know. I thought you would have liked to have done that."


I'm not that imaginative, and it is your project after all But if you wish for me to take over that task, I'll do it.

Are you running pip from within IDLE? Usually you open a windows command prompt and just type in "pip" and hit enter. If that runs successfully, then you type "pip install beautifulsoup4" to install bs4.

As stated above, I do apologise for introducing dependencies, but I really didn't want to get a headache from working with python's default HTML parser.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 9th Jun 2014 16:56 Edited at: 9th Jun 2014 16:56
Yeah, your level names are fine, do not rush; nobody will be able to reach past level 5 any time soon.

I understand about the library, if it makes it easier then all the better.

Am I running pip from within IDLE? No, in the windows command prompt. I have to write 'python pip' because of no system variable for pip.

I get the same error whether I write 'python pip' or 'pip install beautifulsoup4'. This is all after running 'python get-pip.py' successfully.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Jun 2014 19:21
@Chris - I quickly tried installing it on a fresh win7 install, and here's what I did.


TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Jun 2014 19:24 Edited at: 9th Jun 2014 19:27


v0.040 - subroutine for option "I need work"

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 9th Jun 2014 19:50
I still get the same error message. My attempt at Python module installation seems to be inadequate; I should try to reinstall pip again? Now wondering how one is to uninstall a Python module?



v0.041 - The 'I have something to give to you' sub routine is linked.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Jun 2014 19:58 Edited at: 9th Jun 2014 19:59
Maybe the way you installed pip differs? The way I installed pip is I downloaded this here: https://bootstrap.pypa.io/get-pip.py (from their help page here: https://pip.pypa.io/en/latest/installing.html). Then I just ran "python get-pip.py". If your Window PATH points to C:\python27\Scripts then you should be able to invoke pip directly from the command line.

Quote: "Now wondering how one is to uninstall a Python module?"

Usually through pip (pip uninstall <package> )



v0.042 - "i need work" subroutine is linked

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 9th Jun 2014 20:52
Yipee! I actually managed to install it; wow It was easier to install Windows! Actually it was not that bad.

Ahh, now my brain can turn off panic mode. Wow that is pretty cool, it gets the code directly from the forum thread!

v0.043 - Item constructor function declaration


Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 9th Jun 2014 20:53 Edited at: 9th Jun 2014 20:54

sorted version list

=====================
v0.001: Chris Tate : ""
v0.002: VisualProg : ""
v0.003: TheComet : "Fixed new lines, now uses printa instead of print"
v0.004: Chris Tate : "Move input down a bit"
v0.005: TheComet : "- (DEPRECATED) Use this to add new lines inside print statements, e.g. "this line"+nl+"is over this line""
v0.006: VisualProg : "- start program. Above will be functions"
v0.007: Chris Tate : "- Type in progress..."
v0.008: TheComet : "Fixed new lines, now uses printa instead of print"
v0.009: VisualProg : "- form the space for code"
v0.010: TheComet : "For when the player is too stupid to press the given keys"
v0.011: Chris Tate : "Move input down a bit"
v0.012: TheComet : "The character chose a drink!"
v0.013: Chris Tate : "Bartender reply"
v0.014: TheComet : "- Looks like the player is too stupid - added insults"
v0.015: VisualProg : ""
v0.016: Chris Tate : "- Background transition indicating the filling of beer; version 0.016; Had to reinsert because the code was incorrectly altered"
v0.017: VisualProg : "- this bitmap container, from 2D graphics"
v0.018: Chris Tate : "- Background transition indicating the filling of beer; version 0.016; Had to reinsert because the code was incorrectly altered"
v0.019: Chris Tate : "- Background transition indicating the filling of beer; version 0.016; Had to reinsert because the code was incorrectly altered"
v0.020: TheComet : "- Looks like the player is too stupid - added insults"
v0.021: VisualProg : "out BitMap to [x,y] read size [width,height]"
v0.022: Chris Tate : "- Type in progress..."
v0.023: VisualProg : "convert for loading TextBitMap"
v0.024: TheComet : "printa supports colour changes mid-sentence, and doesn't screw up DBPs internal cursor when mixing with newlines. "nl" IS DEPRECATED. Colours are specified between {} brackets, w=white, r=red, g=green, b=blue, y=yellow, m=magenta, l=lightblue. You may also specify a CAPITAL hex value, e.g. {FF00FFFF}. New lines are specified with \n."
v0.025: VisualProg : "loading TextBitMap12Bit"
v0.026: TheComet : "Fixed new lines, now uses printa instead of print"
v0.027: VisualProg : ""
v0.028: TheComet : "- Looks like the player is too stupid - added insults"
v0.029: VisualProg : "out BitMap to [x,y] read size [width,height]"
v0.030: TheComet : "Not trollling - if execution reaches here, it's time to exit (as to not flow into functions and subroutines)"
v0.031: VisualProg : "- image beer"
v0.032: TheComet : "- (DEPRECATED) Use this to add new lines inside print statements, e.g. "this line"+nl+"is over this line""
v0.033: VisualProg : "drink"
v0.034: TheComet : "User chose for bartender to tell a story!"
v0.035: Chris Tate : "- Items for the characters, enemies and who knows what"
v0.036: VisualProg : "sound beep"
v0.037: Chris Tate : "Story branch related to giving the bartender something"
v0.038: VisualProg : "kernel for sound"
v0.039: Chris Tate : "Added 'I have something to give to you' story path sub routine"
v0.040: TheComet : "User chose for bartender to give him work"
v0.041: Chris Tate : "Story branch related to giving the bartender something"
v0.042: TheComet : "Call subroutine for handling "i need work" option"
v0.043: Chris Tate : "- Item creation function declaration"

contribution statistics

====================================
Chris Tate : contributed 14 versions, 9 unique versions, and a total of 1849 characters of code
TheComet : contributed 15 versions, 10 unique versions, and a total of 2726 characters of code
VisualProg : contributed 14 versions, 12 unique versions, and a total of 6920 characters of code

author statistics
======================
Chris Tate : Level 2 - "Colon Apprentice"
TheComet : Level 2 - "Colon Apprentice"
VisualProg : Level 3 - "Programmer with no Life"

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Jun 2014 01:19 Edited at: 10th Jun 2014 01:20
Hmm? V0.043 crashes DBPro as soon as I paste the code into the editor.

Here's the error. It might mean something to somebody.





Powered by Free Banners
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 10th Jun 2014 02:06
Oh please don't tell me the host has made yet another syntax error...

[Now checking ...]

OK, it runs fine on my machine. Is this an error message that crops up at the end of the program?

Which bartender option did you pick?

Login to post a reply

Server time is: 2026-07-06 16:34:33
Your offset time is: 2026-07-06 16:34:33