ZoneChange Function... + UnrealShare.Bird1....

Discussions about Coding and Scripting

ZoneChange Function... + UnrealShare.Bird1....

Postby MrLoathsome » Mon Feb 13, 2012 9:21 am

Here is the ZoneChange function that appears in 2 of the States in the default file UnrealShare\Bird1.uc
Code: Select all
   singular function ZoneChange( ZoneInfo NewZone )
   {
      if (NewZone.bWaterZone || NewZone.bPainZone)
      {
         SetLocation(OldLocation);
         Velocity = vect(0,0,0);
         Acceleration = vect(0,0,0);
         MoveTimer = -1.0;
      }
   }


My question is: What was Epics intent here?

In testing, the only thing this seems to do is cause the birds to pause, very briefly, before they proceed to fly around underwater, or fly into the PainZone and die quickly...
They pause is very brief. 1 or 2 tics I believe. (OldLocation is defined in class Actor, and is the pawns location from 1 tic previous)

Does it accomplish something other than that? Am I missing something? Or is it just a bit broken?

I am currently playing around with coding a new type of bird, that acts more like a bird than the default one, and also attacks players and bots.
Wanted them to not chase players into the water or pain zones (slime pits/lava etc). These birds are not penguins, cormorants, ducks etc. and have no
reason to be flying around under water IMHO. If a bird is attacking you, you should be able to escape in the water I would think....
:loool:

I have written a replacement function I am using that accomplishes this. Just want to make sure I am not breaking something else with it.... :what:

Here is the current version of that:
Code: Select all
   singular function ZoneChange( ZoneInfo NewZone )
   {
      if (NewZone.bWaterZone || NewZone.bPainZone)
      {
         SetLocation(OldLocation);
         Velocity.Z *= -1;
         Destination.Z *= -1;
         Enemy = None; GoalActor = None;   // This line only in State where the bird has an Enemy/GoalActor
         MoveTimer = -1.0;
      }
   }


+ 1 extra Smilie that shows how I felt the day I looked at the VictoryDance State code in ScriptedPawn.uc --> :barf:
Last edited by MrLoathsome on Mon Feb 20, 2012 10:36 am, edited 1 time in total.
Download my stuff here: http://ecoop.tk/load/
MrLoathsome
Adept
 
Posts: 373
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: Mooooo !

Re: ZoneChange Function...

Postby Shadow » Mon Feb 13, 2012 10:09 am

It describes the behaviour when the current zone changes for some actor. As noted by yourself, the zonechange function for the bird doesn't do anything really useful... Epic may expected the Bird to never actually fly into water... they could've made a land/swim animation but well.. yeah.. not necessary.
Image
User avatar
Shadow
Masterful
 
Posts: 666
Joined: Tue Jan 29, 2008 12:00 am
Location: Halle (Saale), Germany

Re: ZoneChange Function...

Postby Dr.Flay » Tue Feb 14, 2012 1:14 am

Couldn't you just change the water velocity, to make it very slow under water? or would that go against what you are trying to achieve?
At least you could escape it.
User avatar
Dr.Flay
Godlike
 
Posts: 1112
Joined: Thu Aug 04, 2011 9:26 pm
Location: Kernow, UK
Personal rank: C= AMIGA freak

Re: ZoneChange Function...

Postby MrLoathsome » Tue Feb 14, 2012 1:37 am

That could probably be done easy enough, but my current solution fits better, and makes their behavior more "bird-like".
As Shadow mentioned, land/swim animations would be needed to make that really look and work right.
Download my stuff here: http://ecoop.tk/load/
MrLoathsome
Adept
 
Posts: 373
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: Mooooo !

Re: ZoneChange Function...

Postby Shadow » Tue Feb 14, 2012 1:21 pm

Well you could slow down the animation rate of the fly animation.. would be a mediocre work around + changing velocity
Image
User avatar
Shadow
Masterful
 
Posts: 666
Joined: Tue Jan 29, 2008 12:00 am
Location: Halle (Saale), Germany

Re: ZoneChange Function...

Postby Dr.Flay » Tue Feb 14, 2012 8:39 pm

You really are "going for it" aren't you :rock:
This will be no ordinary flock of birds.
Will they be.. angry birds?...*Groans* (sorry)
User avatar
Dr.Flay
Godlike
 
Posts: 1112
Joined: Thu Aug 04, 2011 9:26 pm
Location: Kernow, UK
Personal rank: C= AMIGA freak

Re: ZoneChange Function...

Postby MrLoathsome » Mon Feb 20, 2012 10:59 am

Dr.Flay wrote:You really are "going for it" aren't you :rock:
This will be no ordinary flock of birds.
Will they be.. angry birds?...*Groans* (sorry)


Correct on all points. Although, there will be 2 types of birds. 1 type will be angry,
the other will just be a better bird.

Looked much closer at the UnrealShare.Bird1.uc source code, decided it could use some tweaking....
The NewBIrds will roam around a bit more, but will still attempt to return to their original spawn location randomly.
I have been trying to adjust their flying/roaming behavior to be more "birdlike" while still using the core
flight code from the original Bird1 pawn.

Also here is the current and probably final revision of the ZoneChange function I am using.
Previously posted one worked most, but not all of the time. This one seems to work always:
Code: Select all
   singular function ZoneChange( ZoneInfo NewZone )
   {
      if (NewZone.bWaterZone || NewZone.bPainZone)
      {
         Velocity.Z *= -1;
         Destination.Z = OldLocation.Z + (90 * FRand()) + 30;
         MoveTimer = -1.0;
         GotoState('MoveToGoal');  // MoveTo(Destination); happens here....
      }
   }
Last edited by MrLoathsome on Wed Mar 14, 2012 6:19 am, edited 1 time in total.
Download my stuff here: http://ecoop.tk/load/
MrLoathsome
Adept
 
Posts: 373
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: Mooooo !

Re: ZoneChange Function... + UnrealShare.Bird1....

Postby papercoffee » Mon Feb 20, 2012 4:35 pm

What really would be awesome ... Bats ... the whole unreal universe known for caves and old rotten facilities do lack of bats!
User avatar
papercoffee
Site Staff
 
Posts: 3300
Joined: Wed Jul 15, 2009 11:36 am
Location: cologne
Personal rank: coffee addicted !!!

Re: ZoneChange Function... + UnrealShare.Bird1....

Postby Dr.Flay » Mon Feb 20, 2012 9:27 pm

papercoffee wrote:What really would be awesome ... Bats ... the whole unreal universe known for caves and old rotten facilities do lack of bats!


F*ck me ! Good idea, I can't believe no one ever thought of bats for Unreal.
We have rats, crows, and even cockroaches, but not the horror classic, the bat! :tu:
User avatar
Dr.Flay
Godlike
 
Posts: 1112
Joined: Thu Aug 04, 2011 9:26 pm
Location: Kernow, UK
Personal rank: C= AMIGA freak

Re: ZoneChange Function... + UnrealShare.Bird1....

Postby MrLoathsome » Tue Feb 21, 2012 11:13 pm

That is a good idea. This AI could be tweaked for bats easily.

Made a lame attempt at a bat-like skin for the bird1 model yesterday, but it was very horrible.
Download my stuff here: http://ecoop.tk/load/
MrLoathsome
Adept
 
Posts: 373
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: Mooooo !

Re: ZoneChange Function... + UnrealShare.Bird1....

Postby MrLoathsome » Wed Mar 14, 2012 6:29 am

Sorry to both bump and continue the hijack of this tread at once... but...

1. Made a slight edit/adjustment to the function posted above. (The SetLocation statement was not needed, and actually caused issues under rare conditions.... It is gone.)

2. I finished (?) or at least released a beta of the NewBirds thing. Available here for TESTING: http://ecoop.ucoz.com/load/newbirds_beta1/1-1-0-45

I like that bat idea a lot, but have zero modeling skills at all it seems.
However, if somebody could make a bat model, and some animations, using the default bird1 as a template, and could supply those files & anim seq. data, I
could probably adapt this NewBIrd AI to work with a bat easily.
Download my stuff here: http://ecoop.tk/load/
MrLoathsome
Adept
 
Posts: 373
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: Mooooo !

Re: ZoneChange Function... + UnrealShare.Bird1....

Postby papercoffee » Wed Mar 14, 2012 8:56 am

Gimmi the UV-map of this Bird and I make you the bat ... the tail can be masked right?
User avatar
papercoffee
Site Staff
 
Posts: 3300
Joined: Wed Jul 15, 2009 11:36 am
Location: cologne
Personal rank: coffee addicted !!!

Re: ZoneChange Function... + UnrealShare.Bird1....

Postby JackGriffin » Wed Mar 14, 2012 1:36 pm

Bird is going to look all wrong with a bat skin. Bats should flutter and flit a lot and not glide and soar like the bird does. You'd be better served maybe massaging the butterfly into a bat.
JackGriffin
Godlike
 
Posts: 1729
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: Retired as of Sep-11

Re: ZoneChange Function... + UnrealShare.Bird1....

Postby papercoffee » Wed Mar 14, 2012 2:30 pm

well ....sounds even better.
User avatar
papercoffee
Site Staff
 
Posts: 3300
Joined: Wed Jul 15, 2009 11:36 am
Location: cologne
Personal rank: coffee addicted !!!

Re: ZoneChange Function... + UnrealShare.Bird1....

Postby Dr.Flay » Thu Mar 15, 2012 1:08 am

Butter-bats anyone :D
User avatar
Dr.Flay
Godlike
 
Posts: 1112
Joined: Thu Aug 04, 2011 9:26 pm
Location: Kernow, UK
Personal rank: C= AMIGA freak

Next

Return to Coding, Scripting

Who is online

Users browsing this forum: No registered users and 1 guest