mersox
Active member
Hey guys. I'm having a problem with my TMNT mod. Before I get to the problem, let me explain what it is that I am trying to achieve.
I have a couple of weapons scattered in some of the levels of the game. Not every character is able to grab these weapons, though. So in that sense, we have two groups of playable characters: the ones that can carry weapons (A), and the ones that cannot (B).
The way the game plays right now, without any fancy scripts in the way of weapons, if a character from the group "A" punches a weapon, he/she will get it. But if a character of group "B" attemps to grab a weapon, nothing will happen and the weapon will stay on the ground.
This works fine except it's not really user friendly. I have seen some youtube videos where players don't know how to grab a weapon, which is even more confusing if your char can't carry a weapon to begin with.
So i wanted to change this so that:
1. a character type "A" can get a weapon by merely walking to it, no attacks necessary
2. if a char tyoe "B" walks to a weapon, he/she will display a "I can't take this" sign of some sort.
Alright so what I have been trying to do is to add a didhitscript to my weapon. For now I am just focusing on
- getting a char to get weapon by just touch (this I have achieved)
- not letting chars type B to get the weapon (this I am having trouble with)
Forget about the "I can't take this" sign thing for now, as I believe I can accomplish that by myself later. How can I stop chars type B from getting the weapon? This is the didhitscript I am using:
That "if" part of the script is being ignored by the engine.
I have a couple of weapons scattered in some of the levels of the game. Not every character is able to grab these weapons, though. So in that sense, we have two groups of playable characters: the ones that can carry weapons (A), and the ones that cannot (B).
The way the game plays right now, without any fancy scripts in the way of weapons, if a character from the group "A" punches a weapon, he/she will get it. But if a character of group "B" attemps to grab a weapon, nothing will happen and the weapon will stay on the ground.
This works fine except it's not really user friendly. I have seen some youtube videos where players don't know how to grab a weapon, which is even more confusing if your char can't carry a weapon to begin with.
So i wanted to change this so that:
1. a character type "A" can get a weapon by merely walking to it, no attacks necessary
2. if a char tyoe "B" walks to a weapon, he/she will display a "I can't take this" sign of some sort.
Alright so what I have been trying to do is to add a didhitscript to my weapon. For now I am just focusing on
- getting a char to get weapon by just touch (this I have achieved)
- not letting chars type B to get the weapon (this I am having trouble with)
Forget about the "I can't take this" sign thing for now, as I believe I can accomplish that by myself later. How can I stop chars type B from getting the weapon? This is the didhitscript I am using:
void main()
{
int iSnd = loadsample("data/sounds/(tmnt2/motor01.wav");
void self = getlocalvar("self");
//void opponent = getentityproperty(self, "opponent");
void opponent = getlocalvar("damagetaker");
void oppmodel = getentityproperty(opponent,"model");
if (oppmodel == "leo" || oppmodel == "raph" || oppmodel == "mike" || oppmodel == "don"){
changeentityproperty(opponent, "weapon", 2);
performattack(opponent, openborconstant("ANI_get"));
playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 120, 0); //itemup sfx
}
}
That "if" part of the script is being ignored by the engine.