Trigger_Weapon help [message #255294] |
Mon, 23 April 2007 15:07 |
a100
Messages: 45 Registered: March 2007
Karma: 0
|
Recruit |
|
|
Does Trigger_Weapon not work or am i just not using the code right?
Heres what i beleive the parameters are
GameObject *obj = Player to shoot from
bool fire = fire or not?
const Vector3 &location = Location to fire?
bool primary = secondary/primary fire
[Updated on: Mon, 23 April 2007 15:12] Report message to a moderator
|
|
|
Re: Trigger_Weapon help [message #255362 is a reply to message #255294] |
Mon, 23 April 2007 23:58 |
|
zunnie
Messages: 2959 Registered: September 2003 Location: Netherlands
Karma: 0
|
General (2 Stars) |
|
|
I would guess something like this:
For example if you want a mammoth to attack the hand of nod with
its rockets, you could have the script look for the hand of nod controller and get its position etc like:
void attackhand::Created(GameObject *obj)
{
Commands->Start_Timer(obj,this,5.0f,101);
}
void attackhand::Timer_Expired(GameObject *obj, int number)
{
if (number == 101)
{
GameObject *hand = Find_Building(0,SOLDIER_FACTORY);
Vector3 attackloc = Commands->Get_Position(hand);
Commands->Trigger_Weapon(obj,true,attackloc,false);
Commands->Start_Timer(obj,this,5.0f,101);
}
}
This will loop until the mammoth is destroyed..
[Updated on: Tue, 24 April 2007 00:02] Report message to a moderator
|
|
|
Re: Trigger_Weapon help [message #255394 is a reply to message #255294] |
Tue, 24 April 2007 04:42 |
a100
Messages: 45 Registered: March 2007
Karma: 0
|
Recruit |
|
|
I will be trying your method shortly
But ill show you whaat i want to achieve
found = words[1].find("!dtest");
if (found >= 0){
Vector3 posi = Commands->Get_Position(Get_GameObj(Get_ID_Name(words[3].c_str()));
Commands->Trigger_Weapon(Get_GameObj(ID),true,posi,true);
Commands->Trigger_Weapon(Get_GameObj(ID),false,posi,true);
}
This also doesnt work when the player is rigth infront
Weapon doesnt shoot, i think trigger weapon doesnt work with infantry
[Updated on: Tue, 24 April 2007 04:43] Report message to a moderator
|
|
|
|
|
|
Re: Trigger_Weapon help [message #255608 is a reply to message #255294] |
Wed, 25 April 2007 04:36 |
a100
Messages: 45 Registered: March 2007
Karma: 0
|
Recruit |
|
|
After along time i found this out
Trigger_Weapon does work with players but the problem is no animations, and also you cant use it with chat hook but instead you need to make/add a script to do it.
Aslo can someone explain how to get animations for bullets working?
|
|
|