Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Entity Extension v1.1
#1
The 'Entity Extension' library, is a library to extend the features of the MW3 Server Addon API which allows the ability to spawn entities. This plugin will be a 'temporary' until @Nukem decides to add this natively into the Addon API (that is, if he decides to).

How do I use this?
Simply download and extract the ZIP and add the DLL as a reference in your plugin, it uses the Addon namespace just like the original Addon so it integrates very nicely. Make sure to put the DLL along with your own plugin in the plugins folder, this is important!

How do I spawn an entity?
To spawn an entity, you use the Entity.Create method, which returns a new Entity object. The constructor for the Entity.Create method is as follows:
string className - This is the classname of the entity. Valid classnames can be found here. The most common one would be script_model.
string modelName - Obviously, as the name suggests, this is the name of the model that the entity will have when it's spawned. Make sure that the model is precache/loaded into the map by default otherwise it won't appear.
Vector origin - This is the origin of where the entity will appear when it's created.

What properties do I have access to?
The Entity class currently exposes the current properties:
float[] Angles - The angles of the entity, index 0 being the X axis and index 1 being the Y axis. (Angles[0] == X axis and Angles[1] == Y axis).
int EntityNum - The entity's index/number, I recommend you don't play around with this. Tongue
string HeadModelName - The entity's head model, I'm not sure this will work unless they are a player, note that this property can only be set.
string ModelName - The entity's model, note again that this can only be set as only a model ID is stored in the entity's struct in memory.
Vector Origin - The origin/location of the entity.
Vector ViewOrigin - The view origin of the entity.

Changes:
v1.1:
- Added support for 1.7.413

Credits:
@Nukem - Providing code examples/snippets in C++.
master131 - Converting all the examples into C# including the inline asm (which was a bitch to do but perfectly possible).


Attached Files
.zip   Entity Extension v1.1.zip (Size: 5.06 KB / Downloads: 83)
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply

#2
Nice release. But it's pretty stupid you obfuscated it, IMO. There are loads of people who can actually learn from it as well.
[Image: MaEIQ.png]
Reply

#3
If there's enough demand, perhaps I'll upload an unobfuscated version, I haven't even consulted with @Nukem about this yet, I'm not sure he want's me to expose how it works.

EDIT - Turns out I uploaded the unobfuscated version by accident, oh wells, go wild.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply

#4
Also, "Vector ModelName - " Shouldn't that be String?
[Image: MaEIQ.png]
Reply

#5
I would be interested in soure code though I disagree with @Pozzuh that "loads" of people will learn from it as most people won't understand it. Of course it's your decision.

Anyway @master131 awesome job. Is it possible to rotate the model (Pitch, Roll, Yaw)?
[Image: azuw.jpg]
Reply

#6
(04-30-2012, 12:41)zxz0O0 Wrote: I would be interested in soure code though I disagree with @Pozzuh that "loads" of people will learn from it as most people won't understand it. Of course it's your decision.

Maybe not loads but a few at least.
[Image: MaEIQ.png]
Reply

#7
I've fixed the string thingies, and if you read my post edit, I accidentally uploaded the unobfuscated one. Doesn't matter anymore anyway.. @zxz0O0 Yes, I think you can, through the ViewOrigin property which I forgot to expose, I'll do it later.

EDIT - Done.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply

#8
OMA Nice release Nyan Cat
Reply

#9
(04-30-2012, 12:44)master131 Wrote: @zxz0O0 Yes, I think you can, through the ViewOrigin property which I forgot to expose, I'll do it later.
Well I mean to do one by one. Like:
RotatePitch( <pitch angle>, <time> );
RotateRoll( <roll angle>, <time> );
RotateYaw( <yaw angle>, <time> );
[Image: azuw.jpg]
Reply

#10
Very nice @master131 , and i desagree with @Pozzuh , he gives the source if he wants to.

If you are not happy, well i dont care, make your own addon them...

Thanks Barata...
Don't worry if things aren't the way you planned, in the end everything will solve itself...
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] 8Q's Server Addon Extension 8q4s8 5 5,277 07-10-2013, 15:56
Last Post: Hallla
Rainbow Help Spawn entity, add collision etc help Lemon 13 7,037 07-21-2011, 18:00
Last Post: Lemon
  create entity to use with createCarryObject() iAegle 2 2,248 02-27-2011, 19:16
Last Post: iAegle

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.