So, Deco don't spawn pawns.

Tutorials and discussions about Mapping - Introduce your own ones!

Re: So, Deco don't spawn pawns.

Postby JackGriffin » Thu Oct 05, 2017 1:00 pm

Red_Fist wrote:He will have a 3 tier deco variable collision field Mega transfer field stereo generator plant deco. :P :P

I'd like to come back to this post in about 3 weeks. You don't even *know* how close to actual you really are.
So long, and thanks for all the fish
JackGriffin
Godlike
 
Posts: 3764
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: So, Deco don't spawn pawns.

Postby Red_Fist » Fri Nov 03, 2017 8:05 pm

OK here is the thing.

I have a good array of pawns, I have walls lined with deco that spawns a pawn if broken.

I have one deadly skaarj that will kill you in one shot (or less LoL)

So I have two problems, once a bot or an enemy breaks one deco, it's like a chain reaction because when they shoot or you shoot a deco it creates more pawns, however not from pawns fighting each other but from so many shots in the room.

The main thing is, is there a way to make all the pawns not die from a skaarj projectile.
In the script is says "zapped" so I added it to some pawns damage type, and set the percent to 100

By doing that those pawns were like super high health and would not die easily, but our ammo is not a damage of zapped, I think it's "exploded"

Well I never messed with damage % or "type" before. Is there a way to at least make my skaarj projectile not damage anyone but players ?
Binary Space Partitioning
Red_Fist
Godlike
 
Posts: 1495
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Postby Barbie » Fri Nov 03, 2017 11:33 pm

Red_Fist wrote:I added it to some pawns damage type, and set the percent to 100
Bad naming leads to wrong assumptions: ReducedDamagePct is not measured in percent but in hundredth of it and so usual values are between 0 and 1. I run into the same trap, see my posting in thread SkaarjTrooper with Warheadlauncher.

Red_Fist wrote:Is there a way to at least make my skaarj projectile not damage anyone but players ?
See stock code of SkaarjProjectile.uc:
Code: Select all
auto state Flying {

   simulated function ProcessTouch (Actor Other, Vector HitLocation) {
   local vector momentum;
   
      if ( ! Other.IsA('SkaarjWarrior') )
      {
         if ( Role == ROLE_Authority )
         {
            momentum = 10000.0 * Normal(Velocity);
            Other.TakeDamage(Damage, instigator, HitLocation, momentum, 'zapped');
         }
         Destroy();
      }
   }
...
I'd use custom projectiles and use "if ( Other.IsA('PlayerPawn') )" instead in line 6.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Barbie
Godlike
 
Posts: 1671
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: So, Deco don't spawn pawns.

Postby Red_Fist » Fri Nov 03, 2017 11:57 pm

Not knowing code, but if I want only scripted pawns to not get hurt ?

Not sure why you put "player"
Binary Space Partitioning
Red_Fist
Godlike
 
Posts: 1495
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Postby Barbie » Sat Nov 04, 2017 2:37 am

Red_Fist wrote:Not knowing code, but if I want only scripted pawns to not get hurt ?
Then use "if ( ! Other.IsA('ScriptedPawn') )" instead in line 6.
Red_Fist wrote:Not sure why you put "player"
My fault: with damage on 'PlayerPawn' only it would not hurt a Bot.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Barbie
Godlike
 
Posts: 1671
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: So, Deco don't spawn pawns.

Postby Red_Fist » Sat Nov 04, 2017 6:22 am

I will try, thanx :thuup:
Binary Space Partitioning
Red_Fist
Godlike
 
Posts: 1495
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Postby sektor2111 » Sat Nov 04, 2017 7:42 am

Discard what are saying people working against bots, botz and the rest. PLAYER CODE IS THIS:
Code: Select all
if ( Pawn(Other) != None && Pawn(Other).bIsPlayer && Pawn(Other).PlayerReplicationInfo != None )

The rest is blabbering. "Other" is actor, it has to be checked if that actor is a pawn (else take in account damaging others - decorations, shootable movers, etc. And then code can be:
Code: Select all
if ( !Other.IsA('ScriptedPawn') )

or
Code: Select all
if (ScriptedPawn(Other) == None)
User avatar
sektor2111
Godlike
 
Posts: 4012
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Postby Red_Fist » Sun Nov 05, 2017 6:59 pm

Well it seems to work, I also redone the Kraal, KraaElite, gasbag jr. my skaarj, and the Slith.

Each one has different code that do the same thing.
So I managed to figure out what to type in for each one.

Working on the Titan bigRock-boulder and should work well, just 4-5 lines in the Titan code to change to the new projectile.
Looks like the Skaarjworrior take care of themselves, but I used "Skaarj" and then Scriptedpawn, for my skaarj. and is working good.

However I did not do all the skaarj for a new projectile so they still hurt other pawns. It might be easy to edit since they all use the same projectile. Same for the Brutes.
I am using only pawns extracted from AKcoop, and those I can't edit code but I don't need them all to not hurt other pawns, mainly ones that shoot straight across shooting height.

I have 2296 breakable decos in the map 255 per deco, at 9 decos. So by adding new pawns and use my stock edited ones, is a big array of pawns and they all don't need to be placed in the map, only a few, just enough to cause a fight as they accidentally break open decos

I have one problem I think the deco is too close to the ground and a fly (or other pawns like a gasbag) when they spawn it seems they are stuck in walking mode and don't get off the ground to fly.
So the collision of the deco needs to be taller, but then they will be off the ground, unless I increase drawscale and collision height, I might have to, and I won't be spawning Titans or queens, but they don't fly, LoL
Binary Space Partitioning
Red_Fist
Godlike
 
Posts: 1495
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Postby sektor2111 » Mon Nov 06, 2017 5:22 am

Red_Fist wrote:I have one problem I think the deco is too close to the ground and a fly (or other pawns like a gasbag) when they spawn it seems they are stuck in walking mode and don't get off the ground to fly.
The decoration code needs a bit of love. Testing if ScriptedPawn spawned bCanFly and setting up physics PHYS_Flying immediately before calling attack.
User avatar
sektor2111
Godlike
 
Posts: 4012
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Postby Red_Fist » Mon Nov 06, 2017 5:11 pm

I didn't officially check, but not all the deco types with flies stay walking, they break and then they fly.

Gasbag has an even larger collision height so I see them not getting off the ground a lot more.

I will try and see if a stacked woodenbox if the top one breaks to see if they fly.

I think it's the same thing as bots underwater, they go from swim to walk if they hit the bottom walking surface.
Binary Space Partitioning
Red_Fist
Godlike
 
Posts: 1495
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Postby Barbie » Mon Nov 06, 2017 6:11 pm

If Actor's collision is set properly, the engine adjusts the spawn coordinates a bit if necessary. So if your wooden box says "Spawn that thing at my pivot point" but there is not enough space, the spawn location is varied a bit until sufficient space is available or spawning will fail. So there is no danger that the spawned thing will stuck in ground.

I also have noticed the effect that they don't fly after spawning, see thread Falling Mantas and Flies. The end of that story was that I have used custom Mantas, Flies and Warlords where I changed
Code: Select all
function TweenToWaiting(float tweentime) {
   // PlayAnim() with a 'Landing' animation is called here, differs depending on Pawn type
   SetPhysics(PHYS_Falling);
}
to
Code: Select all
function TweenToWaiting(float tweentime) {
   TweenToFighter(tweentime);
}
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Barbie
Godlike
 
Posts: 1671
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: So, Deco don't spawn pawns.

Postby Red_Fist » Mon Nov 06, 2017 11:54 pm

I just checked after I increased the pottery collision. I dunno, it seems most of them work, the regular sized deco, and my increased size deco, but the larger deco STILL made a walking fly.

I made my collision 21 , it also might be if I have things to close to walls in some spots, but the problem is not bad, maybe 5% or less might stay walking.
Binary Space Partitioning
Red_Fist
Godlike
 
Posts: 1495
Joined: Sun Oct 05, 2008 3:31 am

Re: So, Deco don't spawn pawns.

Postby sektor2111 » Tue Nov 07, 2017 5:31 pm

Put them to hang in small spots over some object or other more static decorations ?
User avatar
sektor2111
Godlike
 
Posts: 4012
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: So, Deco don't spawn pawns.

Postby Red_Fist » Wed Nov 08, 2017 1:43 am

Ok Mr logfile smart asses

Log: Log file open, 11/07/17 15:46:37
Init: Name subsystem initialized
Init: Detected: Microsoft Windows NT 5.0 (Build: 2195)
Init: Version: 436
Init: Compiled: Oct 24 2000 23:40:18
Init: Command line: Autoplay.unr HWND=131734 -log
Init: Base directory: D:\UTww\System\
Init: Character set: Unicode
Log: Bound to Engine.dll
Log: Bound to Core.dll
Log: Bound to Window.dll
Init: Object subsystem initialized
Init: Computer: APEX8PC
Init: User: Administrator
Init: Memory total: Phys=4194303K Pagef=4194303K Virt=2097024K
Init: Working set: 32000 / 159000
Init: CPU Speed=2698.795482 MHz
Init: CPU Page size=4096, Processors=8
Init: CPU Detected: PentiumPro-class processor (GenuineIntel)
Init: CPU Features: CMov FPU RDTSC PAE MMX KNI

:loool: There you go, whats wrong with my new Bigrock projectile.

It seems all good, it compiled ok, as soon as the map starts you are froze and just sits there, alt cntrl del. no nag screen, nothing.
If I place the boulder it crashes, and if my Titan throws it, it crashes.
I went over the code and I did mess up, but nothing seems complicated, I just filled in the correct actor.

It seems they do get it and do throw it, but it's when it goes into spawnchunks, I will recheck the code again,
If it looks right , then my version of trying to make it not hurt pawns is done wrong.

I will post the section of code, but it's "BigRock" actor code

I did not make a subclass, I made a new bigrock parent and a new boulder1 below, (new names of course)

Still crashed.
__________________
I found it, it referred to the smaller rock in the same class, it should have referred to the bigger rock class.

Then it still didn't work, it killed pawns, so I found a few web pages for syntax and all the other stuff for code.
It says an IF is used mostly to have a true or false result from that line.
So I had the whole wrong idea, line says,, if NOT bigrock AND NOT Titan, (they use the ! for NOT). returns false if both are true.
So all I needed to do was make another IF to include NOT myrock AND NOT Scriptedpawn
So now I have the Stone and normal Titans that don't fight scriptedpawns and the rocks won't damage them, unless it's being slapped or something close up.

But the way I know (knew) if-then, was more like you get a real number or result value or word, not this bool true-false stuff. But now that I see, it's not overly difficult. I put all 4 in one line, but it can't compare like that it just needed another IF below.
____________________
Code: Select all
auto state Flying
{
   function ProcessTouch (Actor Other, Vector HitLocation)
   {
      local int hitdamage;

      if ( Other == instigator )
         return;
      PlaySound(ImpactSound, SLOT_Interact, DrawScale/10);   

      if ( !Other.IsA('N_Boulder') && !Other.IsA('N2_Titan') )

      if ( !Other.IsA('N_Boulder') && !Other.IsA('Scriptedpawn') )

      {
         Hitdamage = Damage * 0.00002 * (DrawScale**3) * speed;
         if ( (HitDamage > 6) && (speed > 150) )
            Other.TakeDamage(hitdamage, instigator,HitLocation,
               (35000.0 * Normal(Velocity)), 'crushed' );
      }
   }


QUESTION ?

So if you want the same effect or other things changed on an actor, do you just copy the per-function areas you want to mess with and paste them in the new subclass ?
So say it's just one tiny thing, In one ,,Function, if I paste only that function section code, is all you need to do ? (not including everything but just for changing code.)
Binary Space Partitioning
Red_Fist
Godlike
 
Posts: 1495
Joined: Sun Oct 05, 2008 3:31 am

Previous

Return to Mapping

Who is online

Users browsing this forum: No registered users and 3 guests