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

[Alien Swarm] Finding current equipped weapon name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
comp_noob
Senior Member
Join Date: Nov 2010
Old 11-28-2010 , 12:00   [Alien Swarm] Finding current equipped weapon name
Reply With Quote #1

hi, i tried to make a plugin for the game, but encountered errors while getting the weapon index for the weapon in slot x by using GetPlayerWeaponSlot()... it replied with this: [SM] Native "GetPlayerWeaponSlot" reported: "Weapon_GetSlot" not supported by this mod. is there an alternate way which i could do so?
comp_noob is offline
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 11-28-2010 , 15:36   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #2

I believe alien swarm should be fully supported as of 1.3.5 try downloading a new snapshot.
__________________
McFlurry is offline
Send a message via Skype™ to McFlurry
comp_noob
Senior Member
Join Date: Nov 2010
Old 11-28-2010 , 19:31   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #3

the sourcemod that i am using now is 1.4 beta snapshot... and it said that it is not supported... and i noticed a few other things about alien swarm, panels and menus are not supported, it says vgui is missing... and coloured text too, all the text appear same colour(yellow) although i formatted them to be different...
comp_noob is offline
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 11-28-2010 , 19:46   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #4

Hmm, well most of sourcemod should be working though I've only worked with hooked events so for on alien swarm.
__________________
McFlurry is offline
Send a message via Skype™ to McFlurry
comp_noob
Senior Member
Join Date: Nov 2010
Old 11-28-2010 , 19:58   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #5

so there isn't any way to actually get the currently equipped weapon on the marine? i've seen from some other pages that there is a GetMarine() to get the actual controlled marine by the player, because the player isn't moving at all.. as taken from here:
From the Valve Wiki:
"Unlike most Source engine games, the player in Alien Swarm is an invisible
commander entity. It does not move. If the player is currently controlling a
marine, then calling the GetMarine() method on the player will return it."
But then, is there a full list of the new scripting api reference of alien swarm available? there seems to be some commands that are new...
comp_noob is offline
comp_noob
Senior Member
Join Date: Nov 2010
Old 11-29-2010 , 04:13   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #6

by the way, is there any way to check the available api reference from the sourcemod? like check what scripting api is available for alien swarm in the sourcemod files?
comp_noob is offline
psychonic

BAFFLED
Join Date: May 2008
Old 11-29-2010 , 07:37   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #7

Quote:
Originally Posted by comp_noob View Post
so there isn't any way to actually get the currently equipped weapon on the marine? i've seen from some other pages that there is a GetMarine() to get the actual controlled marine by the player, because the player isn't moving at all.. as taken from here:
From the Valve Wiki:
"Unlike most Source engine games, the player in Alien Swarm is an invisible
commander entity. It does not move. If the player is currently controlling a
marine, then calling the GetMarine() method on the player will return it."
But then, is there a full list of the new scripting api reference of alien swarm available? there seems to be some commands that are new...
With a small amount of looking, the only way I found in SP to link between commander/players/clients and marines is to find each of the marine resource ents, either with FindEntityByClassname or watching for them with SDK Hooks' OnEntityCreated forward and then look at the m_Command and m_MarineEntity on each as noted in my response to one of your posts on the SDK Hooks thread, https://forums.alliedmods.net/showpo...&postcount=989
Quote:
Originally Posted by comp_noob View Post
by the way, is there any way to check the available api reference from the sourcemod? like check what scripting api is available for alien swarm in the sourcemod files?
In general, anything not in a game-specific extension should work with the exception that some things in SDK Tools will not. (or at least not without tinkering as some functions you will want to use on the marine and not the player).

Alien Swarm has the extra exception that no current menu implementation works. A while ago, I was messing with the possibility of implementation menus using hud messages, resulting in menus displaying similarly to AMXX's as this would have given an on-screen menu to game's that didn't support the radio menu (HL2DM and now Alien Swarm where where vgui menu is also busted). At one point, it was partially working, but there were a couple bugs. I later accidentally even broke what I had and never got back to finishing it. If there's enough interest, I might look at it again.

Last edited by psychonic; 11-29-2010 at 07:40.
psychonic is offline
psychonic

BAFFLED
Join Date: May 2008
Old 11-29-2010 , 10:02   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #8

Quote:
Originally Posted by comp_noob View Post
so there isn't any way to actually get the currently equipped weapon on the marine? i've seen from some other pages that there is a GetMarine() to get the actual controlled marine by the player, because the player isn't moving at all.. as taken from here:
From the Valve Wiki:
"Unlike most Source engine games, the player in Alien Swarm is an invisible
commander entity. It does not move. If the player is currently controlling a
marine, then calling the GetMarine() method on the player will return it."
More followup...

Since I'm nice (sometimes) and this will eventually be needed anyway, here is a plugin library to provide natives for these. Just do "#include <swarmtools>". I can/will also add natives to replicate any sdktools_functions natives that require a client index but need to be executed on a marine. Just let me know what doesn't work directly with a marine index.

This is completely untested as I don't have the desire or time to do so right now, but if you can confirm that it works, I'll post it in the New Plugins section (or fix it first).

Code:
/**  * Gets the marine entity controlled by the given player  *  * @param client        Client index  * @return              Marine entity index or -1 for none or not found  * @error               Invalid client index  */ native Swarm_GetMarine(client); /**  * Gets the client index controlling given marine  *  * @param marine        Marine entity index  * @return              Client index of controller or -1 for none or not found  * @error               Invalid marine index  */ native Swarm_GetClientOfMarine(marine);

This requires SDK Tools and SDK Hooks. I will post a temporary build of SDK Hooks 1.3 shortly that will work on Alien Swarm.

Edit: attachments removed, go here https://forums.alliedmods.net/showthread.php?t=144324

Last edited by psychonic; 12-02-2010 at 08:50.
psychonic is offline
comp_noob
Senior Member
Join Date: Nov 2010
Old 11-29-2010 , 10:56   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #9

Quote:
Originally Posted by psychonic View Post
More followup...

Since I'm nice (sometimes) and this will eventually be needed anyway, here is a plugin library to provide natives for these. Just do "#include <swarmtools>". I can/will also add natives to replicate any sdktools_functions natives that require a client index but need to be executed on a marine. Just let me know what doesn't work directly with a marine index.

This is completely untested as I don't have the desire or time to do so right now, but if you can confirm that it works, I'll post it in the New Plugins section (or fix it first).

Code:
/**
* Gets the marine entity controlled by the given player
*
* @param client Client index
* @return Marine entity index or -1 for none or not found
* @error Invalid client index
*/
native Swarm_GetMarine(client);

/**
* Gets the client index controlling given marine
*
* @param marine Marine entity index
* @return Client index of controller or -1 for none or not found
* @error Invalid marine index
*/
native Swarm_GetClientOfMarine(marine);



This requires SDK Tools and SDK Hooks. I will post a temporary build of SDK Hooks 1.3 shortly that will work on Alien Swarm.
Thanks! i will gladly try it out for you... but about sdk hooks...
comp_noob is offline
psychonic

BAFFLED
Join Date: May 2008
Old 11-29-2010 , 11:58   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #10

Quote:
Originally Posted by psychonic View Post
I will post a temporary build of SDK Hooks 1.3 shortly that will work on Alien Swarm.
I would have had this a bit sooner but it required actual code changes and cleanup in addition to the expected project changes.

Full sdkhooks source is also in the zip since I had to make edits specifically for AS. You should just need the dll and the gamedata file in /extensions and /gamedata respectively.
Attached Files
File Type: zip swarm-sdkhooks.zip (92.0 KB, 147 views)
psychonic 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 09:54.


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