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

Natural Selection module


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
BAILOPAN
Join Date: Jan 2004
Old 05-26-2004 , 04:11   Natural Selection module
#1

This is an update notice for Natural Selection users.

With mahnsawce's permission I have split NS2AMXx into two portions. The first portion is engine specific commands - I have merged these into the normal ENGINE module.

The second portion is the actual Natural Selection natives and stocks. Most of these remained exactly the same, except all natives/stocks are prepended with "ns_".

This module is not the same as NS2AMX because it a)uses the AMXx API and not the 0.9.6+ API and b) is very stripped to NS specific functions. It will be upkept as an "official" module and mahnsawce can upkeep it too if he wishes too.

I heavily recommend NS plugin writers to use this module - and to give input/suggestions back on how to make it better.
Although no binaries are available (Because this is the new API) you can see the new source code here:

Engine source
NS2AMXx source

New Engine and NS2AMXx includes

Some important info:
I have not tested the stocks. If someone could verify that they compile/work I would be very greatful.

Some things I will not add the NS2AMXx or Engine module:
Registering plugin specific forwards for global things. This is unnecessary and there is no advantage (string comparison is the same if used in C or the AMX Machine - equal() is not written in Small). The 0.20 module API improves forward registering by providing a nice set of functions, so there are no other possible improvements. Global forwards have been moved to Engine.
Using mahnsawce's pev() native. This is because entity_set_* conforms to a nice naming standard and is easy to understand and deal with (except for a longer native name length).

Please give any and all feedback, NS users :]
__________________
egg
BAILOPAN is offline
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 05-26-2004 , 09:20  
#2

Interesting...
__________________
My Plugins

Got ??
AssKicR is offline
mICKE
Member
Join Date: Mar 2004
Location: Sthlm, Sweden
Old 05-26-2004 , 10:48  
#3

This sounds great, i hope its not to hard to rewrite the plugins to this module
mICKE is offline
Send a message via ICQ to mICKE
CheesyPeteza
Senior Member
Join Date: Feb 2004
Location: UK
Old 05-26-2004 , 15:33  
#4

Quote:
Using mahnsawce's pev() native. This is because entity_set_* conforms to a nice naming standard and is easy to understand and deal with (except for a longer native name length).
I don't understand that bit. First you say you are you using his cool new pev() method, then you give reasons for sticking with the old long style? Anyway I just looked up the include files and see no pev() so I assume you left out the "we are not using...".You already know I disagree with this, I think AmxModX has the opportunity to improve here, and I don't think there would be a problem with 2 methods. But I know you aren't going to change your mind so no point arguing anymore, I'll just swear your name when I code the longest most ugly line of code ever seen using the old vexd style pev editing.

I noticed some things while glancing over the include files.

pvPrivateData, I noticed you are still using a default of +5 for linux, do you intend to add the option to change that? As I have mentioned before its not always +5 for every type of entity.

I can't see the keyvalue creation forward. Is that pfn_spawn(entid)?

For PLAYBACK_EVENT_FULL if you could add Floatrigin[3] = {0.0, 0.0, 0.0} etc. so that it can work like PLAYBACK_EVENT then that would be really handy.

Shouldn't these be engine functinos?
Code:
/* Returns the number of specified entities in map if value is 0
   otherwise it returns the index of the #th entity of that class. */
native ns_get_ent(classname[],Value);
/* Mirrors MAKE_STRING() */
native ns_make_string(svValue[]);
/* Mirrors STRING() */
native ns_string(iValue,svReturnedValue[]);
And ns_get_ent appears to be basically just find_ent_by_class() but with the option to find the number of values, perhaps you should just modify find_ent_by_class().

Can all engine forwards be blocked?
__________________
YO|Cheesy Peteza

[email protected]

CheesyPeteza is offline
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 05-26-2004 , 21:17  
#5

i thought you hated pev bailopan
__________________
QwertyAccess is offline
BAILOPAN
Join Date: Jan 2004
Old 05-26-2004 , 22:20  
#6

We can have a flamewar about pev() some other day

I will remove the engine string functions entirely because they're not needed.

DispatchKey is not forwarded yet, but I will do it for the final release. The only engine forward which can't be blocked is ServerFrame().

For pvPrivateData, I think +5 is a global offset no matter what. I changed it so it only adds 5 if it was on linux (before it subtracted 5 if it was on windows). I can change it to what mahnsawce does (that is a defaulted parameter).

What does playback_event_full look like?

Okay, I'll merge find_ent_by_class and ns_get_ent
__________________
egg
BAILOPAN is offline
CheesyPeteza
Senior Member
Join Date: Feb 2004
Location: UK
Old 05-27-2004 , 06:34  
#7

Quote:
Originally Posted by BAILOPAN
For pvPrivateData, I think +5 is a global offset no matter what. I changed it so it only adds 5 if it was on linux (before it subtracted 5 if it was on windows). I can change it to what mahnsawce does (that is a defaulted parameter).

What does playback_event_full look like?
Best to just quote the HL SDK Document about the events system:

Quote:
C. Playing back the Event ( Server side )

Playing back the Event:

The way to invoke an event from the game .dll is to invoke the PLAYBACK_EVENT or PLAYBACK_EVENT_FULL API macro or call. PLAYBACK_EVENT simply invokes PLAYBACK_EVENT_FULL with all default parameters:

#define PLAYBACK_EVENT( flags, who, index ) PLAYBACK_EVENT_FULL( flags, who, index, 0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0 );
For pvPrivateData in NS the buildings have a linux +3 offset. So please add Mahnsawce's method otherwise it makes life tricky.

Oh and Mahnsawce has written a really cool plugin that uses the DispatchKey forward "Capture The Gorge" so it'd be good if you do get it in for the final release, plus I have a plugin I'd like to do for CS using it.
__________________
YO|Cheesy Peteza

[email protected]

CheesyPeteza is offline
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 05-27-2004 , 19:31  
#8

whats DispatchKey?
__________________
QwertyAccess is offline
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 05-27-2004 , 19:55  
#9

Quote:
Originally Posted by QwertyAccess
whats DispatchKey?
Something we need
__________________
My Plugins

Got ??
AssKicR is offline
EKS
Veteran Member
Join Date: Mar 2004
Location: Norway
Old 05-27-2004 , 19:59  
#10

Quote:
Originally Posted by QwertyAccess
whats DispatchKey?
I personaly use it to crash DoD servers, but im sure it has a more usefull function to
EKS is offline
Closed Thread



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 08:54.


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