Raised This Month: $ Target: $400
 0% 

[Alien Swarm] Finding current equipped weapon name


Post New Thread Reply   
 
Thread Tools Display Modes
comp_noob
Senior Member
Join Date: Nov 2010
Old 12-03-2010 , 01:44   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #41

Quote:
Originally Posted by psychonic View Post
This should be fixed in 1.2.4.
yup it's all fixed now! thanks psychonic! i will post again if i manage to find any errors
PS: you forgot to update the version in the main thread, it's still 1.2.3

EDIT: just wanna ask, are any of the events here working? because i tried a few and it doesn't seem to fire at all... (example: sentry_start_building, sentry_stop_building etc...) http://wiki.alliedmods.net/Alien_Swa..._should_switch

EDIT 2: error with Suicide function again..
PHP Code:

L 12
/03/2010 17:20:56: [SMNative "Swarm_ForceMarineSuicide" reportedSuicide function not found
L 12
/03/2010 17:20:56: [SMDisplaying call stack trace for plugin "ready.smx":
L 12/03/2010 17:20:56: [SM]   [0]  Line 93ready.sp::Kill_Player_Marine() 
and, is it possible to make Swarm_GetMarine() gets the correct marine id controlled by a player? because when there are bots, and when i died, i can press F2 or F3 or F4 to take over another bot, but, the Swarm_GetMarine() doesn't get updated with the newly controlled marine id, returns -1 instead...

Last edited by comp_noob; 12-03-2010 at 04:26.
comp_noob is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-03-2010 , 06:50   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #42

Quote:
Originally Posted by comp_noob View Post
EDIT: just wanna ask, are any of the events here working? because i tried a few and it doesn't seem to fire at all... (example: sentry_start_building, sentry_stop_building etc...) http://wiki.alliedmods.net/Alien_Swa..._should_switch
No clue.

Quote:
Originally Posted by comp_noob View Post
EDIT 2: error with Suicide function again..
PHP Code:

L 12
/03/2010 17:20:56: [SMNative "Swarm_ForceMarineSuicide" reportedSuicide function not found
L 12
/03/2010 17:20:56: [SMDisplaying call stack trace for plugin "ready.smx":
L 12/03/2010 17:20:56: [SM]   [0]  Line 93ready.sp::Kill_Player_Marine() 
Gamedata was missing a \x at the beginning of the signature.

Quote:
Originally Posted by comp_noob View Post
and, is it possible to make Swarm_GetMarine() gets the correct marine id controlled by a player? because when there are bots, and when i died, i can press F2 or F3 or F4 to take over another bot, but, the Swarm_GetMarine() doesn't get updated with the newly controlled marine id, returns -1 instead...
I don't know why this wouldn't work. If it's returning -1 then none of the marine resources were updated with a new commander, which should happen according to a another quick glance at the AS code.
psychonic is offline
comp_noob
Senior Member
Join Date: Nov 2010
Old 12-03-2010 , 08:21   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #43

Quote:
Originally Posted by psychonic View Post
I don't know why this wouldn't work. If it's returning -1 then none of the marine resources were updated with a new commander, which should happen according to a another quick glance at the AS code.
Yup it seems this is the case... so i have no choice but to use my own coding to get the marine index of the players...
comp_noob is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-03-2010 , 09:36   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #44

Quote:
Originally Posted by comp_noob View Post
Yup it seems this is the case... so i have no choice but to use my own coding to get the marine index of the players...
Give this version of the plugin and inc a try.

It allows for the idea that a player can have more than one marine (which seems to be the case when playing alone. All 4 marines will have you as their commander).

This adds Swarm_GetClientMarineCount to get the count of marines a player has and adds a second parameter to Swarm_GetMarine to specify the number of marine. If 0, default, it just returns the first one found; 1 would cause it to return the second one found, etc.

In addition, it no longer makes the assumption that if the marine resource exists that the marine tied to the resource will be valid.

If this works, I will update the plugin post.
Attached Files
File Type: sp Get Plugin or Get Source (swarmtools.sp - 184 views - 10.3 KB)
File Type: inc swarmtools.inc (8.3 KB, 97 views)

Last edited by psychonic; 12-04-2010 at 16:03.
psychonic is offline
comp_noob
Senior Member
Join Date: Nov 2010
Old 12-03-2010 , 12:18   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #45

ok will try this tmr, now too tired already... needa catch some rest...

EDIT 1: first error during compilation of your swarmtools.sp:
PHP Code:
//// swarmtools.sp
// swarmtools.sp(153) : error 001: expected token: ")", but found "continue"
// swarmtools.sp(180) : error 001: expected token: ")", but found "continue" 
yup, the whole plugin's working all right.. but is it possible to do like, for example , when the marine i originally control (marine id 2 is dead, the marine index is removed and becomes -1... but the resources that is tied to that marine is still around, and not removed... so can i tie another marine to the original resource index, so that it now retains the original dead marine's resources? in other words, can i spawn another marine entity, tie the marine entity to the original dead marine's entity, and it assumes the resources of the dead marine and is under my control once again?

EDIT 2: damn, i thought i succeeded, what i did was to make a command that i can use whenever my marine died, i spawned a marine entity, edited it's m_Commander to my client index, set my previous dead marine's resource index m_MarineEntity to the newly created marine, teleported it to the place where my previous marine first spawned, everything looks ok, my new marine inherited my previous marine's name, his hp... but the model looks a bit weird though, and also, i can't switch my control to it... hmmm... and also, when i took over another bot and used it to shoot the created marine, it crashed immediately... seems like there's some more other things to make... psychonic, you have any idea? on how to switch your control to the marine's?

Last edited by comp_noob; 12-04-2010 at 02:33.
comp_noob is offline
comp_noob
Senior Member
Join Date: Nov 2010
Old 12-05-2010 , 22:39   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #46

hi, any updates on the plugin?
comp_noob is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-06-2010 , 19:11   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #47

Quote:
Originally Posted by comp_noob View Post
yup, the whole plugin's working all right.. but is it possible to do like, for example , when the marine i originally control (marine id 2 is dead, the marine index is removed and becomes -1... but the resources that is tied to that marine is still around, and not removed... so can i tie another marine to the original resource index, so that it now retains the original dead marine's resources? in other words, can i spawn another marine entity, tie the marine entity to the original dead marine's entity, and it assumes the resources of the dead marine and is under my control once again?

EDIT 2: damn, i thought i succeeded, what i did was to make a command that i can use whenever my marine died, i spawned a marine entity, edited it's m_Commander to my client index, set my previous dead marine's resource index m_MarineEntity to the newly created marine, teleported it to the place where my previous marine first spawned, everything looks ok, my new marine inherited my previous marine's name, his hp... but the model looks a bit weird though, and also, i can't switch my control to it... hmmm... and also, when i took over another bot and used it to shoot the created marine, it crashed immediately... seems like there's some more other things to make... psychonic, you have any idea? on how to switch your control to the marine's?
Quote:
Originally Posted by comp_noob View Post
hi, any updates on the plugin?
I hadn't seen that you updates your post. I didn't check since it said there were no new posts.

I don't know about re-assigning marines to different resources and how that would affect things.
psychonic is offline
comp_noob
Senior Member
Join Date: Nov 2010
Old 12-12-2010 , 12:43   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #48

hi psychonic, just wanna ask, is it possible that you make the Swarm_GetMarineAmmo() function check the ammo reserve for the current weapon or a weapon from a specific slot? it will be good if you could do that, because it's very troublesome to make a function to detect what weapon the marine is holding, and make lots of if statement to check the ammotype for each of the weapons available.... and while u are at it, i found one net prop "m_bPlayerReady" under "CASW_Game_Resource", i tried modifying it to change the ready state of the players connected to my game, because the force ready timer is too long, and some players are very irritating, purposely don't press ready, then i will have to wait for the timer to countdown finish before i can force ready... but, it seems that setting the net prop for the client index doesn't seem to work, the property isn't found... so, do you have any idea what the net prop might be tied to?
comp_noob is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-14-2010 , 21:10   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #49

Quote:
Originally Posted by comp_noob View Post
hi psychonic, just wanna ask, is it possible that you make the Swarm_GetMarineAmmo() function check the ammo reserve for the current weapon or a weapon from a specific slot? it will be good if you could do that, because it's very troublesome to make a function to detect what weapon the marine is holding, and make lots of if statement to check the ammotype for each of the weapons available.... and while u are at it, i found one net prop "m_bPlayerReady" under "CASW_Game_Resource", i tried modifying it to change the ready state of the players connected to my game, because the force ready timer is too long, and some players are very irritating, purposely don't press ready, then i will have to wait for the timer to countdown finish before i can force ready... but, it seems that setting the net prop for the client index doesn't seem to work, the property isn't found... so, do you have any idea what the net prop might be tied to?
Feedback, pl0x.

Added:
Code:
/**  * Returns the entity index of the game resource entity.  *  * @return              Entity index of the game resource entity or -1 if not found.  */ native Swarm_GetGameResourceEnt(); /**  * Returns a weapon's primary ammo type  *  * @param weapon        Weapon entity index  * @return              Ammo type  * @error               Invalid weapon entity  */ stock Swarm_GetWeaponAmmoType1(weapon); /**  * Returns a weapon's secondary ammo type  *  * @param weapon        Weapon entity index  * @return              Ammo type  * @error               Invalid weapon entity  */ stock Swarm_GetWeaponAmmoType2(weapon); /**  * Returns whether or not a player is marked as ready.  *  * @param client        Client index  * @return              True if player is ready, else false  * @error               Invalid client or invalid game resource ent  */ native bool:Swarm_GetPlayerReady(client); /**  * Sets whether or not a player is marked as ready.  *  * @param client        Client index  * @param ready         True to mark a player as ready, false to mark as not ready  * @noreturn  * @error               Invalid client or invalid game resource ent  */ native bool:Swarm_SetPlayerReady(client, bool:ready);

I'm not 100% sure the PlayerReady stuff will work, but it's my best shot at it.

Plugin version should show as 1.2.6.
Attached Files
File Type: sp Get Plugin or Get Source (swarmtools.sp - 189 views - 11.4 KB)
File Type: inc swarmtools.inc (9.8 KB, 88 views)
psychonic is offline
comp_noob
Senior Member
Join Date: Nov 2010
Old 12-15-2010 , 00:36   Re: [Alien Swarm] Finding current equipped weapon name
Reply With Quote #50

the Swarm_GetPlayerReady function isn't working, it always return false, the Swarm_SetPlayerReady function isn't working either....
comp_noob 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 14:42.


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