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

Sourcemod for Dota 2?


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Tetl
Member
Join Date: Nov 2009
Old 03-09-2013 , 21:20   Re: Sourcemod for Dota 2?
#51

Did you:
Code:
map dota
Try
Code:
connect 127.0.0.1:port
Tetl is offline
Tetl
Member
Join Date: Nov 2009
Old 03-10-2013 , 05:18   Re: Sourcemod for Dota 2?
#52

Yo, tinkering with ability properties tonight. Testly mostly with Alchemist, tried to get these values under all possible states of the ability (Targeting state, Animating State, Casted State, etc) Here are my findings:
m_bInAbilityPhase - most useful of the bunch, is "true" if the hero is casting (in cast animations) for the targeted ability.
m_bToggleState - True if the ability is a toggle-type ability (WD's heal) and is active.
m_bActivated - In my tests, always true.
m_iDirtyButtons - Always 0 in my tests. Maybe relates to autocast button graphics or something like that
m_hOwnerEntity - Links to owning hero. Woo!
m_hEffectEntity - Always returns index -1 in my tests.
m_iLevel - Skill's level.
m_iManaCost - Returns ability's mana cost, though changing it (atleast, with my technique: after a hero has been initialized in spawn) does not affect actual mana consumption.
m_flCooldownLength - 0 If the spell has not been cast yet, if it has, a number I don't understand. In my tests this number only changes if the spell is cast under a different cooldown (i.e. when it has been leveled) Here are some examples:
1101004800 - Cask Level 1 (20 Second Cooldown)
109956224 - Cask Level 2 (18 Second Cooldown)
1096810496 - Cask Level 4 (14? Second Cooldown)

Doing some cast detection using the above information, here's cheeky psuedo-sample code since the sun's almost up
Code:
//somewhere else
new bool:wasAnimating = false;
new bool:recentCast = false;
hero = GetEntPropEnt(client, Send_Prop, "m_hAssignedHero");
ability = GetEntPropEnt(hero, Send_Prop, "m_hAbilities", 0); //first ability

public OnGameFrame()
{
	for (everyclient)
	{
		if (everythingisalright)
		{
			new abilityPhase = GetEntProp(ability, Send_Prop, "m_bInAbilityPhase");
			new Float:cooldown = GetEntPropFloat(ability, Send_Prop, "m_flCooldownLength");
			if (wasAnimating && cooldown > 0) 
			{
				//cast confirmed, set CooldownLength to 0 so we can use it to confirm that an ability was cast recently again
				SetEntPropFloat(ability, Send_Prop, "m_flCooldownLength", 0);
			}
			if (abilityPhase)
			{
				//hero is animating
				wasAnimating = true;
			}
			else wasAnimating = false;
		}
	}
}
Untested, but barring any would-be obvious logical errors, it will work unless:
Resetting CooldownLength to 0 fails in some way
My assumption that CooldownLength is set in the same frame in which InAbilityPhase is reset to 0 after cast completion is incorrect. If this is the case then it seems that some small grace period could be added in easily.

Last edited by Tetl; 03-10-2013 at 06:49.
Tetl is offline
Solace
Junior Member
Join Date: Apr 2006
Location: Canada BC Vancouver
Old 03-10-2013 , 08:29   Re: Sourcemod for Dota 2?
#53

Quote:
Originally Posted by ghostdlr View Post
Did anyone managed to connect to the server?

It doesn't matter if I use Dota or Dota 2 test i'm getting the following messages:

23.602: Sending UDP connect to public IP ....
Retrying public(...) ...

and finally:
Disconnect: Unable to establish connection to the server.

Am I missing something ? Server was started with "-game dota -console" parameters .
same issue

the servers listening in both cases "test/beta client" but not establishing the udp connect for some odd reason. tried various networking solutions to no avail so far along with setting the ip/hostport manually.

edit: retarded firewall rule/fixed

Last edited by Solace; 03-10-2013 at 18:18. Reason: im a dumbass
Solace is offline
Send a message via AIM to Solace Send a message via MSN to Solace
psychonic

BAFFLED
Join Date: May 2008
Old 03-10-2013 , 08:55   Re: Sourcemod for Dota 2?
#54

Quote:
Originally Posted by Tetl View Post
m_flCooldownLength - 0 If the spell has not been cast yet, if it has, a number I don't understand. In my tests this number only changes if the spell is cast under a different cooldown (i.e. when it has been leveled) Here are some examples:
1101004800 - Cask Level 1 (20 Second Cooldown)
109956224 - Cask Level 2 (18 Second Cooldown)
1096810496 - Cask Level 4 (14? Second Cooldown)
It looks like you prints floats with %d or %i instead of %f.

1101004800 interpreted as a float is 20.0.
psychonic is offline
ghostdlr
Senior Member
Join Date: Aug 2010
Old 03-10-2013 , 11:13   Re: Sourcemod for Dota 2?
#55

Quote:
Originally Posted by Tetl View Post
Did you:
Code:
map dota
Try
Code:
connect 127.0.0.1:port
The server just crashed after I typed map dota ...

I didn't manage to install Source mod . Can this be the cause? If that's so, can anyone tell me the steps I have to follow to get the server running?

Last edited by ghostdlr; 03-10-2013 at 11:16.
ghostdlr is offline
Solace
Junior Member
Join Date: Apr 2006
Location: Canada BC Vancouver
Old 03-10-2013 , 13:14   Re: Sourcemod for Dota 2?
#56

Quote:
Originally Posted by ghostdlr View Post
The server just crashed after I typed map dota ...

I didn't manage to install Source mod . Can this be the cause? If that's so, can anyone tell me the steps I have to follow to get the server running?
source mod isnt supported yet

Last edited by Solace; 03-10-2013 at 13:15.
Solace is offline
Send a message via AIM to Solace Send a message via MSN to Solace
Tetl
Member
Join Date: Nov 2009
Old 03-10-2013 , 16:03   Re: Sourcemod for Dota 2?
#57

Quote:
Originally Posted by psychonic View Post
It looks like you prints floats with %d or %i instead of %f.

1101004800 interpreted as a float is 20.0.
That is correct thanx

Also, tested my janktastic cast detection from above and it worked well with Acid Spray, it should work well on any ability with a cooldown.

Last edited by Tetl; 03-11-2013 at 05:32.
Tetl is offline
TsunamiNori
Junior Member
Join Date: Mar 2013
Old 03-12-2013 , 02:29   Re: Sourcemod for Dota 2?
#58

is there the way to auto restart server whenever the match end? or i just do it manually?
TsunamiNori is offline
Send a message via Skype™ to TsunamiNori
thegameeer
Junior Member
Join Date: Mar 2013
Old 03-12-2013 , 06:50   Re: Sourcemod for Dota 2?
#59

So I managed to setup the server but when it loads the map it crashes. Can someone give me the server.cfg?
thegameeer is offline
TsunamiNori
Junior Member
Join Date: Mar 2013
Old 03-12-2013 , 07:42   Re: Sourcemod for Dota 2?
#60

Quote:
Originally Posted by thegameeer View Post
So I managed to setup the server but when it loads the map it crashes. Can someone give me the server.cfg?
no need server.cfg, just to be sure that u have a correct map version.
TsunamiNori is offline
Send a message via Skype™ to TsunamiNori
Closed Thread



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:34.


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