several generic source events

Discussion in 'Support' started by skulk_on_dope, Jan 28, 2008.

  1. skulk_on_dope

    skulk_on_dope Member

    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    that's not the big problem u can get these stuff via the netclass

    It would be cool to have the vehicle build stuff and also the research_start/complete...
    the vehicle_spawned should provide the team, the vehicle entity and who build it.

    The research_complete should return the researched item (enum table or string) and the teamid.

    more interesting for me is when a mine explodes or when it be crated, information needed is the owner of the mine and maybe the mine itself (entid)

    and the player_class event like it is in original, userid and the class.
    should also be called when someone goes commander
     
  2. Solokiller

    Solokiller Member

    Messages:
    4,861
    Likes Received:
    7
    Trophy Points:
    0
    The vehicle entity is, as far as i know, emp_vehicle all the time.
     
  3. skulk_on_dope

    skulk_on_dope Member

    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    but not the id of it... the classname and the entity id are different

    the id is to identify the actual entity
     
  4. [SEk2000]Blackhawk

    [SEk2000]Blackhawk Member

    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    0
    Hmm, i think the following event types would be nice

    player_changeclass
    {
    <playerid>
    <old class>
    <new class>
    }
    called whenever a player changes his class + when a commander enters/lefts the CV. Also called on disconnects. Would be very nice if that event could be blocked (so let's say a known griefer can't enter the CV anymore)

    player_createentity
    {
    <playerid>
    <entitiy id>
    <entity type>
    }
    called when someone creates an entitiy, whatever it is (from a Mine to a grenade, a wall, a turret, a building....)
    Also would be nice if event could be blocked.

    research_complete
    {
    <Team ID>
    <reseached item>
    }

    vehicle_spawned
    {
    <Team ID>
    <Player ID>
    <Entity ID>
    <class type>
    }
    where class type means something like APC,Light_Tank etc...
    Also blockable would be nice(no more 20 Jeeps for that guy...)

    and maybe

    AI_Weaponfire
    {
    <Entity ID>
    <Target Entity ID>
    <Weapon type>
    }
    called whenever an AI weapons fires. I think this should be called by turrets and mines on detonation.

    Skulk, we should also check this against our developer board.
     
  5. Reef

    Reef Member

    Messages:
    795
    Likes Received:
    0
    Trophy Points:
    0
    This one should be splitted to minors like createmine, createshell, creategranade or something... (why would anyone want to check any of those?) createwall, createturret, createmine, createammobox, createbuilding (that's commanders) - I understand, it's usefull for anti-griefer plugins, but
    others?
    Catching every entity spawned by player would impact performance, it's really better to split it. Also, angle of a mine doesn't matter, but angle of building matters, all 3 angles of turrets too. Walls need a start and an end xyz. All those need coordinates.

    Blockable events are very cool, lots of cool scripts could be made as Blackhawk suggested.
     
  6. skulk_on_dope

    skulk_on_dope Member

    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    a quick answer if your doing it would be nice
     
  7. recon

    recon SM Support Dev

    Messages:
    2,348
    Likes Received:
    0
    Trophy Points:
    0
    I'm planning on writing an ATB for Empires, so... When are these events going to be available? Espically the commander event... It'd make my job a lot easier if you included a read only CVAR that has the client index of the current commander of each team :)
     
    Last edited: Feb 23, 2008
  8. skulk_on_dope

    skulk_on_dope Member

    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    I've allready got it how to get the active commander:
    Code:
    stock g_CPlayerResourceEntity;
    stock g_CPlayerResourceProp_bComm;
    
    stock empires_OnMapStart()
    {
    	new maxents = GetMaxEntities();
    	new maxplayers = GetMaxClients();
    	decl String:classname[64];
    	
    	for(new i=maxplayers; i <= maxents; i++)
    	{
    		if(IsValidEntity(i))
    		{
    			GetEntityNetClass(i, classname, sizeof(classname));
    			if(StrEqual(classname, "CPlayerResource"))
    			{
    				g_CPlayerResourceEntity = i;
    				break;
    			}
    		}
    	}
    	
    	g_CPlayerResourceProp_bComm  = FindSendPropOffs("CPlayerResource", "m_bCommander");
    	
    	if(g_CPlayerResourceEntity == 0 || g_CPlayerResourceProp_bComm == -1)
    	{
    		ThrowError("[FATAL] Can not find CPlayerResource!");
    	}
    }
    
    stock bool:emp_IsCommander(client)
    {
    	return bool:GetEntData(g_CPlayerResourceEntity, g_CPlayerResourceProp_bComm + (client * 4), 1);
    }
    
    stock emp_GetCommander(team)
    {
    	new maxplayers = GetMaxClients();
    	
    	for(new i=1; i <= maxplayers; i++)
    	{
    		if(IsClientInGame(i))
    		{
    			if(team == GetClientTeam(i))
    			{
    				if(emp_IsCommander(i))
    				{
    					return i;
    				}
    			}
    		}
    	}
    	
    	return 0;
    }
    empires_OnMapStart must be called on mapstart
    the other two functions should be self explaining
     
  9. Cyber-Kun

    Cyber-Kun Member

    Messages:
    1,200
    Likes Received:
    0
    Trophy Points:
    0
    Well the map commands I would want are.
    Tell what weapon has been fired and the option to make the weapon explode faster. AKA Forcing mines to blow up to simulate C4 to doors without the need for 9 mines.
    What class are the players.
    Make a tank/APC/jeep with the ability to customize the thing, even giving it more armor than it could normally hold. AKA, Escape from the mountains with a jeep, but give the jeep 3 layers of composite armor on each side.
     
  10. Solokiller

    Solokiller Member

    Messages:
    4,861
    Likes Received:
    7
    Trophy Points:
    0
    You're talking about putting vehicles in a map and loading a custom script file for it, which is much easier than setting up the properties for it in hammer.
     
  11. recon

    recon SM Support Dev

    Messages:
    2,348
    Likes Received:
    0
    Trophy Points:
    0
    Thanks for posting your code. I've posted it over on the SourceMod forums, MistaGee is going to get his ATB to support Empires :D :D :D
     
  12. skulk_on_dope

    skulk_on_dope Member

    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    ive got more if u want to have it
     
  13. [SEk2000]Blackhawk

    [SEk2000]Blackhawk Member

    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    0
    The whole thing gets a little bit....boring.
    We are sitting here with nothing to do because there are no possible solutions for now to modify the server the way we need it. I know that implementing something costs time, but on the other side we are developer and programmers too and can't move forward for over a month now. No information on the status of our request. However, i think we are going to drop empires as project until the prerequisites we need are available. If that happens, we see if and how we continue.

    As there are plenty of empty servers, i don't think there will be an impact.
     
  14. Jcw87

    Jcw87 Member

    Messages:
    1,676
    Likes Received:
    0
    Trophy Points:
    0
    Krenzo is busy moving Empires to the Orange Box source engine, and is probably too busy to come back to this thread. If you bring this up after it is released (or at least when the playtesting for the new version begins), then you will have a better chance of getting your events in.
     
  15. Reef

    Reef Member

    Messages:
    795
    Likes Received:
    0
    Trophy Points:
    0
    commander_ejected ("commander's steamid or clientid or whatever", "how many votes have been cast against him")
    commander_eject_vote ("who voted")
    and a blockable event "player_started_comanding".

    Antigriefer plugins would be SO easy to code with this events.
     
  16. Jcw87

    Jcw87 Member

    Messages:
    1,676
    Likes Received:
    0
    Trophy Points:
    0
    Might be a good idea to fix a critical bug in the vote system first. I've gotten voted out before right after someone else was voted out and I got in. I think the person who got voted out casted a vote to get me out, and everyones vote against him counted toward me.
     
  17. Reef

    Reef Member

    Messages:
    795
    Likes Received:
    0
    Trophy Points:
    0
    I am already on it, see this topic.

    Another events that we might need would be "research_started" (team, time_it_will_take, text description like "Mechanical Engineering") and "research_canceled" (team).

    This will allow to write a plugin that would display a panel with research history and estimates when user says "!research".
    No more "commander what are You researching?", "what is the time to the closest research?", "do we have XXX researched?".
    Without this, experienced players have advantage (they - unlike noobs - memorized the research tree and research times). Afaik We are trying to fix the learning curve, this one little event could easily help doing that.

    It can be also used to write plugins that would rate commanders by their researches (and We can check if they won the games), so they could be recommended by the plugin. I am angry at situations where (on a big, filled server) the whole team votes a guy with a tag on commander and then he is like "how do I place buildings?").
     

Share This Page