Raised This Month: $51 Target: $400
 12% 

Creating sprites && brushes at runtime


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ralle
Junior Member
Join Date: Dec 2004
Old 03-17-2005 , 14:14   Creating sprites && brushes at runtime
Reply With Quote #1

Excuse me sirs,

I am not a good c++ coder nor i understand well how to use valves sdk correctly, but i want to have fun on our server and therefor i have spent a lot of time reading artikels in this forum (and @ hl2coding.com) to learn from you guys. And *tada* yesterday i have compiled my first plugin with basic functions. (including RecipientFilter and some IEffects)

Now I am very hot making more dirty things.... (excuse me)

I want to implement the following 2 features in my plugin:

Placing a (rotating) sprite above a player´s head. Or maybe a little light spot or glowing object.

Our clan banner as a static brush on a wall for each map. Or like an logo / banner flying in the air.

As I descriped I am no hero in programming c++. Therefor I need good tutorials as input. Has anybody seen a tutorial which I can use to make me and my clan happy. A concret source snippet would be nice, too!

Maybe it is a little step for u but it would be such a big one for me... ;-)

Thank you for helping

Greetings

Ralle
Ralle is offline
Tim
Senior Member
Join Date: Dec 2004
Location: the Netherlands
Old 03-17-2005 , 15:33  
Reply With Quote #2

As for the second of your questions, this was already discussed in German ;) :
http://forums.alliedmods.net/showthread.php?t=37353
Basicly: Ask someone to translate or ask Fruchtzwerg himself, as he's already managed
to create static flying banners on his http://www.kifferstuebchen.de/ servers...
(Please let me know if you figure it out, I couldn't get it working from the German explaination.)

Hopefully Fruchtzwerg will be kind enough to (direct us to a) post about
how to install the static banners, so we can all start to annoy players with
advertisements once again... ;)

I can't help you with the first question, so hopefully someone else will
jump in to answer or direct us to an answer to that one...


Greets,
Tim
Tim is offline
vancelorgin
Senior Member
Join Date: Dec 2004
Location: san frandisco
Old 03-18-2005 , 02:33  
Reply With Quote #3

It's just CreateEntity and KeyValue("model", "omgbanner.mdl")
__________________
Avoid like the plague.
vancelorgin is offline
Ralle
Junior Member
Join Date: Dec 2004
Old 03-18-2005 , 03:30  
Reply With Quote #4

@Tim: Thank you, I will try to contact Mr. Fruchtzwerg! If I receive information about that, I will post it here...

@Vance: Thank you too. But,
Could you please explain it a little more detailed? Maybe as a little code snippet?
I will be your slave for the rest of my life.... ;-)

Thank you

p.s.: I will be on vacation the next 3 days, so sorry that I can´t say "thank you" if you post the next help!
Ralle is offline
vancelorgin
Senior Member
Join Date: Dec 2004
Location: san frandisco
Old 03-18-2005 , 05:28  
Reply With Quote #5

Look up my sigscanner post on how to get CreateEntity - but I need to pretend to sleep now so my parents dont get pissed at me staying up all night. I'll post tomorrow.
__________________
Avoid like the plague.
vancelorgin is offline
Ralle
Junior Member
Join Date: Dec 2004
Old 03-22-2005 , 04:56  
Reply With Quote #6

I have played a little on my own with CBaseEntity-Class calling some "vital" functions. Some of them a working well (like setHealth) but when I use the following code...

Code:
CBaseEntity *playerBase = pEntity->GetUnknown()->GetBaseEntity();
CBaseEntity::Create("item_healthvial", playerBase->GetAbsOrigin(), playerBase->GetAbsAngles(), NULL);
or this one...

Code:
CBaseEntity *playerBase=gameents->EdictToBaseEntity( engine>PEntityOfEntIndex(userid) );
if (player)
{
  Vector forward;
  playerBase->GetVectors(&forward, NULL, NULL);
  UTIL_BloodSpray( (forward * 4) + ( playerBase->EyePosition() + playerBase->WorldSpaceCenter() ) * 0.5f, forward,
   BLOOD_COLOR_RED, 4, FX_BLOODSPRAY_ALL);
}
the plugin gets compiled but the server engine doesn´t load it. I think I have included all necessary header-files for game dll. What could be wrong?

I am compiling the code only for linux.

Thx for further help...
Ralle is offline
Ralle
Junior Member
Join Date: Dec 2004
Old 03-24-2005 , 16:50  
Reply With Quote #7

Vance? I am still waiting for your reply!

Thx a lot!
Ralle is offline
vancelorgin
Senior Member
Join Date: Dec 2004
Location: san frandisco
Old 03-24-2005 , 17:05  
Reply With Quote #8

CBaseEntity::Create is wildly not virtual, and so in windows you can't use it unless you find the addr yourself (see my sig scanner thread - I swear). In linux you can link the plugin with the server module, which will work well in theory.

As for the example - sorry, I've been out of coding for a while - back into it though. I'll try to have it up soon.
__________________
Avoid like the plague.
vancelorgin is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode