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

[CS:GO] Replace entity properties similar to Stripper:Source


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
d1rTyS
Junior Member
Join Date: Dec 2015
Old 03-02-2016 , 23:48   [CS:GO] Replace entity properties similar to Stripper:Source
Reply With Quote #1

Hello,

is it possible to convert entities by classname to another entity?

Let's say i have trigger_multiple on a map and i want them to be a trigger_teleport and i want to remove any "OnStartTouch" inputs is there any way to achieve this with sourcemod?

Stripper:Source cfg file would look like this:

Code:
modify:
{
    match:
    {    
        "classname" "trigger_multiple"
    }
    replace:
    {
        "classname" "trigger_teleport"
    }
    delete:
    {
        "OnStartTouch" "/.*/"
    }
}
Also i would like to edit a KeyValue in this context.
So assuming we have a trigger_push i'd like to modify its speed to speed = speed * 1337.

Is this a thing that can be done with Stripper:Source?

Code:
modify:
{
    match:
    {    
        "classname" "trigger_push"
        "speed" "/(.*)/"
    }
    replace:
    {
        "speed" "/($1)*1337/"
    }
}
I know this abomination above isn't possible.

Any help is very much appreciated!

Last edited by d1rTyS; 03-03-2016 at 00:06.
d1rTyS is offline
Phil25
AlliedModders Donor
Join Date: Feb 2015
Old 03-03-2016 , 00:06   Re: [CS:GO] Replace entity properties similar to Stripper:Source
Reply With Quote #2

I've never seen anyone replace entity classname and have never tried it myself, but if you'd like to have something teleported via tigger_multiple you can simply hook OnStartTouch and teleport entities yourself.

As for deleting inputs and outputs you can rename entities to break their connections. I don't know if there's a way of removing individual ones.
Phil25 is offline
d1rTyS
Junior Member
Join Date: Dec 2015
Old 03-03-2016 , 00:15   Re: [CS:GO] Replace entity properties similar to Stripper:Source
Reply With Quote #3

This is just an example to clarify what i actually want to achieve.

I'm using Stripper:Source to convert info_player_teamspawn with the according teamnum to info_player_terrorist or info_player_counterterrorist to get the spawns from TF2 maps to work successfully.

What i would like to achieve is to dynamically change some float value like "speed" from trigger_push.

Thanks for the quick reply though!

Last edited by d1rTyS; 03-03-2016 at 00:17.
d1rTyS is offline
Phil25
AlliedModders Donor
Join Date: Feb 2015
Old 03-03-2016 , 00:39   Re: [CS:GO] Replace entity properties similar to Stripper:Source
Reply With Quote #4

Oh, well, that's less complicated then :p

You'd want to fetch that entity's index somehow then fire a SetEntProp* on it. Read through datamaps of trigger_push and find the correct property, which I believe is "m_flSpeed". You can find all the datamaps by executing "sm_dump_datamaps datamaps.txt", this will create datamaps.txt in the server's tf/ folder containing the dump.

So, here's the untested code:
PHP Code:
SetEntPropFloat(TriggerPushEntityIndexProp_Data"m_flSpeed"1337.0); 
Phil25 is offline
d1rTyS
Junior Member
Join Date: Dec 2015
Old 03-03-2016 , 01:00   Re: [CS:GO] Replace entity properties similar to Stripper:Source
Reply With Quote #5

Uhhm yeah that reply defintely applies to my last sentence of my most recent post

Thank you very much for your reply though!

I'm sorry if i was unclear about this but this is what I catually want to get to work:

Since we all know hat trigger_push is pretty laggy in csgo i discovered that trigger_gravity provides the same functionality but with a lag free prediction.

What i really want to do is:

1. find all trigger_push (FindEtiityByClassname())
2. get all entities which "pushdir" is "-90 0 0"
3. convert the entity to a trigger_gravity
4. add the property "gravity" which is dependent on the "speed" you get from the trigger_push
5. remove properties like "speed, pushdir, and alternatetickfix"

Last edited by d1rTyS; 03-03-2016 at 01:12.
d1rTyS is offline
Jackol1234
Senior Member
Join Date: Apr 2015
Old 03-03-2016 , 01:10   Re: [CS:GO] Replace entity properties similar to Stripper:Source
Reply With Quote #6

If you're looking for something to fix trigger_push, blaacky released a pushfix that works great. Here is the topic https://forums.alliedmods.net/showthread.php?t=267131
Jackol1234 is offline
d1rTyS
Junior Member
Join Date: Dec 2015
Old 03-03-2016 , 01:34   Re: [CS:GO] Replace entity properties similar to Stripper:Source
Reply With Quote #7

Quote:
Originally Posted by Jackol1234 View Post
If you're looking for something to fix trigger_push, blaacky released a pushfix that works great. Here is the topic https://forums.alliedmods.net/showthread.php?t=267131
Thx dude this is solved. Only "pushfix" i found regarding this was something that teleports you up a couple of units!

But yea just for the sake of curiosity, how would you modify ents like you can with Stripper:Source in sourcemod?

I give you an example surf_crzyfrog_reloaded uses trigger_gravity to set your gravity. But in CSGO once you leave this trigger_gravity your gravity will get set to 1 (in my understanding this is sv_gravity's value which defauts to 800). I converted these zones into a trigger_multiple with a OnStartTouch output that sets !activator's gravity to the desired value using Stripper.

Is converting a trigger_gravity to a trigger_multiple and adding In- and Outputs possible in sourcemod? And if, how?

Agian thank you very much for you replies!

Last edited by d1rTyS; 03-03-2016 at 02:11.
d1rTyS is offline
Jackol1234
Senior Member
Join Date: Apr 2015
Old 03-03-2016 , 02:07   Re: [CS:GO] Replace entity properties similar to Stripper:Source
Reply With Quote #8

No problem, man. I was trying to figure out the same thing about crzyfrog, actually. If you find out tell me!

Edit: If you're wondering about adding inputs and outputs you can use the stripper modify commands "insert" and "replace" for that.

Last edited by Jackol1234; 03-03-2016 at 02:09. Reason: Added some stuff.
Jackol1234 is offline
d1rTyS
Junior Member
Join Date: Dec 2015
Old 03-03-2016 , 02:16   Re: [CS:GO] Replace entity properties similar to Stripper:Source
Reply With Quote #9

Sure that is exactly what i did

Here have the imporant lines of my surf_crzyfrog_reloaded.cfg file (hope this helps):

Code:
modify:
{
    match:
    {
        "gravity" "1"
        "classname" "trigger_gravity"
    }
    
    replace:
    {
        "classname" "trigger_multiple"
    }
    
    insert:
    {
        "wait" "1"
        "OnStartTouch" "!activator,AddOutput,gravity 1,0,-1"
    }
    
    delete:
    {
        "gravity" "1"
    }
}

{
    match:
    {
        "gravity" "-1"
        "classname" "trigger_gravity"
    }
    
    replace:
    {
        "classname" "trigger_multiple"
    }
    
    insert:
    {
        "wait" "1"
        "OnStartTouch" "!activator,AddOutput,gravity -1,0,-1"
    }
    
    delete:
    {
        "gravity" "-1"
    }
}
Also i know how to add In- and Outputs to certain entites with Stripper.

But still i'm interested in a way to achieve similar results using sourcemod!

Again thank you for all your help!

Last edited by d1rTyS; 03-03-2016 at 02:44.
d1rTyS is offline
Reply



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 02:01.


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