AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   playback_event usage (https://forums.alliedmods.net/showthread.php?t=56207)

hlstriker 06-08-2007 20:16

playback_event usage
 
I'm assuming the function 'playback_event' will let you recreate an event. If this is the case, how do I find the events that it can recreate. Are these just the same events that I see when logging messages with Damaged Souls message logger? If they are the same things, is there a way I can get a full list of the events?

Also, there is 'pfn_playbackevent' which I'm assuming will capture when an event is played. Is this correct? I feel stupid asking this, but what does 'pfn' mean?

If someone knows how can you also give me examples of using both of these functions please?

regalis 06-08-2007 20:28

Re: playback_event usage
 
This is a sample for make the smoke which comes out of the smokegrenade in CS
Code:

engfunc(EngFunc_PlaybackEvent, 0, ent, 26, 0.0 , origin, g_angle, 0.0, 0.0, 0, 1, 0, 0);

The Events are in the folder cstrike/events/
They are used to let the client do bulletholes and stuff..
I'm sure there is nothing very usefull with it...but the smoke*gg*

greetz regalis

Zenith77 06-08-2007 20:34

Re: playback_event usage
 
pfn is a common prefix to functions in C++ (maybe even other languages) that is short for "pointer function". Pointer functions are just, the best way I can describe them, are variable functions that can point to any function that has the same the signature as its definition.

Example (in pseudo-pawn code. I put it in pawn code instead of C++ to help you better understand the concept):
Code:
public MyFunc(a, b[], c, d) {      // code } // declare a pf (asterisk '*' is an operator declaring a pointer in C/C++) public (*pfnSomeFunc(a, b[], c, d,)) = NULL; pfnSomeFunc = MyFunc; // Call w/e pfnSomeFunc is pointing to pfnSomeFunc(w, x, y, z);

hlstriker 06-08-2007 20:55

Re: playback_event usage
 
Quote:

Originally Posted by regalis (Post 487201)
This is a sample for make the smoke which comes out of the smokegrenade in CS
Code:

engfunc(EngFunc_PlaybackEvent, 0, ent, 26, 0.0 , origin, g_angle, 0.0, 0.0, 0, 1, 0, 0);
The Events are in the folder cstrike/events/
They are used to let the client do bulletholes and stuff..
I'm sure there is nothing very usefull with it...but the smoke*gg*

I'm working with the mod Team Fortress Classic. I see an event folder, but when I open up each .sc file (that's all the folders contain in events), each file reads "// TF Shotgun". Is there a way I can get the number each event is?

Quote:

Originally Posted by Zenith77 (Post 487202)
pfn is a common prefix to functions in C++ (maybe even other languages) that is short for "pointer function". Pointer functions are just, the best way I can describe them, are variable functions that can point to any function that has the same the signature as its definition.

Thanks that cleared it up pretty much.

regalis 06-08-2007 21:04

Re: playback_event usage
 
Sorry, i have no idea how to get the event number..i only know that event 26 is the smoke..0o
Maybe in some .cpp files inside the HLSDK...
Do you have the HLSDK? it is very interesting to look at the stuff there ;)

greetz regalis

hlstriker 06-08-2007 21:21

Re: playback_event usage
 
Last I saw of the SDK was back on won days. I didn't know how to program what so ever then :P

Wouldn't the events be game specific though, I wouldn't think they would be in the SDK?

Is there a way I can get the SDK without buying it on steam?

Arkshine 06-08-2007 21:23

Re: playback_event usage
 
http://svn.alliedmods.net/viewvc.cgi.../?root=amxmodx

hlstriker 06-08-2007 21:45

Re: playback_event usage
 
Thanks, does anyone know if the TFC source is released anywhere?

Also, is there a way to find the parameters for the playback?

VEN 06-09-2007 12:02

Re: playback_event usage
 
No and No. Unless you hack the dll or something.

With fakemeta module you can playback events and hook the ones that the game use: register_forward(FM_PlaybackEvent, "fwPlaybackEvent"). All parameters is passed to the hook of course. Hooked function's prototype will be
PHP Code:

fwPlaybackEvent(flagspInvokereventindexFloat:delay, const Float:origin[3], const Float:angles[3], Float:fparam1Float:fparam2iparam1iparam2bparam1bparam2

Quote:

Is there a way I can get the number each event is?
Yes. At the map start all events is precached so you can get its ids. In plugin_precache do register_forward(FM_PrecacheEvent, "fwPrecacheEvent", 1). Hooked function's prototype will be fwPrecacheEvent(type, const event_name[]). Whenever fwPrecacheEvent is called you can retrieve event index with get_orig_retval().

Quote:

Are these just the same events that I see when logging messages with Damaged Souls message logger?
No. Speaking in terms of HLSDK the things that you hook with register_event() / register_message() (so called "events") are actually messages. And events are the ones that is played with PlaybackEvent.

You can find more information on events in the FULL HLSDK.


All times are GMT -4. The time now is 10:34.

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