Raised This Month: $ Target: $400
 0% 

[REQ] Engineer ability to build on moving objects (TF2)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
teddyruxpin
Overseer of lost packets
Join Date: Feb 2008
Old 02-22-2008 , 17:45   [REQ] Engineer ability to build on moving objects (TF2)
Reply With Quote #1

Hello,

I would like to have a plugin where my players can build on moving objects. IE they can build on the moving cars etc in Mario_Kart map or on the mining carts in other maps.

I have seen this done on other hosts so I know its possible but I lack the skill to write the plug-ins myself. The wording from the other site said it like this.

# Quote from 3-PG Forums
Engineer Buildings now have the ability to Parent with moving entities. If you can build on an elevator or moving car then it will move with it.


These other features would also be very helpful.

Engineer
Upgrade Per Hit 200 | Default 25 How much metal to use when a engineer tries to upgrade a Sentry Gun.

Sentry Gun
Ammocheat 1 | Default 0 Turrets have unlimited ammo. No need for engineer to restock.
Damage 32 | Default 16 The damage a Sentry Gun does.
Newtarget Dist 999


Credits to Wozer from 3-PG for building these on his servers. I just wish they would share the code. This is my first post on these forums so if this in the wrong area please move the post.

Thanks,

Teddy
teddyruxpin is offline
teddyruxpin
Overseer of lost packets
Join Date: Feb 2008
Old 03-02-2008 , 04:46   Re: [REQ] Engineer ability to build on moving objects (TF2)
Reply With Quote #2

I am willing to pay for this mod. Please contact me.

Thanks,

Jeremy
teddyruxpin is offline
Tyler_durden (gsr)
Junior Member
Join Date: Apr 2005
Old 03-02-2008 , 08:38   Re: [REQ] Engineer ability to build on moving objects (TF2)
Reply With Quote #3

Well i don't know if anyone would be accepting your money. But thats definitely a good idea.
Also , is it possible to increase the lvl of the turret to 10
i.e Add more health more damage and a protective radius to prevent spy from sapping the turret?
__________________
IM on xooit.xooit.com
Tyler_durden (gsr) is offline
Send a message via MSN to Tyler_durden (gsr)
SixSicSix
Senior Member
Join Date: Jan 2008
Old 03-02-2008 , 16:47   Re: [REQ] Engineer ability to build on moving objects (TF2)
Reply With Quote #4

3-pg has a history of destroying the mod community by being stingy with their code.
SixSicSix is offline
teddyruxpin
Overseer of lost packets
Join Date: Feb 2008
Old 03-02-2008 , 16:50   Re: [REQ] Engineer ability to build on moving objects (TF2)
Reply With Quote #5

I can either pay cash, amazon giftlist purchase or provide a complete linux or windows dedicated server for a few months to whoever builds this mod.

Thanks,



Jeremy

Last edited by teddyruxpin; 03-02-2008 at 16:55.
teddyruxpin is offline
WoZeR
Donor
Join Date: Nov 2007
Old 03-09-2008 , 23:14   Re: [REQ] Engineer ability to build on moving objects (TF2)
Reply With Quote #6

Quote:
Originally Posted by SixSicSix View Post
3-pg has a history of destroying the mod community by being stingy with their code.
You are so right. I'm so stingy and I'm destroying the mod community. Oh yeah here is the code to parenting that I posted on another thread showing how to do it.

http://forums.alliedmods.net/showpos...3&postcount=19

Also here is everything I have figured out on my own with the TF2 server.dll

http://www.3-pg.com/forums/index.php?showtopic=702

and here is some info getting sourcemod up and running and coding your first plugin.

http://www.3-pg.com/forums/index.php?showtopic=987

Also don't forget to post your apology below kthx.
WoZeR is offline
teddyruxpin
Overseer of lost packets
Join Date: Feb 2008
Old 03-11-2008 , 08:03   Re: [REQ] Engineer ability to build on moving objects (TF2)
Reply With Quote #7

Quote:
Originally Posted by WoZeR View Post
You are so right. I'm so stingy and I'm destroying the mod community. Oh yeah here is the code to parenting that I posted on another thread showing how to do it.

http://forums.alliedmods.net/showpos...3&postcount=19

Also here is everything I have figured out on my own with the TF2 server.dll

http://www.3-pg.com/forums/index.php?showtopic=702

and here is some info getting sourcemod up and running and coding your first plugin.

http://www.3-pg.com/forums/index.php?showtopic=987

Also don't forget to post your apology below kthx.
WoZeR,

Thanks for the information. I did review some of those links that where sticked in your forums in the past and was not aware of some of the other examples you had online. I have been trying to get this working myself all night and so far have it setup to attach a SG to the engie who creates it and it will stick to them until they die and then re-attach at death. I believe this is because of the "SetParent" is setup to use the same settings as the 'Parachute' example.

Would you be able to assist me with being able to set this to build where ever the engie has the blue prints pointed or atleast point me in the right direction with some examples as I am kinda lost at this point. This is my very first attempts at plugins or scripts so please do not laugh to hard if its completely ass backwards.

Code:
#include <sourcemod>
#include <sdktools>
#include <events>
#include <clients> 
  
  #define PLUGIN_VERSION "1.0.0"
  
  // Plugin definitions
  public Plugin:myinfo =
  {
      name = "Set Sentry Parent",
      author = "Your name here",
      description = "What the plugin does",
      version = PLUGIN_VERSION,
      url = "http://www.yourwebsite.com"
}


public OnPluginStart()
   {
       HookEvent("player_builtobject", Event_player_builtobject)
   }

    
       public Action:Event_player_builtobject(Handle:event, const String:name[], bool:dontBroadcast)
   {
    new sentrygun_index
    sentrygun_index = FindEntityByClassname(-1, "obj_sentrygun") //Find the sentry gun entity index starting at 0    


    new client
    client = GetClientOfUserId(GetEventInt(event,"userid")) //Using a hook event get the UserID of the player that triggered
           
    new String:strTargetName[64]
    IntToString(client, strTargetName, 64)

    DispatchKeyValue(client, "targetname", strTargetName)

    SetVariantString(strTargetName)
    AcceptEntityInput(sentrygun_index, "SetParent", -1, -1, -0)
    return Plugin_Continue
   }

  public OnMapStart()
  {
  
  }
I did try modifying the '-1, -1, -0' to various other strings of 1's and 0's and it appears to change the location of the mount on the players body which is neat since I can now have engie walking around with SG's attached at knee height. (Correct me if I am wrong here please)


-Jeremy
teddyruxpin is offline
SixSicSix
Senior Member
Join Date: Jan 2008
Old 03-11-2008 , 09:33   Re: [REQ] Engineer ability to build on moving objects (TF2)
Reply With Quote #8

Sorry, WoZeR, but I was referring to the more complex code your servers use for your mods.
SixSicSix is offline
WoZeR
Donor
Join Date: Nov 2007
Old 03-11-2008 , 13:57   Re: [REQ] Engineer ability to build on moving objects (TF2)
Reply With Quote #9

Try the following.

Code:
public Action:Event_player_builtobject(Handle:event, const String:name[], bool:dontBroadcast)
{
    new strClassName[64]
    new MaxEntities = GetEntityCount()
    new Float:vecObjectPos[3]
    new Float:vecCheckBelow[3]
    
    for (new i=1;i <= MaxEntities; i++)
    {
        if (IsValidEntity(i))
        {
            GetEntityNetClass(i, String:strClassName, 64)
            if (strcmp(String:strClassName, "CObjectSentrygun", true) == 0 || strcmp(String:strClassName, "CObjectDispenser", true) == 0 || strcmp(String:strClassName, "CObjectTeleporter", true) == 0)
            {
                //Get the object's position
                GetEntDataVector(i, FindSendPropInfo("CPhysicsProp", "m_vecOrigin"), vecObjectPos)
                
                //Check below the object for an existing entity to parent to
                vecCheckBelow[0] = vecObjectPos[0]
                vecCheckBelow[1] = vecObjectPos[1]
                vecCheckBelow[2] = vecObjectPos[2] - 50.0
                
                //Check for colliding entities
                TR_TraceRayFilter(vecObjectPos, vecCheckBelow, MASK_PLAYERSOLID, RayType_EndPoint, TraceRayDontHitSelf, i)

                if (TR_DidHit(INVALID_HANDLE))
                {
                    new TRIndex = TR_GetEntityIndex(INVALID_HANDLE)
                    if (TRIndex > 32) //Don't attach to players
                    {
                        //This part can be redone since BAILOPIN added the ability to read a string_t
                        new String:strTargetName[64]
                        IntToString(TRIndex, strTargetName, 64)
                    
                        DispatchKeyValue(TRIndex, "targetname", strTargetName)
                        
                        SetVariantString(strTargetName)
                        AcceptEntityInput(i, "SetParent", -1, -1, 0)

                        //PrintToServer("Setting MoveParent TRIndex %i", TRIndex)
                    }
                }
            }
        }
    }
    
    return Plugin_Continue
}

public bool:TraceRayDontHitSelf(entity, mask, any:data)
{
    if(entity == data) // Check if the TraceRay hit the owning entity.
    {
        return false // Don't let the entity be hit
    }
    
    return true // It didn't hit itself
}
WoZeR is offline
teddyruxpin
Overseer of lost packets
Join Date: Feb 2008
Old 03-11-2008 , 18:20   Re: [REQ] Engineer ability to build on moving objects (TF2)
Reply With Quote #10

WoZeR,

EDIT: I got it working . Was missing a couple lines I did not see prior but where in your other examples.

Thanks,

Jeremy

Last edited by teddyruxpin; 03-11-2008 at 18:49.
teddyruxpin 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 00:27.


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