Raised This Month: $95 Target: $400
 23% 

BSP Compat - Make maps compatible with your mod


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   ConnorMcLeod (74)
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 02-10-2012 , 02:15   BSP Compat - Make maps compatible with your mod
Reply With Quote #1

Sometimes you want to play a map from other mods but that maps are unable to run correctly because it uses entities not available in your prefered mod.

This plugin will convert those entity types to a selected type available in the running mod.


With this plugin you can not only rename those entities, they will be created using the related class objects (ie: func_breakable = CBreakable)

Signatures for linux and windows included in zip file.

If anyone need another kind of patching for maps, just tell me in this post and I'll check how can be included into this plugin


Here's a useful example:

On TFC, spawn point entities is called info_player_teamspawn but in CS should be named info_player_start




Requirements
AmxModX
Orpheu

Cvars
bsp_classrename ( 1 | 0 )
If setting value to "1", entities will have it's classname renamed to the real classname.
Also EV_SZ_message (pev_message) will contain the original classname.

Config File


There's a file to setup entity renaming. This file is called bsp_compat.ini and should be inside amxmodx/configs folder.

The format is one line for each replacement and defined as
original-class-name:final-class-name
Known and unknown entities can be used as original-class-name


Custom Entity

GoldSrc Engine comes with a predefined "custom" classname for unknown entities. If gamedll defines it, it will be used as a replacement for unknown entities.

The provided config file comes with "custom" defined as "info_target" entity.
Attached Files
File Type: sma Get Plugin or Get Source (bsp_compat.sma - 1229 views - 2.3 KB)
File Type: ini bsp_compat.ini (22 Bytes, 362 views)
File Type: zip bsp_compat.zip (7.2 KB, 362 views)
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 02-12-2012 at 12:30.
joropito is offline
Send a message via MSN to joropito
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-10-2012 , 02:30   Re: BSP Compat - Make maps compatible with your mod
Reply With Quote #2

This is really nice !
So if we corretly fill the files, and if we don't disable forward in plugin_init, we can use create_entity with custom classes ?


Code:
while((iLine = read_file(szFile, iLine, szTemp, charsmax(szTemp), iLen)))
Cmon, use new file system lol !
__________________
- tired and retired -

Last edited by ConnorMcLeod; 02-10-2012 at 02:36.
ConnorMcLeod is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 02-10-2012 , 08:59   Re: BSP Compat - Make maps compatible with your mod
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
So if we corretly fill the files, and if we don't disable forward in plugin_init, we can use create_entity with custom classes ?
Not tested but as I'm hooking engine, should work like you say.


Quote:
Originally Posted by ConnorMcLeod View Post
Cmon, use new file system lol !
Is there a new file system functions? It's about 10 months without coding in pawn for me



EDIT: Confirmed, CreateNamedEntity uses GetEntityInit so yes, enabling the forward will work as you say.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 02-10-2012 at 09:02.
joropito is offline
Send a message via MSN to joropito
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-10-2012 , 10:43   Re: BSP Compat - Make maps compatible with your mod
Reply With Quote #4

He's talking about fopen, fgets, etc. http://www.amxmodx.org/funcwiki.php?go=inc&id=3
__________________
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 02-10-2012 , 10:54   Re: BSP Compat - Make maps compatible with your mod
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
He's talking about fopen, fgets, etc. http://www.amxmodx.org/funcwiki.php?go=inc&id=3
Too much code for something too simple
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 02-10-2012 , 11:58   Re: BSP Compat - Make maps compatible with your mod
Reply With Quote #6

Holy Shit.

i'm working on a CS server with HL maps right now and it constantly crashes for unknown reasons (sometimes mod related).

i'll test this right away when i go home.

Last edited by XINLEI; 02-10-2012 at 11:58.
XINLEI is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-10-2012 , 14:04   Re: BSP Compat - Make maps compatible with your mod
Reply With Quote #7

Quote:
Originally Posted by joropito View Post
Too much code for something too simple
Not really, use fopen 1 time, then read all lines, then use fclose 1 time, it's faster that looping read_file.
__________________
- tired and retired -
ConnorMcLeod is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 02-10-2012 , 16:01   Re: BSP Compat - Make maps compatible with your mod
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
Not really, use fopen 1 time, then read all lines, then use fclose 1 time, it's faster that looping read_file.
I know that but this is done once at precache. I just prefer not dealing with low level IO for this plugin.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 02-10-2012 , 20:24   Re: BSP Compat - Make maps compatible with your mod
Reply With Quote #9

Well i'm testing this plugin and i don't understand it very well.

This plugin replaces half_life entity functions to these Csfunctions?
if it is, then this plugin is not working (or i'm doing wrong something)

I've tested this map:
http://twhl.info/vault.php?map=3896 xdm_crossfire

-Go to the helipad zone (if you don't know this map, Go where the green zone is. Showed in the screenshot.)
-At the right side of that area you'll see a somewhat tower.
-Turn around
-Go lower and you'll see a loader with a box.
-If you break that box the server/game crashes.

This is what i've written in the .ini file:
Quote:
custom:info_target // perhaps this is the responsible of the error logs.

weapon_crossbow:CAWP // Failure to spawn weapons here.
weapon_9mmAR:CAK47
weapon_357:CDEAGLE

light:CLight
light_spot:CLight

func_breakable:CBreakable
In console i can see that these functions are replaced, but it still crashes when i change func_breakable to CBreakable.

Quote:
L 02/10/2012 - 18:56:04: Start of error session.
L 02/10/2012 - 18:56:04: Info (map "XDM_crossfire") (file "addons/amxmodx/logs/error_20120210.log")
L 02/10/2012 - 18:56:04: [ORPHEU] Function "GetEntityInit" not found
L 02/10/2012 - 18:56:04: [AMXX] Displaying debug trace (plugin "bsp_compat.amxx")
L 02/10/2012 - 18:56:04: [AMXX] Run time error 10: native error (native "OrpheuGetFunction")
L 02/10/2012 - 18:56:04: [AMXX] [0] bsp_compat.sma::plugin_precache (line 76)
I've not tested with other entities though, but it's not the map's fault. i've played this map in half life, online and i never got problems.

Cheers.
XINLEI is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 02-10-2012 , 22:30   Re: BSP Compat - Make maps compatible with your mod
Reply With Quote #10

First of all, you have problem with your signatures.

Check the supplied file is installed in configs/orpheu/functions/GetEntityInit
Also post here your engine version

Second, you can't use names like CAK47, the correct entity classname is weapon_ak47 (the same names as you use in create_entity() function in any plugin).

You only need to replace entities that are not available in CS (also you can replace any entities you want: weapon_ak47:weapon_deagle)
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Reply


Thread Tools
Display Modes

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 14:23.


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