Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2013-01-25 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
January 24, 2013, 07:06:43 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Some help with understanding RainbowDash Race  (Read 160 times)
Remy Lebeau
Full Member
***
Posts: 172


View Profile
« on: November 14, 2012, 12:39:36 AM »

So I'm getting the following error quite a lot in my logs:

Code:
L 11/14/2012 - 01:59:11: [SM] Native "GetArrayArray" reported: Invalid Handle 62c20485 (error: 1)
L 11/14/2012 - 01:59:11: [SM] Displaying call stack trace for plugin "War3source/War3source_STOCK_Races/War3Source_023_RainbowDash.smx":
L 11/14/2012 - 01:59:11: [SM]   [0]  Line 222, distro_source\War3Source_023_RainbowDash.sp::OnW3TakeDmgBulletPre()

The line in question is part of this bit of code:

Code:
new Handle:data;
new Float:chances[5];

new level=W3_GenericSkillLevel(victim,SKILL_GENERIC,data);
if(level){
GetArrayArray(data, 0, chances);
if(data!=INVALID_HANDLE&& level>0 &&!Hexed(victim,false) && W3Chance(chances[level]) && !W3HasImmunity(attacker,Immunity_Skills))
{

W3FlashScreen(victim,RGBA_COLOR_BLUE);

War3_DamageModPercent(0.0); //NO DAMAMGE

W3MsgEvaded(victim,attacker);
if(War3_GetGame()==Game_TF){
decl Float:pos[3];
GetClientEyePosition(victim, pos);
pos[2] += 4.0;
War3_TF_ParticleToClient(0, "miss_text", pos); //to the attacker at the enemy pos
}
}
}


I really don't understand what the GetArrayArray(data,0, chances); part of that does. Since the handle array has only just been created, surely it will be empty?  Also - what does W3_GenericSkillLevel(victim,SKILL_GENERIC,data); do ?
Logged
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2169



View Profile WWW
« Reply #1 on: November 14, 2012, 09:14:06 AM »

i know its poor documentation but

W3_GenericSkillLevel(victim,SKILL_GENERIC,data);  /// data is set here "by reference"

retrives the level of the player on this "generic" skill, also sets the variable data

if you data is null, then you did not initialize the generic skill properly when the race was 'created'

new Handle:evasiondata=CreateArray(5,1);
SetArrayArray(evasiondata,0,EvadeChance,sizeof(EvadeChance));
SKILL_EVADE=War3_UseGenericSkill(thisRaceID,"g_evasion",evasiondata,"Evasion","20% evasion.");

see how evasiondata was passed to War3_UseGenericSkill
W3_GenericSkillLevel would get the handle back into 'data'
Logged

DarkEnergy
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2169



View Profile WWW
« Reply #2 on: November 14, 2012, 09:28:47 AM »

http://goo.gl/bM6tm
Logged

DarkEnergy
Remy Lebeau
Full Member
***
Posts: 172


View Profile
« Reply #3 on: November 14, 2012, 03:24:12 PM »

I haven't touched that part of the race since I downloaded the svn copy of war3source...


Code:
public OnWar3LoadRaceOrItemOrdered(num)
{
if(num==1)
{
SKILL_GENERIC=War3_CreateGenericSkill("g_evasion");
//DP("registereing gernicsadlfjasf");
}
if(num==230)
{
thisRaceID=War3_CreateNewRace("[MLP:FIM] Rainbow Dash","rainbowdash");

new Handle:evasiondata=CreateArray(5,1);
SetArrayArray(evasiondata,0,EvadeChance,sizeof(EvadeChance));
SKILL_EVADE=War3_UseGenericSkill(thisRaceID,"g_evasion",evasiondata,"Evasion","20% evasion.");

SKILL_SWIFT=War3_AddRaceSkill(thisRaceID,"Swiftness","+ 15% Attack Speed");
SKILL_SPEED=War3_AddRaceSkill(thisRaceID,"Speed","(ability) up to +40% speed for 6 seconds.\nMust not be injured in the last 10 seconds.\nEnds if injured.");
ULTIMATE=War3_AddRaceSkill(thisRaceID,"Sonic Rainboom","Buff teammates' damage around you for 4 sec, 200-400 units.",true);
War3_CreateRaceEnd(thisRaceID); ///DO NOT FORGET THE END!!!
}
}

There's the code at initialisation, it's the same as yours.
Logged
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2169



View Profile WWW
« Reply #4 on: November 14, 2012, 04:43:15 PM »

idk, im busy with school so i dont have any time to test
Logged

DarkEnergy
Revan
Sr. Member
****
Posts: 346



View Profile
« Reply #5 on: November 14, 2012, 11:51:28 PM »

what game are you using?
Logged

#war3source
Remy Lebeau
Full Member
***
Posts: 172


View Profile
« Reply #6 on: November 15, 2012, 07:17:29 PM »

This is on CSS.

I may have been a once-off problem (interacting badly between races maybe), as the error is no longer appearing.  I'll report back again if it comes back :-)
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!