Multiple health/damage attributes.

Topics regarding Scripting with Reality Factory
User avatar
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.

Post by fps » Mon Nov 21, 2005 11:38 am

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

Guest

Post by Guest » Wed Nov 23, 2005 2:49 pm

A pawn will suffer damage to any atribute you give it with AddAttributeOrder(). THe attribute that the weapon damges is defined in weapon.ini under the projectile definition that it uses.

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay » Thu Nov 24, 2005 11:08 am

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.
Everyone can see the difficult, but only the wise can see the simple.
-----

User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR » Thu Nov 24, 2005 4:08 pm

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?

GD1
Posts: 413
Joined: Tue Jul 05, 2005 2:33 pm

Post by GD1 » Fri Nov 25, 2005 8:54 pm

a logic gate could even be used for that purpose.
Check out my band
Tougher Than Fort Knox
Image

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay » Mon Nov 28, 2005 3:33 pm

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:

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
} ]
Enjoy!!!
Everyone can see the difficult, but only the wise can see the simple.
-----

User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps » Wed Nov 30, 2005 9:07 pm

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

User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR » Wed Nov 30, 2005 9:47 pm

fps wrote:i am also using negative numbered weapon slots for more weapons.
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...

User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps » Thu Dec 01, 2005 4:52 pm

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

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay » Tue Dec 06, 2005 11:30 am

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.

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;
}
}
} ]
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.
Everyone can see the difficult, but only the wise can see the simple.
-----

User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps » Wed Dec 07, 2005 4:38 pm

Lupus is helping me with a multi attribute checking mod for the rf engine so i dont know if i will need to use all of this any more.

Thanks,
FPS

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay » Wed Dec 07, 2005 6:03 pm

You mean a multi-attribute-checking by code and not by script? So that all we have to do is make more than one attribute?
Everyone can see the difficult, but only the wise can see the simple.
-----

User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps » Thu Dec 08, 2005 4:21 pm

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

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay » Thu Dec 08, 2005 5:14 pm

ahh. that's good news.
Everyone can see the difficult, but only the wise can see the simple.
-----

User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

Post by fps » Thu Dec 08, 2005 7:04 pm

yes i know,
it is a great solution to my problem.
Lupis has been a great help to my development team.

Thanks,
Fps

Post Reply