Multiple health/damage attributes.
- fps
- Posts: 504
- Joined: Mon Sep 26, 2005 9:54 pm
- Location: in a magical land devoid of hope, happiness, and sanity.
Multiple health/damage attributes.
does anybody know how to get a scripted pawn check for more than 1 attribute health/damage.
I want my pawns to be hit by bullets and detect pain and be hit by fire and burn.
You know how the health value gets to zero and then it jumps to the specified order. that and when it goes downit jumps to a pain order.
All i need to know is how to set up 2 different health orders triggered by being hit by bullets with different damage attributes.
This is a repost to try to get some more attention drawn to this question,
I need some help with scripting my pawns, i know that weapons can cause any type of damage you set them to, i also am shure that a projectile can cause up to 2 types of damage and the blast area can be set to a third, i know that scripted carector pawns can and usually do check for a damageattribute.
My QUESTION is; Can a pawn check fore more than one kind of damage and move to a different pain order accrdingly?
Just like it is done with 1 attribute but with 2, ive tryed it to no effect but i am shure it can be done,
please help me,
fps
I want my pawns to be hit by bullets and detect pain and be hit by fire and burn.
You know how the health value gets to zero and then it jumps to the specified order. that and when it goes downit jumps to a pain order.
All i need to know is how to set up 2 different health orders triggered by being hit by bullets with different damage attributes.
This is a repost to try to get some more attention drawn to this question,
I need some help with scripting my pawns, i know that weapons can cause any type of damage you set them to, i also am shure that a projectile can cause up to 2 types of damage and the blast area can be set to a third, i know that scripted carector pawns can and usually do check for a damageattribute.
My QUESTION is; Can a pawn check fore more than one kind of damage and move to a different pain order accrdingly?
Just like it is done with 1 attribute but with 2, ive tryed it to no effect but i am shure it can be done,
please help me,
fps
I've tried it a couple of months ago, because i wanted to make pawns have fireresist, waterresist and so on. Then i found out that it was impossible because only the last AttributeOrder() was the one that counted. So it is impossible to make a pawn have two attributes active at one time.
I think it can only be done with a scripted player. There is another post in which i wrote about this.
I think it can only be done with a scripted player. There is another post in which i wrote about this.
Everyone can see the difficult, but only the wise can see the simple.
-----
-----
from what little i gather from this conversation, why not make an invisible pawn that senses when player has x weapon out, etc. and controls attributes that way?
RF2 site: http://realityfactory2.sourceforge.net/
RF2 tasks: http://sourceforge.net/pm/?group_id=179085
RF2 tasks: http://sourceforge.net/pm/?group_id=179085
it would be possible; at least if you want to have 1000 player attributes(no kidding! i once had over 1100!)
In the pain order you would decrease the attribute that is made for this pawn and then you would check all the attributes every time. But HEY YOU BROUGHT ME TO AN IDEA!!!!!
You could make just one attribute but make different pawn types react differently to different weapons!!! (I mean you shot with fire onto a zombie and - WHOOSH - 3 times more damage!!!)
Here is the code:
Enjoy!!!
In the pain order you would decrease the attribute that is made for this pawn and then you would check all the attributes every time. But HEY YOU BROUGHT ME TO AN IDEA!!!!!
You could make just one attribute but make different pawn types react differently to different weapons!!! (I mean you shot with fire onto a zombie and - WHOOSH - 3 times more damage!!!)
Here is the code:
Code: Select all
PainOrder[ ()
{
//Switch to low level...
LowLevel("LowLevelPain");
} ]
LowLevelPain[ ()
{
switch(self.player_weapon)
{
case 1 //Weapon on slot 1: example: normal gun
{
//nothing. normal damage for this pawn type.
}
case 2 //Weapon on slot 2: example: flame thrower
{
self.health = self.health -4 //Fire does 4 extra damage on this pawn type.
}
}//SWITCH
HighLevel("Attack") //Attack player
} ]
Everyone can see the difficult, but only the wise can see the simple.
-----
-----
- fps
- Posts: 504
- Joined: Mon Sep 26, 2005 9:54 pm
- Location: in a magical land devoid of hope, happiness, and sanity.
I like these ideas but still i am confused,
I guess what i have here are 3 different ways of doing this.
(1) make invisible pawns that detect different types of damage.
But if a bullet doing type "fire" damage hits the type "impact" damage dectetor pawn first then wont the bullet be destroyed and not reach the "fire" damage dectetor?
(2) use a logic gate.
How the heck do i do that, and wont i need to do a new one in the level for each pawn?
(3) Do weapon slot dectetion.
I am using multipule damage types per bullet and while i can get rid of this, i am also using negative numbered weapon slots for more weapons.
Which one would work best?
Whichever one i use i NEED it to work with the low level per bone collision scripting bit i am working on it the other related post .
Thanks,
Fps
I guess what i have here are 3 different ways of doing this.
(1) make invisible pawns that detect different types of damage.
But if a bullet doing type "fire" damage hits the type "impact" damage dectetor pawn first then wont the bullet be destroyed and not reach the "fire" damage dectetor?
(2) use a logic gate.
How the heck do i do that, and wont i need to do a new one in the level for each pawn?
(3) Do weapon slot dectetion.
I am using multipule damage types per bullet and while i can get rid of this, i am also using negative numbered weapon slots for more weapons.
Which one would work best?
Whichever one i use i NEED it to work with the low level per bone collision scripting bit i am working on it the other related post .
Thanks,
Fps
this is a very, very bad idea - for one thing, -1 in rf's code means "no weapon", and i believe there are other problems aswell... if you want more weapons, just change the i believe it is #define MAX_WEAPONS 40 to whatever number you want in the rf code and recompile...fps wrote:i am also using negative numbered weapon slots for more weapons.
RF2 site: http://realityfactory2.sourceforge.net/
RF2 tasks: http://sourceforge.net/pm/?group_id=179085
RF2 tasks: http://sourceforge.net/pm/?group_id=179085
- fps
- Posts: 504
- Joined: Mon Sep 26, 2005 9:54 pm
- Location: in a magical land devoid of hope, happiness, and sanity.
First off, i dont know how to recompile the RF code but would like sombody to help me to do so.
Seccondly, i still dont know which system to use.
I want some way of a pawn detecting different damage types to seperate health attributes caused by a projectile or enviromental "trap".
Ive seen it done so many times in professional video games that its hard to believe that we cant get around this 1 health attribute problem.
You said that you can have many player attributes, what makes the player so special? how does the player detect all these different things and not a normal pawn? what about the scripted player and the squad combat system? i thought that those scripts had multipule attributes.
Is there a way to have a pawn check for damage of any type and then go into a piece of script that check what type of damage exactly it recieved?
I dont want to use the detect weapon slot system for damages if i can avoid it, because i want to have pawns that are allies to the player, they may have different weapons than that of the player and it would seem odd if a pawn shot with a sniper rifle by an allied pawn caught fire because the player had the flame thrower out.
I do however want to use the detect weapon slot system for pawns hearing or rather not hearing silenced weapons fired by the player.
But that is another topic.
I did have an idea of pawns communicationg with other pawns in the vicinity by the first pawn creating a damage area that causes a special "COMMAND" damage type that triggered other pawns that were hit by it to go to specified orders in their script like "TAKECOVER" or somthing.
But lets work on one problem at a time.
Is there a way for the pawn to cycle through checking for 2 different attributes quickly enough not to be checking for 2 attributes at the same time (which dosent work apparently). like it would say really fast;
CHECK 1
NOCHECK 1
CHECK 2
NOCHECK 2
LOOP
would this work even milidly well if at all?
Thanks,
Fps
Seccondly, i still dont know which system to use.
I want some way of a pawn detecting different damage types to seperate health attributes caused by a projectile or enviromental "trap".
Ive seen it done so many times in professional video games that its hard to believe that we cant get around this 1 health attribute problem.
You said that you can have many player attributes, what makes the player so special? how does the player detect all these different things and not a normal pawn? what about the scripted player and the squad combat system? i thought that those scripts had multipule attributes.
Is there a way to have a pawn check for damage of any type and then go into a piece of script that check what type of damage exactly it recieved?
I dont want to use the detect weapon slot system for damages if i can avoid it, because i want to have pawns that are allies to the player, they may have different weapons than that of the player and it would seem odd if a pawn shot with a sniper rifle by an allied pawn caught fire because the player had the flame thrower out.
I do however want to use the detect weapon slot system for pawns hearing or rather not hearing silenced weapons fired by the player.
But that is another topic.
I did have an idea of pawns communicationg with other pawns in the vicinity by the first pawn creating a damage area that causes a special "COMMAND" damage type that triggered other pawns that were hit by it to go to specified orders in their script like "TAKECOVER" or somthing.
But lets work on one problem at a time.
Is there a way for the pawn to cycle through checking for 2 different attributes quickly enough not to be checking for 2 attributes at the same time (which dosent work apparently). like it would say really fast;
CHECK 1
NOCHECK 1
CHECK 2
NOCHECK 2
LOOP
would this work even milidly well if at all?
Thanks,
Fps
if you don't want to use the weapon slot detect system, then i see only one way:
Make everything a pawn and forget about weapons and damage-area and so on.
I wrote in another topic about the 'interface' allowing every pawn to access every pawn's variables.
Because a scripted player is a pawn itself, this script will work on every pawn and it's allowing to have every pawn(and so on the player) different weapons.
One note left:
A player may have differnent attributes, but it can have just one health attribute.
It is also not possible to switch between them because damage is done at one frame, but switching would take at least one frame, so it might be that either the first, the second or in worst none attribute is affected causing a weapon to make damage only half of the time.
Make everything a pawn and forget about weapons and damage-area and so on.
I wrote in another topic about the 'interface' allowing every pawn to access every pawn's variables.
Code: Select all
DamageOrder[ () //LowLevel
{
switch(WEAPON)
{
case "Gun"
{
self.target_name.HEALTH = self.target_name.HEALTH - GUNDAMAGE;
}
case "Flamethrower"
{
self.target_name.HEALTH = self.target_name.HEALTH - FLAMEDAMAGE*100/self.target_name.FIRERESIST;
}
case "DispelFlameResist" //A spell that reduces FIRERESIST
{
self.target_name.FIRERESIST = self.target_name.FIRERESIST - SPELLDAMAGE;
}
}
} ]
One note left:
A player may have differnent attributes, but it can have just one health attribute.
It is also not possible to switch between them because damage is done at one frame, but switching would take at least one frame, so it might be that either the first, the second or in worst none attribute is affected causing a weapon to make damage only half of the time.
Everyone can see the difficult, but only the wise can see the simple.
-----
-----
- fps
- Posts: 504
- Joined: Mon Sep 26, 2005 9:54 pm
- Location: in a magical land devoid of hope, happiness, and sanity.
yes,
Simply put, yes.
He fixed the game with an executable that allows for multiple attribute checking along with some other cool things.
I am currently trying to get him to send it to me through a friends yahoo messenger on a temporary account this friday but i am not sure he got my last message.
Anyway, i asked him to request that his modifications be made standard in the next RF install.
Thanks,
Fps
Simply put, yes.
He fixed the game with an executable that allows for multiple attribute checking along with some other cool things.
I am currently trying to get him to send it to me through a friends yahoo messenger on a temporary account this friday but i am not sure he got my last message.
Anyway, i asked him to request that his modifications be made standard in the next RF install.
Thanks,
Fps