Third Person And Deathrun Help

Hello i am trying to make a image popup at the end of each round in deathrun i want a different image if runners win and a different image if deaths win, and i am trying to make a thirdperson command but am not sure how. i am using this deathrun gamemode made by BlackVoid i dont expect you to do all the work just a few examples and explanations.

http://forum.facepunch.com/showthread.php?t=1401781

there are example hooks on that url page and i think this is the hook i would need to use.

function GM:OnRoundEnd(winningTeam) end

[editline]25th September 2014[/editline]

Im off to bed i will reply to any questions in the morning so for now Bump

Hi,

Please try to ask only one question per topic, this makes it easier for people to respond and discuss. (Exceptions to this are the mega-threads like “Problems That Don’t Need Their Own Thread”)

According to the GitHub page for that gamemode (https://github.com/BlackVoid/deathrun) the GM:OnRoundEnd hook is shared between the client and the server. This makes your life considerably easier.

What you’ll want to do is create a file in /addons/<youraddonname>/lua/autorun/client that uses hook.Add to listen for OnRoundEnd. Your listening function should accept winner as an argument. Compare this argument to TEAM_RUN and TEAM_DEATH to determine which team won the round. At this point display some derma. You’ll need a DPanel containing a DImage. The images that you wish to use will need to be added to FastDL and downloaded with resource.AddFile.

Hopefully that gives you enough of a starting point.

Thank you for responding great help you have organised what I have to do, could you give a example how I would check witch team won?

…? … …

Thirdperson is done by modifying CalcView ( return a modified “view” table which sets the position ( origin or so ) behind where the player would be such as:


view.origin = origin + ( _p:GetAngles( ):Forward( ) * -100 ) + ( _p:GetAngles( ):Up( ) * 25 );

Which would move the position of the camera 100 units back, and 25 units up. 4/3 units = 1 inch, 16 units = 1 foot.

To make things easier, instead of using the ShouldDrawLocalPlayer when in thirdperson, simply set view.drawviewer = true; when thirdperson is activated which will do the same thing ( Draw the local player ).

To have an image open on round-end, take a look at this code which does something similar ( except on initial spawn… Very little would need to be modified – you could use HUDPaint to draw the image as the example does, or remove the HUDPaint hook and create a vgui element ( if it doesn’t exist ) ): https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/display_something_on_initial_spawn_teams.lua.html

Hopefully these tutorials and information helps. As always, to view the Lua from any of my tutorials to enable copy/pasting ( HTML doesn’t copy/paste well in terms of HTML / CSS Highlighted Lua ), remove .html from the url.

Thankyou for the help im going to leave this thread open for a little in case someone else has something but i got most of it covered thnx

Displaying an image on round end and adding a third person command are completely unrelated questions. It would therefore make more sense to me to have them in separate threads.

I got voted dumb by 3 people and disagree by 1 though, so I’d appreciate being told what the correct Facepunch etiquette here is.

yoshie i agree with you i should’ve made two threads :slight_smile:

No, just, no. Yoshie, you are wrong for saying that. Just ask questions in one thread for what you need and let people answer what they want to.

stop harassing yoshi gtfo out of my thread

@Yoshie

Typically if you make a thread, it would be to ask one or more questions after searching at least through Google “question site:facepunch.com” and not coming up with a solution to the issue… Not many actually Google their question.

The questions and solutions thread are for questions that are “simple” to answer…

ALL DarkRP questions are to go in the DARK RP HELP THREAD. People still post questions about it; I for one don’t know much about DarkRP, but so many DarkRP questions ( typically the same ones get asked every day, every other day or every 3 days ) that have already been answered in the large thread have been asked…

I’m thinking about adding on to my tutorials by creating a simple LARGE document which lists questions about specific gamemodes, and lists answers in 1 to many theads / posts. If I do that, it’ll probably go on my site and I’ll write some AJAX ( JavaScript, http, MySQL ) to fetch the post and display it on the site to help alleviate the issue…

Thirdperson is super simple so it’d make sense to ask it in the Simple Questions / Answers thread, but it is solved in MANY places. I posted a response of what to do, but the OP still used ShouldDrawLocalPlayer even though it wasn’t necessary ( did he read my thoughts, or copy code from elsewhere? )…

As for displaying an image on round-end, that would also be a simple question ( answered that too ) but it just requires some additional information such as the names of the hooks, etc…

There is no “Etiquette” per se; common sense should be used. There are rules saying that the thread title should be descriptive of the problem / question at hand, no flaming, no spamming, no back-seat moderating ( if you see someone break a rule, you can report it or ignore it, but if you post telling the user that they “should have done this, or shouldn’t have done that because they could receive z punishment” then a moderator may punish that person, But… Common sense, and the usual…

It is amazing how many resources are available just with a quick Google Search on this site, but not many take the few minutes to locate them which baffles me because some posts go unanswered for days, or longer and a solution could be on the first or second page…

Ah, I see your point about back-seat moderation. I wasn’t trying to, I was just trying to help a newbie out. (I’m friends with this guy on Steam and he pointed me to the thread)

Regarding your AJAX idea, I’m a little confused. Are you planning on using AJAX to fetch answers to common questions from Facepunch somehow? If so, same-origin policy will screw you over. If not, bear in mind that AJAX will destroy your SEO, so your resource won’t show up well in search engines. (although Google are planning on adding full rendering of JavaScript to their spiders in the near future - https://www.youtube.com/watch?v=-Z-NuSklwWU&feature=youtu.be&t=41m25s)

I’m familiar with SEO… The fetch would be for users so they can click, it’ll fetch and open up right under the window; it’d cache after fetching the first time to prevent more than 1 fetch query unless an admin forces it ( prevents data being changed / removed )…

The BOT template will be something else entirely… No real design, just internal links to other pages ( same that are on user page ), the content, etc… My content management system had a pretty in depth SEO module that I wrote. It could handle determining valuable words per page dynamically, or everything could be set up manually… It worked out pretty well too.

I didn’t “target” you for back seat modding; you asked about etiquette so I laid our the main points; in my opinion, you were misguided in terms of 1 question per topic, but meh…

That’s enough.

[editline]26th September 2014[/editline]

I don’t want anyone including myself getting in trouble and you people have answered my questitions so thnx

[editline]26th September 2014[/editline]

In the morning I’ll close.