Book Mod (Not so good name)

I haven’t released this to the workshop yet because this is only intended for DarkRP, but I have made this mod that lets you write books and publish them for other people’s consumption.

Currently Spawning a book through q menu doesn’t really work, but when you buy your book, it looks like this.

http://images.akamai.steamusercontent.com/ugc/439450090596569215/A3849CDCE9AA3B2359A08E9AE3DEB4B4BAFDAA4C/

When you open it, you can edit the text, and change a few options
The stop sign freezes your book so others cannot steal it
The green arrow unfreezes it
The color wheel changes the color of the book
The book icon publishes it so you can not edit it anymore, and you see it how other people see it (Yes like minecraft)
The ‘i’ icon gives you the info I just stated in your chat.

http://images.akamai.steamusercontent.com/ugc/439450090596577518/2AA0FE7345285BA8FD4A330BA0C7C554E29BEAE2/

You can’t quite see it here, but the color auto updates as you are changing it, I thought it was cool

http://images.akamai.steamusercontent.com/ugc/439450090596579941/632623248173840DDB338354FAEF99E32112879A/

http://images.akamai.steamusercontent.com/ugc/439450090596580185/637784BC33BC665F2066A7DB245946E05986A00A/

A book in editing mode

http://images.akamai.steamusercontent.com/ugc/439450090596617043/2F05DF84F95015E4372799BDD490928BE50CBD97/

A published book (This is what other people see even before you’ve published it)

http://images.akamai.steamusercontent.com/ugc/439450090596617240/98A1915282EAC2BAF1E4065DB11FDA5398DE549C/

DOWNLOAD LINK

Do whatever with it.

Cool idea and nice work, any link we can download from so we can give you some constructive criticism

Oh yeah I forgot that part ha, yeah it’s edited in now :slight_smile:

Dear god

You need to learn how to use for loops, friend

I couldn’t quite figure out how to get dynamic variables that I could still send and receive data from, so I just wrote it all by hand.

Ugly code and UI could be improved but it’s a nice idea. Props to you.

thanks!

One question though. Why use buttload of single-line textboxes instead of a large multi-line one?


net.Start("bookAction")
            net.WriteEntity(ent)
            net.WriteEntity(LocalPlayer())
            net.WriteString("Publish")
        net.SendToServer()

No need to write LocalPlayer with net messages. Upon receiving a net message, the sending player is a pararemeter -


net.Receive("bookAction", function(len, ply) end)

Don’t be [DEL]Arizard[/DEL] Porma and write LocalPlayer like that because it’s a bad habit to get into and encourages exploits.

I would look up what sequences and series are

How do you make a large multi-line textbox? I couldn’t find a vgui element for that anywhere.

[editline]23rd July 2015[/editline]

I will get to working on that. I’ve had trouble with derma as of recent so spamming LocalPlayer was more or less out of anger, now I just need to get to optimization.

Also for the dynamic variable thing, you could have done:
[lua]
MenuBase.lines = {}

for i = 1, 20 do
MenuBase.lines* = vgui.Create(“DTextEntry”)

end
[/lua]

But you wouldn’t need that if you use one multiline DTextEntry anyways

I will look into multiline DTextEntrys, but I tried exactly that code while developing the addon and the MenuBase.lines*:GetValue() always returned nil

I have remade the addon, the link is still https://github.com/blindsighter314/Book-Mod
Any more suggestions?

Also thank you so much, I was able to remove 300+ lines of code because of that! :slight_smile:

how to you do to make the aura around the book

Line 17


halo.Add({Target}, Target:GetColor(), 5, 5, 2)

Design is clean but not that appealing, but still a BRILLIANT creation!

I have actually changed the GUI quite a lot since the original post :slight_smile:

http://images.akamai.steamusercontent.com/ugc/439450784228012441/A97E0D9551AA8F0404FCB3A8B24A82E4F544334B/

http://images.akamai.steamusercontent.com/ugc/439450784228012631/FAED02D0DD131099D505F8446A5D12F4F126248D/

You may fork it if you have any GUI suggestions, I’m most likley not going to upload this so if you made changes, and as long as I am accredited, you guys can upload this to the workshop or whatever.

I like your progress with this mod, keep it up.