Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making a Weapon.
Akasu Offline
Member

Posts: 62
Threads: 6
Joined: Aug 2010
Reputation: 2
#4
RE: Making a Weapon.

I made a script for killing enemies a while ago to be used in my custom story.

void OnStart()
{
AddGlobalVarInt("grunt1", 0);
AddTimer("timer123", 0, "spawn");
}

void spawn (string& asName)
{
AddEntityCollideCallback("sword1", "g1_"+(GetGlobalVarInt("grunt1")), "kill", true, 1); ;(sword1 is the name of the weapon, g1_0, g1_1, g1_2 etc. are the names of the enemies that you can kill with it)
SetGlobalVarInt("grunt1", 1+(GetGlobalVarInt("grunt1")));
AddTimer("timer", 0.1, "spawn"); ;(repeat this as many times as needed)
}

void kill (string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke(""+(asChild), true);
}

It's a basic collide callback so the weapon can be any kind of entity but the most sensible option would be one of the weapon models made by DonProtz or Amnesia's own dagger.
There are many down-sides in the script but it's the best I could think of.
09-01-2011, 12:50 PM
Find


Messages In This Thread
Making a Weapon. - by xdeath - 08-31-2011, 07:12 PM
RE: Making a Weapon. - by Your Computer - 08-31-2011, 09:29 PM
RE: Making a Weapon. - by MrBigzy - 09-01-2011, 01:36 AM
RE: Making a Weapon. - by Akasu - 09-01-2011, 12:50 PM
RE: Making a Weapon. - by xdeath - 09-01-2011, 02:24 PM
RE: Making a Weapon. - by MrBigzy - 09-01-2011, 03:01 PM
RE: Making a Weapon. - by xdeath - 09-01-2011, 08:11 PM
RE: Making a Weapon. - by MegaScience - 09-01-2011, 08:21 PM
RE: Making a Weapon. - by xdeath - 09-01-2011, 08:53 PM
RE: Making a Weapon. - by MegaScience - 09-01-2011, 09:19 PM
RE: Making a Weapon. - by MrBigzy - 09-01-2011, 11:13 PM
RE: Making a Weapon. - by xdeath - 09-02-2011, 04:15 AM
RE: Making a Weapon. - by MegaScience - 09-02-2011, 04:42 AM
RE: Making a Weapon. - by xdeath - 09-03-2011, 01:19 AM
RE: Making a Weapon. - by MegaScience - 09-03-2011, 02:23 AM
RE: Making a Weapon. - by xdeath - 09-03-2011, 09:26 AM



Users browsing this thread: 1 Guest(s)