I'm pretty sure it's not something people will need to do often and even if they do they can probablyuse your library better than me and figure it out lol.
When i try to compile the interface demo it give me this loading hud-groups.dme
interface-demo\input.dm:2:error: unable to open <forum_account\keyboard\keyboard.dme>.


hud-groups.dmb - 0 errors, 0 warnings

whats wrong? i wanted to see how ti worked :P
You got 0 errors so you can still see i guess.
No it don't work when it runs for me
In response to The True Monster
The True Monster wrote:
When i try to compile the interface demo it give me this loading hud-groups.dme
interface-demo\input.dm:2:error: unable to open <forum_account\keyboard\keyboard.dme>.


hud-groups.dmb - 0 errors, 0 warnings

whats wrong? i wanted to see how ti worked :P

You need to download the keyboard library: http://www.byond.com/developer/Forum_account/Keyboard

Hello master of all that comes in a library :P. I need your help with something in your HUD groups library(no change there), I have made a chat system with a say verb and the whole thing works fine it wraps text perfectly until it comes to wrapping a single word reaches a number within a certain range the proc completely ignore it for some reason. I'll show you all the code that goes with it then give you a scenario and let me know what you think.
Font
TrebuchetMS
icon = 'trebuchet-8pt.dmi'
char_width = list(" " = 4, "a" = 5, "b" = 5, "c" = 5, "d" = 5, "e" = 5, "f" = 4, "g" = 6, "h" = 5, "i" = 2, "j" = 3, "k" = 5, "l" = 1, "m" = 7, "n" = 5, "o" = 5, "p" = 5, "q" = 5, "r" = 3, "s" = 4, "t" = 5, "u" = 5, "v" = 5, "w" = 7, "x" = 5, "y" = 5, "z" = 5, "A" = 5, "B" = 5, "C" = 6, "D" = 6, "E" = 5, "F" = 5, "G" = 6, "H" = 6, "I" = 1, "J" = 4, "K" = 5, "L" = 4, "M" = 7, "N" = 6, "O" = 7, "P" = 5, "Q" = 8, "R" = 6, "S" = 4, "T" = 5, "U" = 6, "V" = 7, "W" = 9, "X" = 6, "Y" = 7, "Z" = 5, "0" = 5, "1" = 3, "2" = 5, "3" = 5, "4" = 5, "5" = 4, "6" = 5, "7" = 5, "8" = 5, "9" = 5, "," = 2, "." = 1, "'" = 1, "\"" = 3, "?" = 4, "(" = 2, ")" = 2, "<" = 4, ">" = 4, "/" = 4, ";" = 2, ":" = 1, "-" = 3, "+" = 5, "=" = 4, "_" = 6, "!" = 1, "@" = 8, "#" = 6, "$" = 4, "%" = 7, "^" = 5, "&" = 7, "*" = 5)
descent = 2
spacing = 1
line_height = 13

ChatLog
parent_type = /HudGroup
icon = 'chatboxicons.dmi'
layer = MOB_LAYER + 5
font = new /Font/TrebuchetMS()
var/width = 6
var/height = 7
var/width_limit
var
list/lines = list()
next_line = 1

New(mob/m, line_count)
..(m)

add(-4, -4,
icon_state = "center",
width = width,
height = height,
layer = MOB_LAYER + 4)
width_limit = (width*32)-3

for(var/i = 1 to line_count)

var/py = (line_count - i) * 16

lines += add(0, py)

proc
add_line(txt)
spawn()
for(var/i = 1 to lines.len)
var/HudObject/h = lines[i]

var/py = h.sy + 16

if(py >= lines.len * 16)
py = 0

h.pos(0, py)

if(i == next_line)
h.set_text(txt)
world<< txt

next_line += 1
if(next_line > lines.len)
next_line = 1

Screen_output(txt, /Font/font)
var/width = 0
var/line = ""
var/list/words = list()
var/word = ""
var/space = " "
for(var/i = 1 to length(txt))
var/c = copytext(txt, i, i + 1)

if(c == " ")
words += word
word = ""
else
word += c
if(word)
words += word

for(var/i = 1 to words.len)
if(lentext(line) == 0)
word = "[words[i]]"
else
word = "[space][words[i]]"

var/wordwidth = font.word_width(word)

if(wordwidth > width_limit)
for(var/I = 1 to length(word))
var/char = copytext(word, i, i + 1)

if(width + font.char_width(char) > width_limit)
add_line(line)
world << width
line = ""
width = 0
line += char
width += font.char_width(char)
continue
if(I == length(word))
line += char
width += font.char_width(char)
world << width
else
line += char
width += font.char_width(char)
world << width
continue


if(width + wordwidth > width_limit)
add_line(line)
world << "over [width]"
line = ""
width = 0
word = "[words[i]]"
line += word
width += wordwidth
continue
if(width+ wordwidth == width_limit)
add_line(line)
world << "dead on [width]"
line = ""
width = 0
continue

else
width += wordwidth
line += word
world << "next [width]"

if(i == words.len)
add_line(line)
world << "end [width]"





mob
var
ChatLog/chat_log

verb
Say(msg as text)
src.chat_log.Screen_output("[src.name]: [msg]")



mob
Login()
chat_log = new(src, 14)
chat_log.pos(30,30)

Screen_output is the proc I'm using to do outputs as you can see, and I cannot solve the problem, I've tried adding outputs in so I can see the range within which it happens but it for some reason doesn't even compute that part so I get no output. If you could get back to me as soon as possible that would be great.
The word I use to replicate the problem every time is supercalifragilisticexpialidous(not sure if that's spelt right but oh well)
In response to GreatFisher
That's quite a lot of code you've got there. You can use the font object's wrap_text proc. It adds line breaks to a string so that no line exceeds a specified width (in pixels). The return value is a single string, you can just write a proc to chop it into multiple strings (one for each line) and call the add_line proc for each.
In response to Forum_account
Yeah I know sorry about that, didn't realise how much it was till I posted it, I'll give your way a go.
Hey Forum_account, just wondering... Would it be possible to switch between your Sidescroller and back to the regular 3/4ths perspective?
In response to Kenny84
Kenny84 wrote:
Hey Forum_account, just wondering... Would it be possible to switch between your Sidescroller and back to the regular 3/4ths perspective?

It shouldn't be that hard. I don't know all the changes you'd have to make off the top of my head, but there shouldn't be many. To make it behave like a top-down game you'd have to disable gravity and make the up and down arrows move you up and down.

A really cheap and easy way to do this is to make all turfs act as ladders (in the areas you want to behave like top-down movement). When you're on a ladder you can move freely in any direction.
How would it be possible to changem y already existing AI code to use Move_towords, to represent the use of step_to? step_to looks messy moving 32 pixels when you move around 8 per step. My current implementation of move_towords is making the AI run past the mob, then back, etc.
In response to D-Cire
D-Cire wrote:
How would it be possible to changem y already existing AI code to use Move_towords, to represent the use of step_to? step_to looks messy moving 32 pixels when you move around 8 per step. My current implementation of move_towords is making the AI run past the mob, then back, etc.

I just updated the library, do you have the most recent version? The issue that I think you're describing with move_towards has been fixed.
I downloaded it and adjusted, however the AI mob now spazzes out around the target, and while moving towards it.
What do you mean by "spazzes out"? Can you provide a simple code example I can run?
Big fan of your libraries, fa. I even have plans to use one eventually.

Keep up the good work. =)
while(src)
if(src.Target)
if(bounds_dist(src,src.Target) < 32 && !move_towards(src.Target))
src.Target=null
stop()
slow_down()
continue
src.dir=get_dir(src,src.Target)
//src.Fight()
if(!ListCheck(src.Target,oview(8)))
src.Target=null
else if(src.Target in get_step(src,src.dir))
sleep(5)
stop()
slow_down()
else
move_towards(src.Target)
if(!src.Target)
for(var/mob/M in oview(8))
if(M.key)
src.Target=M
sleep(10)
break


"Spazzes out" As in doesn't look at the direction of the Target and instead flickers around in the 4 base directions while moving towards the target. Does the same thing while next to the target.
In response to D-Cire
My initial guess was the first line that says "src.Target=null". You're clearing the mob's target when they get close to their target. I'd think you'd want to switch to some different behavior here (ex: attacking) but keep the target set.

It appears to work for me but I had to make some adjustments to get it working. I put this code in the mob's action() proc:

mob
enemy
action()
..()

if(src.Target)
if(bounds_dist(src, src.Target) < 32 && !move_towards(src.Target))
src.Target = null
stop()
slow_down()
return

src.dir = get_dir(src, src.Target)

if(get_dist(src.Target, src) > 8)
src.Target = null

else if(src.Target in get_step(src,src.dir))
// sleep(5)
stop()
slow_down()
else
move_towards(src.Target)

if(!src.Target)
for(var/mob/M in oview(8, src))
if(M.key)
src.Target = M
// sleep(10)
break
that works for the most part, but upon running north/south then east/west it spazzes again.
My first guess is the "else if(src.Target in get_step(src,src.dir))" line. I'm actually not sure what that part is for - if you've reached that point you know that the bounds_dist to the target is >= 32. That else if and the else at the end might not even be necessary.
Get step was basically checking if its in front of the user before attacking, you dont want to attack someone behind you. Lol. Im unsure exactly what bounds_dist does, i figured it just checked if it was in 32 pixels of you it would come up true.
Page: 1 2 3 ... 12 13 14 15 16 ... 19 20 21