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

War3:Source
September 21, 2012, 09:11:44 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: Secret Hero  (Read 1879 times)
Martin Texno
Newbie
*
Posts: 22


I'm Constructive ?

martinkongerule@hotmail.com martinmikalsen@yahoo.com
View Profile WWW Email
« on: December 01, 2009, 11:50:35 AM »

The Secret Hero !


I don't have this War3 Mod ? so i can't test the race....
How's the race going ?

Code:
#include <sourcemod>
#include "War3Source/War3Source_Interface"

new raceID;

public Plugin:myinfo =
{
name =  "Secret hero",
author =  "<---TexNo--->",
description = "First Race inn this coding.",
version = "1.0",
url = "http://zeroasylum.freeforums.org/"
};


public OnWar3PluginReady()
{
raceID=War3_CreateRace("Secret Hero","secret hero","you are now Secret hero","Return of the Secret Hero","Impaling Gravity","Gravity Increase","Liquid Life","Health At spawn","Speedy Hero","More Speed");
}

public OnPluginStart()
{
HookEvent("player_spawn",PlayerSpawnEvent);
}

public PlayerSpawnEvent(Handle:event,const String:name[],bool:dontBroadcast)
{
new userid=GetEventInt(event,"userid");
new client=GetClientOfUserId(userid);
if(client>0)
{
new race=War3_GetRace(client);
if(race==raceID)
{
new impalegravity_skill=War3_GetSkillLevel(client,race,0);
new Float:gravity=1.0;
switch(impalegravity_skill)
{
case 0:
gravity=1.1;
case 1:
gravity=1.3;
case 2:
gravity=1.5;
case 3:
gravity=1.7;
case 4:
gravity=1.9;
}
War3_SetMinGravity(client,gravity);
new health_skill=War3_GetSkillLevel(client,race,1);
new old_health=GetClientHealth(client);
new add_health=0;
switch(health_skill)
{
case 0:
add_health=9;
case 1:
add_health=16;
case 2:
add_health=27;
case 3:
add_health=38;
case 4:
add_health=46;
}
SetEntityHealth(client,old_health+add_health);
new speed_skill=War3_GetSkillLevel(client,race,2);
new Float:speed=1.0;
switch(speed_skill)
{
case 0:
speed=1.3;
case 1:
speed=1.5;
case 2:
speed=1.6;
case 3:
speed=1.7;
case 4:
speed=1.8;
}
War3_SetMaxSpeed(client,speed)
}
}
}

public OnSkillLevelChanged(client,race,skill,oldskilllevel,newskilllevel)
{
if(race==raceID && skill==0)
{
new Float:gravity=1.0;
switch(newskilllevel)
{
case 0:
gravity=1.1;
case 1:
gravity=1.3;
case 2:
speed=1.5;
case 3:
gravity=1.7;
case 4:
gravity=1.9;
}
    War3_SetMinGravity(client,gravity)
}
if(race==raceID && skill==1)
{
new Float:speed=1.0;
switch(newskilllevel)
{
case 0:
speed=1.3;
case 1:
speed=1.5;
case 2:
speed=1.6;
case 3:
speed=1.7;
case 4:
speed=1.8;
}
   War3_SetMaxSpeed(client,speed);
}
}

public OnRaceSelected(client,oldrace,newrace)
{
if(newrace!=raceID)
{
War3_SetMaxSpeed(client,1.0);
War3_SetMinGravity(client,1.0);
War3_SetOverrideSpeed(client,0.0);
}
 }
}
« Last Edit: December 01, 2009, 05:00:57 PM by Martin Texno » Logged

Support ?
Anthony Iacono
Lead Developer
Full Member
***
Posts: 132

Lets make it better.

anthonyiacono@gmail.com
View Profile WWW Email
« Reply #1 on: December 01, 2009, 02:31:25 PM »

When I get home I'll take a better look, but glad you are taking a shot at making races already!
You don't seem to have a need for SetOverrideSpeed, so you can remove that. To explain better, that function is used for overriding War3's Max Speed detection, so for example if you are trying to slow someone down when you shoot them for 5 seconds, you could do something along these lines:
Code:
You would HookEvent player_hurt, and inside you would do something like...
new victim=GetClientOfUserId(GetEventInt("userid"));
new attacker=GetClientOfUserId(GetEventInt("attacker"));
if(victim>0 && attacker>0)
{
  new skill_attacker=War3_GetSkillLevel(attacker,victim,skillnumber);
  if(skill_attacker>0)
  {
    new Float:speed=1.0;
    switch(skill_attacker)
    {
      case 1:
        speed=0.9;
      case 2:
        speed=0.8;
      case 3:
        speed=0.7;
      case 4:
        speed=0.6;
    }
    War3_SetOverrideSpeed(victim,speed,skillnumber);
    CreateTimer(5.0,fix_speed,GetEventInt("userid"));
  }
}

public Action:fix_speed(Handle:timer,any:userid)
{
  new client=GetClientOfUserId(userid);
  if(client>0)
  {
    War3_SetOverrideSpeed(victim,0.0,skillnumber); // give war3 back control
  }
}

Obviously skillnumber would be the skill (0-3) of the power that would do this.
Let me know if you are still confused.
Logged
Martin Texno
Newbie
*
Posts: 22


I'm Constructive ?

martinkongerule@hotmail.com martinmikalsen@yahoo.com
View Profile WWW Email
« Reply #2 on: December 01, 2009, 02:47:17 PM »

Ok, just confusing to make a race, when the mod isn't released Wink
I'll still try make some more.
Still learning, it's a good tutorial so it shouldn't be so very hard.
« Last Edit: December 01, 2009, 02:56:34 PM by Martin Texno » Logged

Support ?
DisturbeD
Newbie
*
Posts: 39


Me fail English? That’s unpossible.


View Profile Email
« Reply #3 on: December 01, 2009, 02:55:53 PM »

Ill probably recode many of the good old races to sourcepawn when its released ;p
How to use est- stuff btw?
Logged
Martin Texno
Newbie
*
Posts: 22


I'm Constructive ?

martinkongerule@hotmail.com martinmikalsen@yahoo.com
View Profile WWW Email
« Reply #4 on: December 01, 2009, 03:12:41 PM »

Code:
[quote author=Anthony Iacono link=topic=4.msg18#msg18 date=1259699485]
new victim=GetClientOfUserId(GetEventInt("userid"));
new attacker=GetClientOfUserId(GetEventInt("attacker"));
if(victim>0 && attacker>0)
{
  new skill_attacker=War3_GetSkillLevel(attacker,victim,skillnumber);
  if(skill_attacker>0)
  {
    new Float:speed=1.0;
    switch(skill_attacker)
    {
      case 1:
        speed=0.9;
      case 2:
        speed=0.8;
      case 3:
        speed=0.7;
      case 4:
        speed=0.6;
    }
    War3_SetOverrideSpeed(victim,speed,skillnumber);
    CreateTimer(5.0,fix_speed,GetEventInt("userid"));
  }
}

public Action:fix_speed(Handle:timer,any:userid)
{
  new client=GetClientOfUserId(userid);
  if(client>0)
  {
    War3_SetOverrideSpeed(victim,0.0,skillnumber);
  }
}
[/quote]

Thank you, this was very helpfull.
Question : Would this race work, for the mod ?
Logged

Support ?
Anthony Iacono
Lead Developer
Full Member
***
Posts: 132

Lets make it better.

anthonyiacono@gmail.com
View Profile WWW Email
« Reply #5 on: December 01, 2009, 05:20:20 PM »

Ill probably recode many of the good old races to sourcepawn when its released ;p
How to use est- stuff btw?

EST is not needed. Everything can be done with SourceMod.

Quote
Thank you, this was very helpfull.
Question : Would this race work, for the mod ?

I understand it is very difficult without the mod to test. Don't worry, it won't be long until there is a beta. Also, I'll make a build of your race and let you know as soon as I can how it works.
Logged
stinkyfax
Full Member
***
Posts: 116


View Profile Email
« Reply #6 on: December 07, 2009, 06:05:56 PM »

EST is just small part of what SP does in effects area.
But about the race, I didn't like it - what's so interesting about it? +hp +speed +gravity, all those 3 skills are the least exciting to have. Sorry for negative feedback, I hope it will help you with next race.
Logged

Martin Texno
Newbie
*
Posts: 22


I'm Constructive ?

martinkongerule@hotmail.com martinmikalsen@yahoo.com
View Profile WWW Email
« Reply #7 on: December 08, 2009, 01:21:03 PM »

EST is just small part of what SP does in effects area.
But about the race, I didn't like it - what's so interesting about it? +hp +speed +gravity, all those 3 skills are the least exciting to have. Sorry for negative feedback, I hope it will help you with next race.
i do understand, it sucks, btw it was my first race, how could i do something really good ? :p
Logged

Support ?
stinkyfax
Full Member
***
Posts: 116


View Profile Email
« Reply #8 on: December 08, 2009, 05:26:17 PM »

EST is just small part of what SP does in effects area.
But about the race, I didn't like it - what's so interesting about it? +hp +speed +gravity, all those 3 skills are the least exciting to have. Sorry for negative feedback, I hope it will help you with next race.
i do understand, it sucks, btw it was my first race, how could i do something really good ? :p
I didn't like it not because it's bad coded or has errors (which is usually met during first attemps of new programmer) but because the concept is boring and too common. You don't need to be skilled programmer in order to invent something funny or new.
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!