Vice City: Multiplayer

VC:MP Discussion => General Discussion => Topic started by: Kewun on Aug 08, 2016, 10:56 AM

Title: 3D text draw?
Post by: Kewun on Aug 08, 2016, 10:56 AM
Would be cool to add a function to vcmp Create3DTextdraw in-game you maybe know what i mean
just a suggestion
Title: Re: 3D text draw?
Post by: Kewun on Aug 08, 2016, 10:58 AM
it should look something like this

(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fstatic.wikigta.org%2Fen%2Fimages%2Fe%2Fe3%2FGrove_Street_005.JPG&hash=96d602986b452827d0352a0a346eb2d33f07c0a4)
Title: Re: 3D text draw?
Post by: KingOfVC on Aug 08, 2016, 11:22 AM
it exist in client side scripting.

1. create a label with GUILabel
2. Add element flag label.AddFlags( GUI_FLAG_3D_ENTITY )
3. Set label position label.Set3DTransform( ingame pos, rotation, size )
Title: Re: 3D text draw?
Post by: Kewun on Aug 08, 2016, 11:26 AM
lol i didnt know.. ill have to try this thing
Title: Re: 3D text draw?
Post by: Kewun on Aug 08, 2016, 11:29 AM
what params have GUILabel function? nvm, ik
Title: Re: 3D text draw?
Post by: Kewun on Aug 08, 2016, 11:33 AM
not works ;c

function Script::ScriptLoad()
{
   shit <- GUILabel(VectorScreen(50,50), 1,"Hello World")
   shit.AddFlags(GUI_FLAG_3D_ENTITY)
   shit.Set3DTransform(Vector(-266.748, -483.334, 54.6294),0,10)
}

what is wrong? i dont see the 3d label
Title: Re: 3D text draw?
Post by: Murdock on Aug 08, 2016, 11:35 AM
There's nothing wrong, it's just bugged. I already reported 3D elements not working a while ago
Title: Re: 3D text draw?
Post by: Kewun on Aug 08, 2016, 11:35 AM
oh ok
Title: Re: 3D text draw?
Post by: DizzasTeR on Aug 08, 2016, 12:23 PM
There is always an alternate way
https://www.youtube.com/watch?v=p_vkR7oH7g8&feature=youtu.be#
Title: Re: 3D text draw?
Post by: Kewun on Aug 08, 2016, 12:32 PM
pls tell how ;c
Title: Re: 3D text draw?
Post by: DizzasTeR on Aug 08, 2016, 12:33 PM
Quote from: Kewun on Aug 08, 2016, 12:32 PMpls tell how ;c

GUI.WorldPosToScreen
Now go play around with it and try to make it, it just took me 5 minutes.
Title: Re: 3D text draw?
Post by: Kewun on Aug 08, 2016, 12:34 PM
what params for this? GUI.WorldPosToScreen(Vector(posx,posy,posz)) ?
Title: Re: 3D text draw?
Post by: DizzasTeR on Aug 08, 2016, 12:37 PM
Quote from: maxorator on Apr 25, 2016, 07:47 PMGUI::WorldPosToScreen(position)
Parameter types: Vector. Return type: Vector.
Returns the screen coordinates for the position.

Read further more functions and documentations on this page in spoilers (http://forum.vc-mp.org/?topic=2719.0)
Title: Re: 3D text draw?
Post by: Kewun on Aug 08, 2016, 12:42 PM
pls post an example , i dont understand this new client side xD

or fix this for me, pls
function Script::ScriptLoad()
{
   shit <- GUILabel(VectorScreen(50,50), 1,"Hello World")
   shit.AddFlags(GUI_FLAG_3D_ENTITY)
   shit.WorldPosToScreen(Vector(-266.748, -483.334, 54.6294))
   shit.Set3DTransform(Vector(-266.748, -483.334, 54.6294),0,10)
}

cant see the label ;c
Title: Re: 3D text draw?
Post by: Stormeus on Aug 08, 2016, 12:57 PM
Quote from: Murdock on Aug 08, 2016, 11:35 AMThere's nothing wrong, it's just bugged. I already reported 3D elements not working a while ago

It's not bugged. I've tested it in-game and it's worked fine. Chances are you have an invalid transform set.
Title: Re: 3D text draw?
Post by: KAKAN on Aug 08, 2016, 12:59 PM
Quote from: Stormeus on Aug 08, 2016, 12:57 PM
Quote from: Murdock on Aug 08, 2016, 11:35 AMThere's nothing wrong, it's just bugged. I already reported 3D elements not working a while ago

It's not bugged. I've tested it in-game and it's worked fine. Chances are you have an invalid transform set.
Give us an example then.
Title: Re: 3D text draw?
Post by: Kewun on Aug 08, 2016, 01:05 PM
yes, give it pls :c
Title: Re: 3D text draw?
Post by: Stormeus on Aug 08, 2016, 01:18 PM
COL_TEXT <- Colour(255, 255, 255);
COL_TEXTBG <- Colour(20, 20, 20);
COL_SCROLL <- Colour(50, 50, 50);
COL_WINDOW <- Colour(75,75,75);
COL_TITLEBAR <- Colour(10,10,10);
CONSOLE_ALPHA <- 192;

CONSOLE_FONT <- "Lucida Console";
WINDOW_FONT <- "Verdana";
TITLEBAR_FONT <- "Tahoma";

w <- 400;
h <- 450;

// Main console window
window <- GUIWindow(VectorScreen(75, 75), VectorScreen(w, h), COL_WINDOW, "", GUI_FLAG_TEXT_TAGS);
window.AddFlags(GUI_FLAG_VISIBLE | GUI_FLAG_DRAGGABLE | GUI_FLAG_WINDOW_RESIZABLE | GUI_FLAG_WINDOW_TITLEBAR);

window.FontName = TITLEBAR_FONT;
window.FontSize = 10;
window.FontFlags = GUI_FFLAG_BOLD;
window.Text = "[#22ff22]MGUI[#d] Test Console";
window.TitleColour = COL_TITLEBAR;
window.Alpha = CONSOLE_ALPHA;

// Submit button
button <- GUIButton(VectorScreen(w - 65, h - 56), VectorScreen(50, 22), COL_WINDOW, "Submit", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
button.TextColour = COL_TEXT;
button.FontName = WINDOW_FONT;
button.FontSize = 11;
window.AddChild(button);

// Editbox
editbox <- GUIEditbox(VectorScreen(12, h - 56), VectorScreen(w - 86, 22), COL_TEXTBG, "", GUI_FLAG_NONE | GUI_FLAG_VISIBLE);
editbox.TextColour = COL_TEXT;
editbox.FontName = CONSOLE_FONT;
editbox.FontSize = 11;
window.AddChild(editbox);

// Memobox (actual console part)
memobox <- GUIMemobox(VectorScreen(12, 10), VectorScreen(w - 24, h - 74), COL_TEXTBG, GUI_FLAG_MEMOBOX_TOPBOTTOM | GUI_FLAG_VISIBLE);
memobox.TextColour = COL_TEXT;
memobox.FontName = CONSOLE_FONT;
memobox.FontSize = 10;
memobox.AddFlags(GUI_FLAG_TEXT_TAGS | GUI_FLAG_SCROLLABLE | GUI_FLAG_SCROLLBAR_HORIZ);
memobox.TextPaddingTop = 10;
memobox.TextPaddingBottom = 4;
memobox.TextPaddingLeft = 10;
memobox.TextPaddingRight = 10;
window.AddChild(memobox);

memobox.AddLine("[#22ff22]MGUI[#e] test console loaded!");
memobox.AddLine("Using [#ff0000][#uline]DirectX8[#e] renderer.");

window.AddFlags(GUI_FLAG_3D_ENTITY);
window.Set3DTransform(Vector(-674.337, 754.037, 10.9126), Vector(2.0, 1.0, 2.0), Vector(25.0, 25.0, 0.0));

This will create a transformed GUI console window outside the default spawn point.
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FtCZ92qJ.png&hash=4f14be523d2bad4df482503029a4774b4b96d213)

:edit: Note the key lines:
window.AddFlags(GUI_FLAG_3D_ENTITY);
window.Set3DTransform(Vector(-674.337, 754.037, 10.9126), Vector(2.0, 1.0, 2.0), Vector(25.0, 25.0, 0.0));

The rotation and scale for a 3D transformation are also vectors.
Title: Re: 3D text draw?
Post by: Kewun on Aug 08, 2016, 01:19 PM
O_O ok..
Title: Re: 3D text draw?
Post by: Kewun on Aug 08, 2016, 01:43 PM
lol <- GUILabel(VectorScreen(50,50),Colour(255,0,0),"shit!!!!!!!!!!!")
lol.AddFlags(GUI_FLAG_3D_ENTITY)
lol.Set3DTransform(Vector(-674.337,754.037,10.9126),Vector(2.0,1.0,2.0), Vector(25.0, 25.0, 0.0))
AddChild(lol)

cant get seem mine to working ;c still cant see label
Title: Re: 3D text draw?
Post by: KAKAN on Aug 08, 2016, 01:48 PM
That's GUIInstance.AddChild
Title: Re: 3D text draw?
Post by: Kewun on Aug 08, 2016, 01:52 PM
eh...

http://imgur.com/a/xOdV4

im retarded in guis, ill try configure it a little bit
Title: Re: 3D text draw?
Post by: KingOfVC on Aug 08, 2016, 02:02 PM
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fimgur.com%2FQE3RO2x.png&hash=1c732f019f4966472372578af6760242ad95f3b3)
Title: Re: 3D text draw?
Post by: Sebastian on Aug 08, 2016, 08:49 PM
Attaching the 3D textdraws to peds would be awesome.
Chat bubbles are very useful: chatting and playing is easier than ever.
(not talking about voice chatting)

https://youtu.be/jBekmg4jwSA
Title: Re: 3D text draw?
Post by: Shadow on Aug 08, 2016, 08:51 PM
@sseebbyy It is way easier to integrate, mainly if you have a FindPlayer() function for clientside.
Title: Re: 3D text draw?
Post by: Sebastian on Aug 08, 2016, 09:06 PM
Hey Shadow! Good to "hear" you again.

Quote from: Shadow on Aug 08, 2016, 08:51 PM@sseebbyy It is way easier to integrate, mainly if you have a FindPlayer() function for clientside.

Still.. there must be a way.

Not really into the GUI, but maybe I will try to learn it some day, so you guys may expect some topics from me, just like in the "good" old Times (http://archive.vc-mp.org/to2014/index.php?action=profile;u=4028;area=showposts;start=735).   :D
Title: Re: 3D text draw?
Post by: EK.IceFlake on Aug 08, 2016, 11:44 PM
Ee that will possible remove nametag from specific player... nice!
Title: Re: 3D text draw?
Post by: DizzasTeR on Aug 09, 2016, 02:01 AM
What @sseebbyy is talking about is also possible
Title: Re: 3D text draw?
Post by: Luis_Labarca on Aug 15, 2016, 05:34 AM
Quote from: Doom_Kill3R on Aug 08, 2016, 12:23 PMThere is always an alternate way
https://www.youtube.com/watch?v=p_vkR7oH7g8&feature=youtu.be#

hey bro could you give me the function of this function? Thank you
Title: Re: 3D text draw?
Post by: NewK on Aug 22, 2016, 01:59 AM
3D Scoreboards I added on the CTF server:

(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F3U8CGJ0.jpg&hash=b014a0fd9fdb996e8aa0305f11929130ec06d9bf)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FdouA54E.jpg&hash=9704668cd30da2b3534ed506f45f22275d8515b4)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FSlzpagB.jpg&hash=747efc1ae169b127e3837ce3ad59a08edc0ce7de)

@Stormeus  A few issues I noticed so far:

- The windows show above almost everything. They show "above" the HUD (1st screenshot and 3rd screenshot), minimap radar (3rd screenshot), chatbox (3rd screenshot), scoreboard (when you press F5)  and player nametags (2nd screenshot).

- The "hitboxes" for most elements are displaced. If I add a button to a 3D Window and I try to click on it, it won't detect the click and sometimes if I click somewhere else on the screen (outside the window) it will detect as if I'm clicking that button. The same goes for window titlebars, if I try to drag the window, nothing will happen, it wont even detect that I'm clicking on it, yet sometimes if I try "dragging" somewhere else on the screen (outside the 3D window), I end up dragging the window as if I'm dragging it by its titlebar.
Title: Re: 3D text draw?
Post by: MEGAMIND on Sep 16, 2016, 02:32 PM
Quote from: LuisModsHD on Aug 15, 2016, 05:34 AM
Quote from: Doom_Kill3R on Aug 08, 2016, 12:23 PMThere is always an alternate way
https://www.youtube.com/watch?v=p_vkR7oH7g8&feature=youtu.be#

hey bro could you give me the function of this function? Thank you
how to put 3d text labesl any idea

test <-- null;
function Script::ScriptLoad()
{
   test <- GUILabel(Position(-1864.62 382.307 669.333) , colour(255,265,234), "Hello World"));
   test.AddFlags(GUI_FLAG_3D_ENTITY);
   test.WorldPosToScreen(Vector(50,50));
   test.Set3DTransform(Vector(-1864.62 382.307 669.333));
   GUIInstance.AddChild(test);
}

not working any step by step help,
need this this badly
Title: Re: 3D text draw?
Post by: Ankris on Sep 16, 2016, 02:50 PM
Quote from: MEGAMIND on Sep 16, 2016, 02:32 PM
Quote from: LuisModsHD on Aug 15, 2016, 05:34 AM
Quote from: Doom_Kill3R on Aug 08, 2016, 12:23 PM.
.
.

test <- null;
function Script::ScriptLoad()
{
   test = GUILabel(VectorScreen(1, 1), Colour(255,265,234), "Hello World");
   test.AddFlags(GUI_FLAG_3D_ENTITY);
   test.Set3DTransform(Vector(-1864.62, 382.307, 669.333));
   GUI.AddChild(test);
}
Title: Re: 3D text draw?
Post by: EK.IceFlake on Oct 15, 2016, 09:30 AM
I can't get this working :(
            ::ChatH.rawset(plrid, GUILabel(VectorScreen(72, 72), Colour(255, 255, 255), plrsay));
            ::ChatH[plrid].AddFlags(GUI_FLAG_3D_ENTITY);
            ::ChatH[plrid].Set3DTransform(GUI.WorldPosToScreen(plr.Position), Vector(0.0, 0.0, 0.0), Vector(25.0, 25.0, 25.0));
It doesnt appear anywhere
Title: Re: 3D text draw?
Post by: NicusorN5 on Oct 15, 2016, 11:56 AM
It spawns on the center of the world...
Title: Re: 3D text draw?
Post by: EK.IceFlake on Oct 15, 2016, 12:07 PM
Why and how to fix it?
:edit: it was a !@#$ with angles now i fixed it but there is no player.Angle client side e.e