[Community] The community evolutionary VX scripting project

The community evolutionary script project for RMVX

This is a little fun idea I came up with while drunk.
The basic idea is to apply the 5 word story to a script. I.e. each member built a little on the script.
Since writing a script and writing an easy is not the same there are some differences.
I don't expect anything useful to come out, I just expect some fun :D

Rules
Any posts which does not build on a script are completely ignored. I.e. they don't count in the 3-posts rule.

Rule 1: Choose a script from the last 3 submissions (up to)
You have to a script from the last 3 submissions to build on.
Remember that disqualified submissions does not count.
There are two cases where the choice is limited: (Note that the cases may not be mutually exclusive)
  1. There are less than 3 submissions in the topic. This limits the choice to the amount of submissions.
  2. One of your submissions is among the last 3 submissions. This limits the choice to the submissions made after your own. (Yes, this effectively prevents double submissions)


Rule 2: Code restrictions
Rule 2.1 Only one section
Do not write code which uses more than one sections.

Rule 2.2 Stay in RGSS2
No Win32API calls, no file creations, no shell executions, etc.

Rule 2.3 Sprites as only form of visual output
Any visual output must be made using a sprite.

Rule 2.4 Comments
Comments are allowed and are ignored in terms of effect on the script.
There are basically no comment restrictions.


Rule 3: Disqualification
A submissions can be disqualified.
Disqualified submissions are ignored in Rule 1.
I will occasionally check up on this topic and disqualify posts if necessary.

Rule 3.1 Handling 'bad' submissions
By bad submissions I mean submissions which will be disqualified in due time.
There will be a period of time from a bad script is submitted until it is disqualified.
In this time period it is still counted among the 3 submissions in Rule 1
Do not pick the submissions if you can see that it will be disqualified.
You are responsible for checking up on the script you pick being ok.
Follow-up disqualification is a definite possibility. (Avalanche disqualification)

Rule 3.2 Rule violations
Any Rule 2 violation causes immediate disqualification.
Also of follow up scripts. (Think avalanche effect)
Blatant disregard of Rule 4 & 5 will also cause avalanche disqualification.

Rule 3.3 Errors
Syntax errors cause an avalanche disqualification.
For other errors it's a bit more tricky, since it's not feasible to guarantee
You must be able to start the script and exit without problems.
This rule may be amended if necessary. I will give a notification in that case.


Rule 4: Additions
You may add up to 5 new effective code lines to the script.

Rule 5: Modifications
You may alter up to 3 effective code lines.
This includes removal of script lines.
Note that if you remove one statement and add another in its place it only counts as a modification.
If you add two statements in its place it counts as one modification and one addition.

Elaboration Spoiler
Let's say that we want to swap x and y then one way to do it is:
  1. temp = x
  2. x = y
  3. y = temp
Expand to see the code.


This counts as 3 effective code lines.
You can put it all one line by using ;
  1. temp = x; x = y; y = temp
Expand to see the code.

This still counts as 3 effective the code lines. If you use parallel assignment you get this:
  1. x, y = y, x
Expand to see the code.

That is 1 effective code line.

So there is no reason not to structure it nicely with spacing and line-braking and etc.
Using special language features is encouraged.

In doubt you can look at the grammar for the ruby language with 1 effective code line = 1 statement (stmt)


How to (test) run Spoiler
To run delete everything section except Main.
Replace that with this:

  1. # Create scene
  2. $scene = Scene_OurScene.new
  3. # Call main method
  4. while !$scene.nil?
  5.   $scene.main
  6. end
  7. # Fade out
  8. Graphics.transition(30)
Expand to see the code.


Insert a new section. You can copy the script from a post in there and you should be able to run it.


Rule 6: Submission
Add this in the top of your post if it is a submission:
[size=150]Submission[/size]


If the post does not contain this line it is not considered as a submission.
This (first) post is considered a submission as a special case since it defines the initialize scene.

Be sure to post the entire script and not just the section you have edited.
To ensure the sanity of your fellow scripts please wrap the code in [ruby ][/ruby] or [code ][/code] tags (With the space removed naturally)

It is also a good idea to tell which submission you have picked.



Initial Scene
  1. class Scene_OurScene
  2.   def main
  3.     start                         # Start processing
  4.     perform_transition            # Perform transition
  5.     post_start                    # Post-start processing
  6.     Input.update                  # Update input information
  7.     loop do
  8.       Graphics.update             # Update game screen
  9.       Input.update                # Update input information
  10.       update                      # Update frame
  11.       break if $scene != self     # When screen is switched, interrupt loop
  12.     end
  13.     Graphics.update
  14.     pre_terminate                 # Pre-termination processing
  15.     Graphics.freeze               # Prepare transition
  16.     terminate                     # Termination processing
  17.   end
  18.  
  19.   def start
  20.     @sprite = Sprite.new
  21.     @sprite.x = 304
  22.     @sprite.y = 224
  23.     @sprite.bitmap = Bitmap.new(32, 32)
  24.     @sprite.bitmap.fill_rect(0, 0, 32, 32, Color.new(196,196,196))
  25.   end
  26.  
  27.   def perform_transition
  28.     Graphics.transition(10)
  29.   end
  30.  
  31.   def post_start
  32.     # Nothing yet
  33.   end
  34.  
  35.   def update
  36.     if Input.press?(Input::C) || Input.press?(Input::B)
  37.       $scene = nil
  38.     elsif Input.press?(Input::LEFT)
  39.       @sprite.x -= 9
  40.     elsif Input.press?(Input::DOWN)
  41.       @sprite.y += 9
  42.     elsif Input.press?(Input::UP)
  43.       @sprite.y -= 9
  44.     elsif Input.press?(Input::RIGHT)
  45.       @sprite.x += 9
  46.     end    
  47.   end
  48.  
  49.   def pre_terminate
  50.     # Nothing yet
  51.   end
  52.  
  53.   def terminate
  54.     @sprite.dispose
  55.   end
  56. end
Expand to see the code.


*hugs*

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=70294