Is there anyway to make scriptedpawn attack each other like seenplayer function?
They only attack when set bIsPlayer=true, Is that possible to make without bIsPlayer option?
How to make scriptedpawn attack each other?
-
- Adept
- Posts: 388
- Joined: Mon Nov 11, 2013 7:56 am
- Personal rank: Average
- Location: India
-
- Godlike
- Posts: 10510
- Joined: Wed Jul 15, 2009 11:36 am
- Personal rank: coffee addicted !!!
- Location: Cologne, the city with the big cathedral.
-
- Adept
- Posts: 344
- Joined: Fri Nov 06, 2015 10:12 am
- Personal rank: Curious
- Location: St. Cloud, Florida
Re: How to make scriptedpawn attack each other?
Monsters won't attack each other unless you set their attitudeToCreature function to hate. They are hard coded to attack each other if they bump. Some monsters will always attack others based on their attitudeToCreature function.
Otherwise they are default set to ignore each other.
Otherwise they are default set to ignore each other.
"Woah what?! I wish I was recording that...."
-
- Adept
- Posts: 388
- Joined: Mon Nov 11, 2013 7:56 am
- Personal rank: Average
- Location: India
Re: How to make scriptedpawn attack each other?
Correct, Sektor helped me to fix this. Thanks @sektor2111
Auto merged new post submitted 1 minute later
Auto merged new post submitted 1 minute later
In Monster Match, I'm still using the bIsPlayer option for this, Sektor helped me to fix this issue.
-
- Godlike
- Posts: 10212
- Joined: Thu Jun 30, 2011 8:12 pm
- Personal rank: God of Fudge
- Location: Palo Alto, CA
Re: How to make scriptedpawn attack each other?
That hasn't been my experience.SilverSound wrote: ↑Thu Apr 04, 2024 2:01 amMonsters won't attack each other unless you set their attitudeToCreature function to hate
Monsters on their default settings attack each other all the time when they cross paths, except for monsters of the same class. Gasbags won't fight each other but they will fight a Giant Gasbag.
Same with Skaarj...
...though usually it has to be different classes of them.
· http://unreal-games.livejournal.com/
· https://unrealarchive.org/authors/evilgrins.html
· https://www.facebook.com/groups/UTcorps
· https://unrealarchive.org/authors/evilgrins.html
· https://www.facebook.com/groups/UTcorps
Smilies · https://ut99.org/viewtopic.php?f=8&t=13758medor wrote:Replace Skaarj with EvilGrins
-
- Godlike
- Posts: 3746
- Joined: Sat Sep 12, 2015 8:46 pm
Re: How to make scriptedpawn attack each other?
As SilverSound noted "They are hard coded to attack each other if they bump." That's what that video demonstrates - one Skaarj landed on top of another, which means they 'bumped'. Berserkers will attack anything anyway. Monsters of the same class will attack each other sometimes - I recently watched brutes exchanging 'punches', similarly with Skaarj Trooper types.EvilGrins wrote: ↑Thu Apr 04, 2024 6:36 pm Monsters on their default settings attack each other all the time when they cross paths, except for monsters of the same class. Gasbags won't fight each other but they will fight a Giant Gasbag.
Same with Skaarj...
...though usually it has to be different classes of them.
Interestingly subclasses of sektor's SHuman and Barbie's SBHumaneFixesV0 seldom attack each other, even when they do bump - presumably down to their code removing 'bump' though I haven't checked that.
-
- Godlike
- Posts: 6438
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: How to make scriptedpawn attack each other?
For your brain relaxing stuff, you can take in account that ScriptedPawn can recognize some Team position. Even if we have two Mercenaries, they can fight each-other if are on a different team. It's all about a timed control of pawns. Each pawn can claim a Team and then all turns into a bloody battle. The main problem of TEAM and ScriptedPawns are dumb projectiles coming from factory, SkaarjProjectiles are not hurting Skaarj, Rocks won't hurt any titans, Sliths are not corroded by other Sliths and so on. Here is needed a bit of work for different settings, mainly new types of monsters with new projectiles dedicated for certain game-type are better than trying to tweak that poorly written stock ScriptedPawn which in some points is out of any basic logic. You don't know how many things I had to change when I wrote "NsMonster"... SetEnemy code, Attitude problems, Projectiles, some firing stages, a bunch of sanity checks, etc. etc.
After solving damage issue of projectiles, another thing has came up. Some monsters could be hurt be their own projectiles due to their firing offset touching them right during combat states, I had to adjust firing methods using codes from other monsters which do not move during firing stage... I don't remember too many lines of ScriptedPawn code that did not need fixes.
Tweaking Monster for playing MonsterHunt was X times easier than educating them for a real Team-Work because yes, even for MonsterHunt certain things need changes not just plain habits.
After solving damage issue of projectiles, another thing has came up. Some monsters could be hurt be their own projectiles due to their firing offset touching them right during combat states, I had to adjust firing methods using codes from other monsters which do not move during firing stage... I don't remember too many lines of ScriptedPawn code that did not need fixes.
Tweaking Monster for playing MonsterHunt was X times easier than educating them for a real Team-Work because yes, even for MonsterHunt certain things need changes not just plain habits.
-
- Godlike
- Posts: 2923
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: How to make scriptedpawn attack each other?
Gunner and Recon are childs of Humangrant and this is child of SkaarjTrooper which is child of Skaarj. And Skaarj are friendly to all others of the Skaarj family, except Berserker, as you already stated.
Code: Select all
class Skaarj extends ScriptedPawn abstract;
...
function eAttitude AttitudeToCreature(Pawn Other)
{
if ( Other.IsA('Skaarj') )
{
if ( Other.IsA('SkaarjBerserker') )
return ATTITUDE_Ignore;
else
return ATTITUDE_Friendly;
}
else if ( Other.IsA('Pupae') )
return ATTITUDE_Friendly;
else if ( Other.IsA('Nali') )
return ATTITUDE_Hate;
else if ( Other.IsA('WarLord') || Other.IsA('Queen') )
return ATTITUDE_Friendly;
else
return ATTITUDE_Ignore;
}
"If Origin not in center it be not in center." --Buggie
-
- Godlike
- Posts: 6438
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: How to make scriptedpawn attack each other?
You forgot "AttituteTo" where main things are rooted...
"AtitudeToCreature" it's not the first point of combat, for a memory refresh ask EG how Skaarj can also attack themselves - I think it was fixed in 469 because that bug was a total dumbness.
Target here is MMGame, there are used other sort of monsters and then, it's more easy to setup Attitude correctly and... because "SeePlayer" works only against player types, other external actor can develop this getting over Engine limitations because this type of game clearly needs some extra-control not just Pawns working in raw format guided only by Engine - that's not an answer. In a recent MH map which I touched I added an extra tweak for making monsters more active against players (ALL Players not only human Players) and such code I sent to Deepu for adjusting it a bit. There can be operated attacking tasks against the other team (monsters) working smoothly and making monsters to do what is expected. When Engine doesn't help it's not like we cannot do anything, to not forget that even for navigation subject certain things can be improved in a better way than Engine can do and... it works. Do we have a 800 UU limit for join into network ? So what ? We can point Pawn to the nearest node that has Paths, letting Engine to do sucks as it usually do. Monsters here can be educated in a similar format, forget Engine and write codes properly. For the record Not only Engine is capable to execute "SeePlayer", we can call that as well from our script using traces in certain range, exactly like fake touches and all sort of dummies that might help. After "SeePlayer" if memory is not cheating me next one is "SetEnemy" - here also we can have our deal and so on and so forth.
Code: Select all
function eAttitude AttitudeTo(Pawn Other)
{
...
else if ( (TeamTag != '') && (ScriptedPawn(Other) != None) && (TeamTag == ScriptedPawn(Other).TeamTag) )
return ATTITUDE_Friendly;
else
return AttitudeToCreature(Other);
Target here is MMGame, there are used other sort of monsters and then, it's more easy to setup Attitude correctly and... because "SeePlayer" works only against player types, other external actor can develop this getting over Engine limitations because this type of game clearly needs some extra-control not just Pawns working in raw format guided only by Engine - that's not an answer. In a recent MH map which I touched I added an extra tweak for making monsters more active against players (ALL Players not only human Players) and such code I sent to Deepu for adjusting it a bit. There can be operated attacking tasks against the other team (monsters) working smoothly and making monsters to do what is expected. When Engine doesn't help it's not like we cannot do anything, to not forget that even for navigation subject certain things can be improved in a better way than Engine can do and... it works. Do we have a 800 UU limit for join into network ? So what ? We can point Pawn to the nearest node that has Paths, letting Engine to do sucks as it usually do. Monsters here can be educated in a similar format, forget Engine and write codes properly. For the record Not only Engine is capable to execute "SeePlayer", we can call that as well from our script using traces in certain range, exactly like fake touches and all sort of dummies that might help. After "SeePlayer" if memory is not cheating me next one is "SetEnemy" - here also we can have our deal and so on and so forth.