Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Zefk

#41
Your scripts / Multiple Digit Display
November 15, 2016, 05:25:33 AM
About:
This script displays multiple number values on the screen. This is mainly a demonstration on how my Advanced Digit Display can be duplicated. You can display 40 values at once with this script. I have no clue why anyone would need 40 to display at the same time, but go for it.

Download Demo:
Multiple Digit Display

Features:
1.Use bitmaps(png,etc) for numbers or any alien numbering system images
2.Use of sol.text_suface for font packages (Any Solarus compatible font package you want)
3.The script has a limit of 9 number places.
4.The ability to position or change coordinates of the numbers, money sign, and background to
different locations on the screen.
5.Easy to change! Go down to the comment, "CHANGE SETTINGS AREA:" at the beginning of the script.
6.The ability to show multiple different backgrounds, 40 different displays, or money signs.
7.A RGB color reference comment list at the end of the script
8.The ability to easily change the font in, "CHANGE SETTINGS AREA:."
9.Easily change the font color in, "CHANGE SETTINGS AREA:." Uses RGB color, so check the reference
list at the end of the script.
10.Easily change the font size in, "CHANGE SETTINGS AREA:."
11.Limiter money bag example in, "CHANGE SETTINGS AREA:."
12.The ability to turn off the display. It might be annoying always being on the screen..
13.The ability to add certain amount of zeros you want before your numbers for the place value.
For the thousand place it would be four(4). EX: 5 gold = 0005 (otherwise no zeros will be shown with zero(0))

YouTube Preview:
Multiple Digit Display

Gif Preview:


Next Script:
I will be working on releasing my letter input script. That can be used for character names.
#42
Your scripts / Menu Dialog Display
November 12, 2016, 02:30:37 PM
About:
This script displays text. You can pass a variable value or string into it using concatenation or use it for a dialog box. I made this mainly for a stat menu I am designing.

Download Demo:
Menu Dialog Display

Features:
1.Use bitmaps(png,etc) for numbers or any alien numbering system images
2.Use of sol.text_suface for font packages (Any Solarus compatible font package you want)
3.The ability to display text on the string. You can use it for menu text or a simple dialog box. I designed it mainly for menus.
4.The ability to pass a variable value or string into the the text using concatenation.
5.One can reverse the string, change spacing, and overwrite it with a new string.
6.The ability to position or change coordinates of the string.
7.Able to make the string diagonal and move the diagonal string down the y-axis.
8.Easy to change! Go down to the comment, "CHANGE SETTINGS AREA:" at the beginning of the script.
9.A RGB color reference comment list at the end of the script
10.The ability to easily change the font in, "CHANGE SETTINGS AREA:."
11.Easily change the font color in, "CHANGE SETTINGS AREA:." Uses RGB color, so check the reference list at the end of the script.
12.Easily change the font size in, "CHANGE SETTINGS AREA:."

YouTube Preview:
Menu Dialog Display

Gif Preview:
#43
Development / [Solved]How can I overwrite the string?
November 11, 2016, 01:08:54 PM
Here is my map script. At least for now it is a map script because that is where I have been coding and testing it. It controls and displays text on the screen with a string. You can activate it with key 'p', turn it off with 't', and turn it on with 'r'. Any ideas on how I can overwrite the string with a new one? I tried a few tactics, but they failed to work.

Code ( lua) Select
local text = "ZefK is gRaNd |zefk is grand |ZEFK IS GRAND!"

Code ( lua) Select
local sentence_word_length ={}
local alphabet_split = {}
local text_img = {}
local y_axis = {}
local x_axis = {}
local text_on = {}
--==========================================================================================================================================
----------------------
--CHANGE SETTINGS AREA
----------------------
--The text you want to show.
local text = "ZefK is gRaNd |zefk is grand |ZEFK IS GRAND!"

--Use font packages
local font_package = true

--Use image files
local image_files = false

--This will reverse the string if you want to talk elf or something.
local reverse = false

--Change the font package
--Leave it blank if you want the default font.
local font --= "minecraftia"

--Change font size
local font_size = 11

--Change color. Currently set to snow white (Not white 255,255,255, but snow white 255,250,250. Yeah, they are different.)
--Check in of script for some RGB color values.
local color_type = {255,255,255}

--This is how long your string is. "ZefK is gRaNd  zefk is grand  ZEFK IS GRAND!" = 44
--In Gedit I highlight and go to Tools> Document Satistics (You can use another software like notepad++ or you can count.....)
local max_text_len = 44

--The space between your font.
local spacing = 11

--Spacing for diagonal line.
local diagonal_line_space = 1

--Moves it down the x-axis
local diagonal_down = 0

--The length of the first sentence or word. This includes spaces. "ZefK is gRaNd " = 14
sentence_word_length[1] = 14
sentence_word_length[2] = 29
sentence_word_length[3] = 45

--Minus a value from the y_axis and minus a value from the x_axis. That causes a loop around or wrapping it around for a new line.
--You must minus from your start point. 70,70 in this case.
--Of course....this depends on your sentence_word_length and spacing.
y_axis[1] = 70
x_axis[1] = 70
y_axis[2] = 40 -- minus 30
x_axis[2] = -95 --minus 165
y_axis[3] = 10
x_axis[3] = -260

-----------------------------
--END OF CHANGE SETTINGS AREA
-----------------------------
--==========================================================================================================================================

--Tell the script it is a map and to use game functions
local map = ...
local game = map:get_game()

for rep = 0,85 do
--Loading 85 characters for the font text "text = alphabet_split[rep]"
local alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-=+/:;,.?"'.."'"..'><0123456789'
local index = alphabet:find('')
      index = (index % #alphabet) + rep -- move to next letter, wrapping at end
local abc = alphabet:sub(index, index)
      table.insert(alphabet_split, abc)

--Image loading
if image_files == true then
text_img[rep] = sol.surface.create("alphabet/"..rep..".png")
end

--Font loading
if font_package == true then
text_img[rep] = sol.text_surface.create({ -- name a local variable something and assign it to the sol.text_surface
   font = font, -- font name
   text = alphabet_split[rep], -- text you want to show
   font_size = font_size, -- font size obviously
   color = color_type, -- color must be in a table RGB (http://www.rapidtables.com/web/color/RGB_Color.htm)
})

end
end

--A table because I like tables and it prevents upvalue errors
local dl = { --dl stands for dialog ('d'ia - 'l'og)

      split_string = {},
      place_x = {},
      place_y = {},
}

--Turn on the text at start
for on = 0, max_text_len do
  text_on[on] = true
end

--Solarus draw function for showing image
function sol.main:on_draw(screen)

--Reversed or not reversed calculations
if reverse == true then
   for msg = 0, max_text_len do
     local index = text:len()-msg
     local letter = text:sub(index, index)
     table.insert(dl.split_string, letter)
   end
else
   for msg = 0, max_text_len do
     local index = string.reverse(text):len()-msg
     local letter = string.reverse(text):sub(index, index)
     table.insert(dl.split_string, letter)
   end
end

--Calculating wat text to display.
for char = 0, max_text_len do
--Lowercase calculations
if text_on[char] == true then
  if dl.split_string[char] == "a" then
    text_img[1]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "b" then
    text_img[2]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "c" then
    text_img[3]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "d" then
    text_img[4]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "e" then
    text_img[5]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "f" then
    text_img[6]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "g" then
    text_img[7]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "h" then
    text_img[8]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "i" then
    text_img[9]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "j" then
    text_img[10]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "k" then
    text_img[11]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "l" then
    text_img[12]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "m" then
    text_img[13]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "n" then
    text_img[14]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "o" then
    text_img[15]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "p" then
    text_img[16]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "q" then
    text_img[17]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "r" then
    text_img[18]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "s" then
    text_img[19]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "t" then
    text_img[20]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "u" then
    text_img[21]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "v" then
    text_img[22]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "w" then
    text_img[23]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "x" then
    text_img[24]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "y" then
    text_img[25]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "z" then
    text_img[26]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
--Uppercase Calculations
  if dl.split_string[char] == "A" then
    text_img[27]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "B" then
    text_img[28]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "C" then
    text_img[29]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "D" then
    text_img[30]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "E" then
    text_img[31]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "F" then
    text_img[32]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "G" then
    text_img[33]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "H" then
    text_img[34]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "I" then
    text_img[35]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "J" then
    text_img[36]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "K" then
    text_img[37]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "L" then
    text_img[38]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "M" then
    text_img[39]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "N" then
    text_img[40]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "O" then
    text_img[41]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "P" then
    text_img[42]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "Q" then
    text_img[43]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "R" then
    text_img[44]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "S" then
    text_img[45]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "T" then
    text_img[46]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "U" then
    text_img[47]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "V" then
    text_img[48]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "W" then
    text_img[49]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "X" then
    text_img[50]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "Y" then
    text_img[51]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "Z" then
    text_img[52]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
--Special characters
  if dl.split_string[char] == "!" then
    text_img[53]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "@" then
    text_img[54]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "#" then
    text_img[55]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "$" then
    text_img[56]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "%" then
    text_img[57]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "^" then
    text_img[58]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "&" then
    text_img[59]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "*" then
    text_img[60]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "(" then
    text_img[61]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == ")" then
    text_img[62]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "-" then
    text_img[63]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "=" then
    text_img[64]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "+" then
    text_img[65]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "/" then
    text_img[66]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == ":" then
    text_img[67]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == ";" then
    text_img[68]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "," then
    text_img[69]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "." then
    text_img[70]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "?" then
    text_img[71]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == '"' then
    text_img[72]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "'" then
    text_img[73]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == ">" then
    text_img[74]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "<" then
    text_img[75]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "0" then
    text_img[76]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "1" then
    text_img[77]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "2" then
    text_img[78]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "3" then
    text_img[79]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "4" then
    text_img[80]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "5" then
    text_img[81]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "6" then
    text_img[82]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "7" then
    text_img[83]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "8" then
    text_img[84]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
  if dl.split_string[char] == "9" then
    text_img[85]:draw(screen, dl.place_x[char], dl.place_y[char])
  end
end
end

end --end of draw function

--Function for allowing key pressing
function sol.main:on_key_pressed(key)

--Turn on the text
if key == "r" then
  for char = 0,max_text_len do
   text_on[char] = true
  end
end

--Turn off the text
if key =="t" then
  for char = 0,max_text_len do
   text_on[char] = false
  end
end

--30 Lines max. Add on for more lines of text.
for i = 1, max_text_len do
  if i < sentence_word_length[1] then
   dl.place_y[i] = x_axis[1]
   dl.place_y[i] = y_axis[1]
   dl.place_x[i] = i * spacing + x_axis[1]
  elseif i < sentence_word_length[2] then
   dl.place_y[i] = x_axis[2]
   dl.place_y[i] = y_axis[2]
   dl.place_x[i] = i * spacing + x_axis[2]
  elseif i < sentence_word_length[3] then
   dl.place_y[i] = x_axis[3]
   dl.place_y[i] = y_axis[3]
   dl.place_x[i] = i * spacing + x_axis[3]
  elseif i < sentence_word_length[4] then
   dl.place_y[i] = x_axis[4]
   dl.place_y[i] = y_axis[4]
   dl.place_x[i] = i * spacing + x_axis[4]
  elseif i < sentence_word_length[5] then
   dl.place_y[i] = x_axis[5]
   dl.place_y[i] = y_axis[5]
   dl.place_x[i] = i * spacing + x_axis[5]
  elseif i < sentence_word_length[6] then
   dl.place_y[i] = x_axis[6]
   dl.place_y[i] = y_axis[6]
   dl.place_x[i] = i * spacing + x_axis[6]
  elseif i < sentence_word_length[7] then
   dl.place_y[i] = x_axis[7]
   dl.place_y[i] = y_axis[7]
   dl.place_x[i] = i * spacing + x_axis[7]
  elseif i < sentence_word_length[8] then
   dl.place_y[i] = x_axis[8]
   dl.place_y[i] = y_axis[8]
   dl.place_x[i] = i * spacing + x_axis[8]
  elseif i < sentence_word_length[9] then
   dl.place_y[i] = x_axis[9]
   dl.place_y[i] = y_axis[9]
   dl.place_x[i] = i * spacing + x_axis[9]
  elseif i < sentence_word_length[10] then
   dl.place_y[i] = x_axis[10]
   dl.place_y[i] = y_axis[10]
   dl.place_x[i] = i * spacing + x_axis[10]
  elseif i < sentence_word_length[11] then
   dl.place_y[i] = x_axis[11]
   dl.place_y[i] = y_axis[11]
   dl.place_x[i] = i * spacing + x_axis[11]
  elseif i < sentence_word_length[12] then
   dl.place_y[i] = x_axis[12]
   dl.place_y[i] = y_axis[12]
   dl.place_x[i] = i * spacing + x_axis[12]
  elseif i < sentence_word_length[13] then
   dl.place_y[i] = x_axis[13]
   dl.place_y[i] = y_axis[13]
   dl.place_x[i] = i * spacing + x_axis[13]
  elseif i < sentence_word_length[14] then
   dl.place_y[i] = x_axis[14]
   dl.place_y[i] = y_axis[14]
   dl.place_x[i] = i * spacing + x_axis[14]
  elseif i < sentence_word_length[15] then
   dl.place_y[i] = x_axis[15]
   dl.place_y[i] = y_axis[15]
   dl.place_x[i] = i * spacing + x_axis[15]
  elseif i < sentence_word_length[16] then
   dl.place_y[i] = x_axis[16]
   dl.place_y[i] = y_axis[16]
   dl.place_x[i] = i * spacing + x_axis[16]
  elseif i < sentence_word_length[17] then
   dl.place_y[i] = x_axis[17]
   dl.place_y[i] = y_axis[17]
   dl.place_x[i] = i * spacing + x_axis[17]
  elseif i < sentence_word_length[18] then
   dl.place_y[i] = x_axis[18]
   dl.place_y[i] = y_axis[18]
   dl.place_x[i] = i * spacing + x_axis[18]
  elseif i < sentence_word_length[19] then
   dl.place_y[i] = x_axis[19]
   dl.place_y[i] = y_axis[19]
   dl.place_x[i] = i * spacing + x_axis[19]
  elseif i < sentence_word_length[20] then
   dl.place_y[i] = x_axis[20]
   dl.place_y[i] = y_axis[20]
   dl.place_x[i] = i * spacing + x_axis[20]
  elseif i < sentence_word_length[21] then
   dl.place_y[i] = x_axis[21]
   dl.place_y[i] = y_axis[21]
   dl.place_x[i] = i * spacing + x_axis[21]
  elseif i < sentence_word_length[22] then
   dl.place_y[i] = x_axis[22]
   dl.place_y[i] = y_axis[22]
   dl.place_x[i] = i * spacing + x_axis[22]
  elseif i < sentence_word_length[23] then
   dl.place_y[i] = x_axis[23]
   dl.place_y[i] = y_axis[23]
   dl.place_x[i] = i * spacing + x_axis[23]
  elseif i < sentence_word_length[24] then
   dl.place_y[i] = x_axis[24]
   dl.place_y[i] = y_axis[24]
   dl.place_x[i] = i * spacing + x_axis[24]
  elseif i < sentence_word_length[25] then
   dl.place_y[i] = x_axis[25]
   dl.place_y[i] = y_axis[25]
   dl.place_x[i] = i * spacing + x_axis[25]
  elseif i < sentence_word_length[26] then
   dl.place_y[i] = x_axis[26]
   dl.place_y[i] = y_axis[26]
   dl.place_x[i] = i * spacing + x_axis[26]
  elseif i < sentence_word_length[27] then
   dl.place_y[i] = x_axis[27]
   dl.place_y[i] = y_axis[27]
   dl.place_x[i] = i * spacing + x_axis[27]
  elseif i < sentence_word_length[28] then
   dl.place_y[i] = x_axis[28]
   dl.place_y[i] = y_axis[28]
   dl.place_x[i] = i * spacing + x_axis[28]
  elseif i < sentence_word_length[29] then
   dl.place_y[i] = x_axis[29]
   dl.place_y[i] = y_axis[29]
   dl.place_x[i] = i * spacing + x_axis[29]
  elseif i < sentence_word_length[30] then
   dl.place_y[i] = x_axis[30]
   dl.place_y[i] = y_axis[30]
   dl.place_x[i] = i * spacing + x_axis[30]
  end

end

--Text effects. Diagonal line.
if key == "o" then
for char = 1,max_text_len do
  dl.place_y[char] = char * diagonal_line_space + diagonal_down
end
for char = 1,max_text_len do
  --dl.place_x[char] = char * 9 + x_axis[1]
   dl.place_x[char] = char * 9 + x_axis[char + 3]
end
end

--This move it down. Just an example.
if key == "i" then
for char = 1,max_text_len do
  dl.place_y[char] = char * diagonal_line_space + 20
end
for char = 1,max_text_len do
  --dl.place_x[char] = char * 9 + x_axis[1]
   dl.place_x[char] = char * 9 + x_axis[char + 3]
end
end

end
#44
Your scripts / New Bank Script
November 09, 2016, 05:43:45 PM
About:
I think mostly everyone has seen my old bank script. My new one is better and it uses the new Advanced Digit Display and Advanced Digit Input scripts. The script has not changed at all, but I never released a raw version of the bank script, so I am going to release that. I will release updates on this post.

Download:
New Bank script

YouTube Preview:
New Bank script

Gif Preview:
#45
Your scripts / Advanced Digit Display Script
November 07, 2016, 12:43:47 PM
About:
This script display numbers from font packages and the use of image files as numbers. This script is better than my old one. I will attach old script here too. I never released it, but it was used in my previous bank script.

Download Demo_v1:
Advanced Digit Display Script

Download Script_v2: (Not much different, just removed unneeded code.)
Advanced Digit Display Script_v2

Features:
1.Use bitmaps(png,etc) for numbers or any alien numbering system images
2.Use of sol.text_suface for font packages (Any Solarus compatible font package you want)
3.The script has a limit of 9 number places.
4.The ability to position or change coordinates of the numbers, money sign, and background to
different locations on the screen.
5.Easy to change! Go down to the comment, "CHANGE SETTINGS AREA:" at the beginning of the script.
6.The ability to show multiple different backgrounds or money signs.
7.A RGB color reference comment list at the end of the script
8.The ability to easily change the font in, "CHANGE SETTINGS AREA:."
9.Easily change the font color in, "CHANGE SETTINGS AREA:." Uses RGB color, so check the reference
list at the end of the script.
10.Easily change the font size in, "CHANGE SETTINGS AREA:."
11.Limiter money bag example in, "CHANGE SETTINGS AREA:."
12.The ability to turn off the display. It might be annoying always being on the screen..
13.The ability to add certain amount of zeros you want before your numbers for the place value.
For the thousand place it would be four(4). EX: 5 gold = 0005 (otherwise no zeros will be shown with zero(0))

YouTube Preview:
Advanced Digit Display Script

Gif preview: (I like how the glitch looks, no lag, lots of frames missing)


What now?
I am going to go clean up my new Advanced Input Script and have it input up to a billion. After that....the new bank script!
#46
Your scripts / Advanced Custom Input Script
November 04, 2016, 07:40:32 AM
About:
You can used this script to enter numbers. This is my new advanced custom input script. It is a lot better than my old one.

Download Script with Sample Quest:
You can download the old 6 digit input max demo: here
You can download the recent 9 digit input max demo: here

Changes:
-Code has been massively simplified.
-The script goes up to the 9th local digit, 999,999,999 max.

Gif Preview: (Not lagging, just missing a lot of frames)


YouTube:
Advanced Custom Input Script

Features:
1.Use bitmaps(png,etc) for numbers or any alien numbering system images
2.Use of sol.text_suface for font packages (Any Solarus compatible font package you want)
3.The script goes up to the 9th local digit, 999,999,999 max.
4.Inputs go by exact numbers. Ex: 5,112,2121,3225,43474,503030, etc.
5.The ability to position or coordinates of the numbers, highlight blocks, and background to different locations on the screen.
6.The ability to disable numbers or digit places.
7.Easy to change! Go down to the comment, "CHANGE SETTINGS AREA:" at the beginning of the script.
8.Have the purple semi-transparent image block in the demo go across the X-axis or up the y-axis
9.A RGB color reference comment list at the end of the script
10.The ability to easily change the font in, "CHANGE SETTINGS AREA:."
11.Easily change the font color in, "CHANGE SETTINGS AREA:." Uses RGB color, so check the reference list at the end of the script.
12.Easily change the font size in, "CHANGE SETTINGS AREA:."

Script:
Attached to this post. Too long for the post apparently. (Login to view attachment)
#47
General discussion / Interesting features
October 31, 2016, 05:38:28 AM
About:
I will be listing random features here.

Status: Not finished

Traps in disguise:

We all can probably name simple traps. Most of the time they are noticeable.

  • Holes
  • Spikes


  • Falling/floor spikes/other falling objects: A good disguise trick for this is to have some floor spikes shoot up if a jump is not high enough or if the spikes are a different color, but colors warnings would not be a disguise trap.

  • Chests: We are always excited about a chest, but there is almost no hesitation in opening a chest or effort getting to it when it appears. A chest that walks or runs away makes it a little challenging. Also, not all chests will be safe to open. A chest can hold many disguise traps. Poison objects, shooting fists, bomb, fire, magic that can turn you into a helpless doll, and an endless amount of stat changes or penalties.

  • Furniture: Be careful in dungeons. A simple chair might be lethal. This can really surprise a player.

  • Terrain: A simple flower could be a disguised enemy and you might get hurt unless you have some way of detecting it or are very careful.

Interesting features:

  • Change of weapons: Animation during weapon change can be very appealing. In an ARPG with Alley Ai(s) the weapons can jump out of one character's hand and drop into the other character's hand. Also, there could be a telportation animated effect.

  • Menu: The characters graying out would look nice when pausing the game. This can give total concentration of the main character for browsing through a small menu with the character in the center. The character having a small glow would be best to capture the players eyes.

  • Actions/emotions: To really like a character facial feature changes and emotional responses are needed most of the time. A simple flicker for damage might not always be enough to feel for the character. A character yawning during sleep could replace the zzz bubble. Also, your ally/player character getting bashed down might make things a little challenging.

  • Number bouncing damage: This not only lets the player know how much damage is being inflicted, but looks really cool.

Ally AI:

A few common features that make people happy with alley AI are:


  • Border detection: Nobody likes it when their ally is trying to run to you and you need its help fighting, but it cannot because an impassible layer that they are not detecting is blocking them. A simple move up, down, left, right checking script would save time. That way you will not have to go to the ally, so they can follow you again.

  • Call to arms: A call to arms feature is good too. All allies would run to the currently playing character. That can be used if the player is in real need of help.

  • Distance check teleportation: The ally will teleport to the player when he/she gets too far away from the player. Good for magic characters.

  • Multiple projectiles: At least 2 different projectile weapons are nice to have. That way one ally can melee while the allies support from behind.

  • Healing magic: Healing items are good and all, but those could take time to make or money might be limited. A magic user that can heal the characters over time or can trade HP (it has a ton of it) to other players.

  • Healing pick: The option to pick which character to heal or to heal all characters is very useful because no on likes healing one character at a time.

  • Alley movement options: Telling the player to stay away from the enemy and shoot would be helpful because you do not want your support to run into the enemy and die.

  • Shielding magic and defend: Nobody likes getting hurt and a way to prevent that is with shielding magic. Especially in the case of disguise traps because you want to protect your alleys. Being able to block or defend yourself in a game is better than taking full on damage.

  • Training Ground: It is absolutely annoying when the player has to fight enemies that are too strong (EX: bosses with no weakness) and the others are too weak to give the player much experience. A training ground could give the player exp at the price of currency. Either they are false magic creatures or a place where hordes of monsters need to be cleared out. Also, this could be a tower village where the player has to fight to the top or bottom.

  • Switch/assign key: Being able to cast magic quickly and switching weapons without much effort is a must. Ex: Holding a key/button down and pressing up, down, left, and/or right. No one wants to pause the game just to cast a spell, but sometimes that would be needed or time could slow down.

  • Projectile delay: A delay in projectiles can allow the character to move and hit an enemy before the ally is struck. Also, this could allow the player to attack more than one enemy at a diagonal angle.

  • Projectile damage range: A collision range is one of the most important features because if you hit an enemy, then they should take damage! A lot of time in games I played the character hits the enemy, but the character was not directly facing it, so no damage taken. Most likely the projectile was not its own entity in these cases and some distance check with animation was used.

  • Ally detach and longer distance check: Allowing allies to detach from following and go after enemies is better than having them follow the hero until the hero moves into range. A lot of time the hero can be fighting and the allies are not detecting it because they are not in range. This could be an option setting in ally behavior controls in case the hero wants to avoid this enemy.

  • Targeting single enemy: Having all the allies attack one strong enemy can be a good choice because it would out weigh the damage caused my other weaker foes.

  • Switching: Switching between allies is always a good thing because each one has their own sets of skills. Switching can be in a follower order or in the case of no followers the main character would just poof to another character or being.

  • Sparkle follow path: Who said that the allies had to always be with the hero? They can go off and fight while following a sparkle path.

  • Checkpoints: Marking checkpoints can help make an exact path to follow for allies.

  • Heroes turn villain: Heroes turning into an enemy and back into an ally due to certain treatment is an interesting feature.

  • Random attacks or main player only:A lot of time with ARPG with followers the player is the only one ever targeted by enemy magic. A lot of the time the followers never use their magic abilities at all. Random magic attacks by enemies or enemies that attack the strongest or weakest in the group would be much more interesting. Although, this can excluded bosses because they normally the strong bosses bombard magic like crazy.
  • Going through Allies: This is better because attacking an enemy can be quicker.

  • Allow ally switch during menu: Having to switch between allies in order to switch weapons, use items, equip armor, etc. This can be annoying.

  • Instant item access: It is annoying when one gets bombarded to death by a boss with a triple strike attack. Not allowing inventory access during this to heal oneself is ridiculous.

  • Rapid strikes: It many ARPGs there is a pause to let the enemy to attack. That is understandable, but a massive pause after every attack is just dumb. An ARPG is not supposed to be turn based....

Thoughts:

  • Exp bottles
  • Exp trade
  • Friendly terrain
  • Terrain self defense
  • Enemy chest spawner
  • Creating villages
  • Enemy village spawn
  • Gang spawns
  • Character appearance change based on exercise
  • Magic that can change the character appearance to desired age
  • Random missions
  • Village attacks
  • Apprentices
  • Spawn structures

  • Random item chest. This can be a spinning wheel and a bad choice can hurt the player

  • Spirit storm. Plain Rain is getting plain boring in games these days.

  • Running

  • Save points that heal mp and hp

  • Blocking attacks

  • Moving blocks

  • Picking stats to level up and able to save stat points for later

  • Exp bar to next level and exp gain display

  • Different days instead of Monday, Tuesday, etc

  • Ability to automatically pick all enemies for magic attacks

  • When picking stats to level up...show changes to mp,hp,etc

  • A ringing sound for when the players health is low, but only have it go off for a few seconds. It can be annoying.

  • Day and nigh cycle that can follow different colors than normal.

  • Send items to a storage. That way the player can buy more.

  • "Some big chest to hide some stairs that go to lower floors" - Good idea Diarandor.

  • "random mini dungeon discovery/detection while traveling" - Good idea Stormfruit

  • "knock out the chest in order to open it" -Called Mimics

  • Monsterhouse- Hordes of enemies. Most likely strong enemies that surround the players. Leaving no way out, but to fight to the death or beat them all.

  • Multiple charged attack. EX: Charging the bar 8 times for a powerful attack.

  • Plant a seed and get an item or grows a tree house where you can do various activities

  • Weapon upgrades

  • One time magic items that can be bought for non-magic users

  • Items to bring the player back to life after death

  • Flying swords could lower the amount of animations needed for sprites

  • Damaged by attacking monster

  • weapon/magic levels and different magic attacks per weapon.

  • Different punches and other movements. The same punch combination can get super boring.

  • Magic attack types: Following magic blast attack, blast on command in one direction attack, zigzag blasts, circular blast, over wall blast, and multiple ground trail blast.

  • Training items - these can help the player gain more experience. Maybe they have side effects like slowing down the player.

  • Powerful attacks that can happen after a certain amount of successful strikes or charging up levels

  • Maintain charge for attack when knocked down.

  • Lock on enemy

  • Multiple Lock on

  • Spinning wheel platform

  • Magic item to change seasons

  • Time travel. Changes in the past affect dungeons in the future.

  • Code to pass to different games

  • Raze and lower water levels

  • Wheel turner (changes the path for the hero when touched at different points.)

  • Carrying ice to put out fires

  • Putting boulders in holes to travel down a path

  • Make all tiles the same color (possibly with a time limit) - take the fastest path

  • Item chests to stray hero off the path

  • Double jump

  • Projectiles bouncing off walls

  • Switch places item

  • Magnetic glove to pull toward and away from areas. (Move other metallic items)

  • Statues that come to life (when taking the treasure)

  • Walls that close in

  • Floors that fall away

Weapons & science fiction thoughts:

  • Sonic Rifle
  • Particle gun
  • Pulse Rifle
  • Colony
  • Force Fields
  • bypass
  • Sentry Units
  • Sentry Guns
  • Cyborgs
  • Robots
  • Megaton explosives
  • Synthetic
  • Trackers
  • Vents
  • Remote ships
  • Stranded ship
  • Parasites
  • Aliiens
  • Clairvoyant
  • Telekinesis
  • Psychic
  • Pyrokinesis
  • Telepathic
  • Clairaudient
  • Clairsensitive
  • Remote-viewer
  • Lucid Projector
  • Lucid dreamer
  • Precognitor
  • Retrocognitor
  • Psychometrist
  • Intuitive
  • Psychographer
  • Medium
  • ESP
  • Esper
  • Psycophoner
  • Physical ectoplasmic medium
  • Psychic Surgeon
  • Elevators
  • Plant Veggie parasites
  • Religious groups
  • Clones
  • Curse infusion
  • Scanners
  • Biosuits
  • Temperature
  • Terraformers
  • Planetoids
  • Rovers
  • Androids
  • Loaders
  • Armored arm tanks
  • Dropships
  • Pods
  • 9ner
  • Drop
  • 5by5
  • Robotic parts
  • Soul Pods
  • Medic Machines
  • Sticky Bomb
  • Gas race

Types of robots: Here and here

Types of Legendary Creatures: Here

Unique Names:

  • Franfixa
  • Tuzlagaldra
  • Titta
  • Disa
  • Epiza
  • LyudMilia
  • Domina
  • Gianna
  • Fete
  • Mimzy
A great place to generate names: here
#48
Development / C++ SDL and QT tips
October 27, 2016, 07:24:20 AM
I am not exactly sure on how to title this, but Solarus uses SDL 2.x and QT Creator for the editor as far as I know. I found some interesting tutorials on SDL/QT and that is the point of this post. Maybe if someone would like to help Solarus, then it might be useful.

C++ free pdf from tuorialpoint: Here and site tutorials

Tutorial point C++ online compiler: Here

Eclipse is crossplatform IDE (Java/C/C++/etc): Here

However, I used Anjuta when learning C++ basics on Ubuntu Linux and used a commercial book called Beginning C++ Through Game Programming.

SDL Lazy Foo's tutorials: 1.2 and 2.0

QT Creator tutorials: Here

Solarus has of the information in the tutorials above already implemented, but it might be useful for learning purposes if the Solarus engine source code or editor are not understood by an individual.

YouTube Tutorial SDL 1.2 + QT Creator setup: Here (Maybe old, but somewhat useful? If not, then this should help.)
#49
Your projects / Gallery sneak peek
October 23, 2016, 04:36:32 AM
This script is about done. I got the idea from the mouse pressing post to code it this way instead of with key presses. The galley can be used for a bonus feature. It can be used to display pictures from the game. The images can be locked and the thumbnails can be turned off too. I have done a similar script in the Renpy Visual Novel Engine. I think it is excellent that Solarus has the power to make visual novels with mouse controls.



The art is from opensource sources. I somewhat modified some of it. I will release the credit info for the graphics when I release the script.
#50
Development / How to require from a map?
October 15, 2016, 04:02:21 AM
Hello,

I tried loading an external script using require from the map script and I tried the same thing from the game manager, but it seems the map script prevented the script from loading in the game manager.

In the map I did:

Code ( lua) Select

local name_listing = require("scripts/pick_name.lua")

code here.....

if key == "p" then
  name_listing:name_picker() -- Require name_list.lua
end


It worked, but the map script stopped running. How would I get both scripts to run at the same time? Does it have to do with both scripts using same functions for key presses and image drawing?

-Zefk
#51
Development / Tip: Control structure too long near
October 10, 2016, 06:56:30 AM
This can happen with too many if statements  are nested into one if statement.

Control structure too long near

Too many elseif statements in one if control structure can cause the same error.

Code ( lua) Select
if X then
   -- stuff
elseif Y then
   -- stuff
elseif Z then
   -- stuff
end


Source:
https://forums.wowace.com/showthread.php?t=21768

It can happen with a loop too.

Code ( lua) Select
local b="x=1;"
while true do
        local s="while true do "..b.." end"
        local f,err=loadstring(s)
        print(#b)
        if f==nil then
                print(#b,err)
                break
        end
        b=b..b
end


Source:
http://lua.2524044.n2.nabble.com/Cause-for-quot-control-structure-too-long-quot-td7650425.html
#52
My text box passes the char to a table.

Code ( lua) Select
local text_box = {
       char={}
}

char = "1"
table.insert(text_box.char,char)

print("Char is:", table.concat(text_box.char))

name = table.concat(text_box.char)

print("His name is:", name)


This works, but how can I pass a different string to more than one person? Would I have to make more tables?

EX:
Code ( lua) Select
local text_box = {
       char= {}
       char2={}
}


I solved this and will post a link to my textbox script later.
#53
Your projects / Char input sneak peek
October 07, 2016, 04:16:13 AM
My char input goes up to 15 places. I fixed the error with "3" in the gif. I forgot to remove a comment in the script due to test reasons. I will add capitals and fix the coordinate errors or it might be a space in the char image.

#54
Your projects / Bank script sneak peek
September 30, 2016, 06:44:28 AM
Sneak Peek of Bank Script:
I bugged out most of the errors. I just got to finish deposit, then the script is done, but it will have to be modified for saving values.

This contains 3 scripts:
-My input script
-My number image display script
-My bank script

#55
Development / How do I prevent image scaling?
September 22, 2016, 06:19:06 PM
Hello,

How do I prevent image scaling? I noticed this when doing a screenshot of the map area. As I can remember it was 640x480, but the map size was really half that size 320x240. I reduced the image size to 320x240, but the image scales up to match the original 640x480 and this affects the quality of the image.

I attached images below. It shows that the map is set to 320x240, but it really is 640x480.
#56
I had more than 60 upvalues and got an error. A lua limit. Upvalues are variables declared outside of a particular function. I solved it with a table. This solved the 200 Local Variables Limit Problem as well.

Example:
https://forums.coronalabs.com/topic/6648-function-at-line-has-more-than-60-upvalues/?p=187272

Declaring over 60 arrays gives an over 60 upvalue error. Put the arrays in a table.

local yellow ={
      num1_place ={}
      num2_place ={}
      etc
}

yellow.num1_place[1] = 0
yellow.num1_place[2] = 0
etc

yellow.num2_place[1] = 0
yellow.num2_place[2] = 0
etc


Other interesting solutions:
I have not tested them, but go for it.
https://forums.coronalabs.com/topic/19555-solved-200-local-variables-limit-problem/ (Function table)
https://ask.wireshark.org/questions/46598/lua-60-upvalues-limit-in-function-solved (array)
#57
Development / Pausing?
August 31, 2016, 03:21:18 AM
Hello,

I have a question. Does the pausing functions and script need to be in the game manager to work? Basically, I want to press the default pause button "D" and have dot_5 show.

Code ( lua) Select
function game:on_paused()
      dot_5 = true   
end
 
function game:on_unpaused()
      dot_5 = false 
end
#58
Before:
Before you read below. You do not have to root your device, but it might be a little slower. I will talk about the root option too, and give a video link for it. Both methods drain your batter like crazy, so keep your android plugged in.

My thoughts:
I am not 100% sure, but you should be able to run Solarus on your Android without rooting your Smartphone using WINE. I am highly against the word "smartphone" because they are basically microcomputers just like laptops. I think the name is for marketing purposes. I can call phones with my laptop and that does not make it a smartphone.

Does it run decently?:
The Ubuntu Precise version works best in my opinion. It always has on all my computers. It is quite smooth depending on how much ram your android has. At least for the root method, but I do not think many people want to take a chance at bricking their android as they try to root it.

About root:

Rooting is good in many ways because on my Androids there is 200 MB of RAM and 30MB of internal storage being wasted by system apps that are useless and cannot be uninstalled. For instance, the old google+ messenger and other Google plus apps that do not work. Android is opensource and people should be allowed to have full control over it.

Two ways:
I know of two ways of doing this.

1. No root.
2. Rooting your phone.

System Specs:
I recommend at least 5-6 GB of storage and 1-2 GB of RAM for both methods.

No root:
1) Install Bochs.apk  (dont open)
2) Install SDL.zip  (extract the folder and put folder "SDL" in the directory "Memory Device" E.g. SD card
3) Download Ubuntu.img
4) Put "Ubuntu.img" in the "SDL" folder
5) Rename "ubuntu.img" to "c.img"
6) Start Bochs

Bochs and SDL
Download Ubuntu IMG

Root Method:
That video will be more clear than me. I never tried this method.
https://www.youtube.com/watch?v=I0PNsnNe3E0

Ending:
I hope this helped someone or maybe it opened your mind a little to more possibilities.

#59
Bug Report:
I was playing with the sample quest and made the hero die after setting too much bombs. Diarandor's hero sprite is no longer used after death. The old sample quest default sprite is used instead and that sprite goes invisible during sword usage.

Note:
I will report this to the Sample Quest on Github too.
#60
Greetings,

I think they did a great job on the new Zelda game, "The Legend of Zelda Breath of the Wild." It breaks limits and gives many fun realistic features. I do however think it breaks the Zelda traditional gameplay.

Why do you think they made a huge leap with Zelda?

The Legend of Zelda Breath of the Wild Preview
https://youtu.be/gCAJBxlaF0I

~Zefk