AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   Creating/spawning entities and props (https://forums.alliedmods.net/showthread.php?t=39235)

imported_IJs 10-30-2005 06:57

Creating/spawning entities and props
 
Well I managed to spawn and create various prop and normal entities.

The target system's Linux, some of you already know why.

Here's the complete guide:
http://devwiki.lame-cs.nl/index.php/...2_%28Server%29

And here's a demonstration video:
http://www.lame-cs.nl/dell_attempt_1.avi

Have fun :)

BAILOPAN 10-30-2005 08:37

Interesting, it's a nice article in its own right for showing some details about entities (I don't really know too much about the HL2 with regards to the "enginey" stuff).

However, I'd like to make a few points. I assume what you're talking about is the fact that Linux binaries have lazy loading. For those who don't know, on Linux, symbols can be resolved at runtime rather than at compile time. In Windows the import table must have a known mapping at compile time. The laziest Windows gets in this regard is that DLLs can have .lib files, which allows no mapping at compile time, and at run time Windows will try to load the corresponding DLL to resolve the imports (which will fail if the imports or DLL are not found).

In my opinion, Linux dynamic linking is a hack, and one that causes many problems. Ultimately in this scenario it means you're relying on the fact that the symbol table is completely intact; something Valve could easily change. The fact that Linux will randomly attach one library's import to another library's completely unrelated but exposed symbol is nightmarish.

A more cross-platform compatible approach would be to do signature/byte pattern scanning, like NemoD does. Granted, it's a lot more work, but it's almost fail-safe.

Lastly, I would write that GCC-3.4 be required as a minimum. They're not ABI compatible and I've had plugins crash because they mismatch with SourceMM's compiled version.

If it does indeed segfault, I would throw it in a debugger. Because the symbol table is intact on Linux builds, you might be able to see why.

(BTW! - God forbid if a mod ever deviate from the base SDK. This sort of thing would surely fall to pieces, which is quite unfortunate from independent modders' point of view).

imported_IJs 10-30-2005 09:45

Thanks for the comments.

I agree not everything is 100% accurate.

As far as I know it's segfaulting after a while, but at the time I thought it was more important to document the whole thing instead of fixing problems.

Heh, I might as well add a disclaimer on top :P

Remember it's a wiki so you can add/change whatever you want.

L. Duke 10-30-2005 11:43

I was creating phys props with by sigscanning for CreateEntityByName(), but they never responded properly when shot. I think I missed a couple of the VPHYSICS functions I should have used.

I'll check out your code and see what I missed. Thanks for posting the info.

imported_IJs 10-30-2005 13:47

Make sure you create them as prop_physics_multiplayer, and link the entity to the CBreakableProp class.

za_bullet 11-24-2005 06:05

Anyone got a tutorial one how to get this done on Windows?

D.


All times are GMT -4. The time now is 13:26.

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