|
Hyper.nl Unreal Services The forum of Hyper.nl Unreal Services and the semi-offical resource for Winged Unicorn's Unreal mods
|
View previous topic :: View next topic |
Author |
Message |
srbassalot
Joined: 16 Sep 2004 Posts: 229 Location: Earth
|
Posted: Wed Feb 18, 2009 2:21 pm Post subject: A scripted pawn that..... |
|
|
Ok here's what I'm up to lately....I'm scripting a pawn to spawn other pawns while that pawn is still alive.....so it's not a psi spawn or dropped when killed situation. I want a Tentacle to spawn other Tentacles around it on a continuous basis up to a certain point. I have done just that BUT I have one small problem and not sure where to go from here.
It spawns them at the same height of the original but it sometimes spawns them out in the open and I want them only on the ceiling.
I have NO clue how to contain them just to ceilings of the surrounding brushes.....
I realize this is pretty damn vague but I thought some of you, maybe Bleeder :-) would have an idea to point me in the right direction...
Thanks guys.. |
|
Back to top |
|
|
Bleeder91
Joined: 28 Sep 2006 Posts: 265
|
Posted: Wed Feb 18, 2009 9:48 pm Post subject: |
|
|
kinda like my unreallity pawn called skaarjcabalist.. spawns tiny demon skaarjs that mass together and smash ya... well ill give you some tips:
Code: |
local vector X,Y,Z;
local spawnedtentacle T;
GetAxes(RotRand()*rot(0,1,0),X,Y,Z);
T = spawn(class'spawnedtentacle',,,Location+CollisionRadius+T.CollisionRadius,RotRand()*rot(0,1,0));
if(t != None)
{
T.SetCollision(True,True,True);
T.SetPhysics(PHYS_Projectile);
T.Velocity.Z = 10000;
}
|
this should spawn that tentacle somewhere around it when there is room, havent tested it with editor so i don know if it will give errors
anyway, the spawnedtentacle should act like a proj and move upwards rapidly until it hits the roof. i dont think the spawnedtent needs something to set its physics back to rotating or sumthing, just try it out. i gotta go now, time for a nap _________________ Unreallity - Wrath of the Skaarj is still developing! Check out the new refreshing website!
|
|
Back to top |
|
|
mental-HunteR
Joined: 05 May 2006 Posts: 363 Location: The Netherlands
|
Posted: Thu Feb 19, 2009 10:18 am Post subject: |
|
|
A less realistic but easier way is to just make a projectile that spawns the pawn. _________________
|
|
Back to top |
|
|
srbassalot
Joined: 16 Sep 2004 Posts: 229 Location: Earth
|
Posted: Thu Feb 19, 2009 11:36 am Post subject: |
|
|
Thanks as always Bleeder I'm having problems getting it to compile, here are the errors I'm seeing>>>>
GetAxes(RotRand()*rot(0,1,0),X,Y,Z); (ERROR>> Types are incompatible with '*'
When changed to >>>GetAxes(Rotation,X,Y,Z); (just to get past that error)
I get an error in the next line>>>
T = spawn(class'spawnedtentacle',,,Location+CollisionRadius+T.CollisionRadius,RotRand()*rot(0,1,0));
(ERROR >>> Types are incompatible with '+'
Not sure what to do there?
Thanks for that idea Mental I may try that :-) |
|
Back to top |
|
|
mental-HunteR
Joined: 05 May 2006 Posts: 363 Location: The Netherlands
|
Posted: Thu Feb 19, 2009 11:44 am Post subject: |
|
|
Try replacing the +'s with *'s. _________________
|
|
Back to top |
|
|
mental-HunteR
Joined: 05 May 2006 Posts: 363 Location: The Netherlands
|
Posted: Thu Feb 19, 2009 11:51 am Post subject: |
|
|
Or try using the Giantgasbag spawning function, like this:
Put this variable at the other variables at the top of the script:
Code: |
var Spawnedtentacle ParentTent;
|
Code: |
function SpawnBelch()
{
local SpawnedTentacle T;
local vector X,Y,Z, projStart;
local actor P;
GetAxes(Rotation,X,Y,Z);
projStart = Location + 0.5 * CollisionRadius * X - 0.3 * CollisionHeight * Z;
if ( (numChildren > 1) || (FRand() > 0.2) )
{
P = spawn(RangedProjectile ,self,'',projStart,AdjustAim(ProjectileSpeed, projStart, 400, bLeadTarget, bWarnTarget));
if ( P != None )
P.DrawScale *= 2;
}
else
{
T = spawn(class 'SpawnedTentacle' ,,'',projStart + (0.6 * CollisionRadius + class'SpawnedTentacle'.Default.CollisionRadius) * X);
if ( T != None )
{
T.ParentTent = self;
numChildren++;
}
}
}
|
And about the projectile that spawns a pawn, you can simple add a local in the exploding function like this i did with the rocket script, which looked like this:
Code: |
simulated function Explode(vector HitLocation, vector HitNormal)
{
local babyskaarj s;
local RingExplosion3 r;
local energyburst e;
local pawnteleporteffect p;
s = spawn(class'BabySkaarj');
e = spawn(class'EnergyBurst',,,HitLocation + HitNormal*16);
p = spawn(class'PawnTeleportEffect',,,HitLocation + HitNormal*16);
if (bRing)
{
r = Spawn(class'RingExplosion3',,,HitLocation + HitNormal*16,rotator(HitNormal));
r.RemoteRole = ROLE_None;
}
BlowUp(HitLocation, r);
Destroy();
}
|
To make it spawn your spawnedtentacles you simple change "BabySkaarj"
into SpawnedTentacle, wich will look like this:
Code: |
simulated function Explode(vector HitLocation, vector HitNormal)
{
local SpawnedTentacle s;
local RingExplosion3 r;
local energyburst e;
local pawnteleporteffect p;
s = spawn(class'SpawnedTentacle');
e = spawn(class'EnergyBurst',,,HitLocation + HitNormal*16);
p = spawn(class'PawnTeleportEffect',,,HitLocation + HitNormal*16);
if (bRing)
{
r = Spawn(class'RingExplosion3',,,HitLocation + HitNormal*16,rotator(HitNormal));
r.RemoteRole = ROLE_None;
}
BlowUp(HitLocation, r);
Destroy();
}
|
**AND VERY IMPORTMANT, by Advanched at Properties, change Bnettemporary to False. else he could possibly not be killed somehow online, that's what i had.
The annoying thing about this is that if you dont kill the parentpawn fast enough, you will have alot of spawnedtentacles scattered all over the map, to avoid this you can always lower the animation speed of the parentpawn, its just what you want it to do. _________________
|
|
Back to top |
|
|
srbassalot
Joined: 16 Sep 2004 Posts: 229 Location: Earth
|
Posted: Thu Feb 19, 2009 12:11 pm Post subject: |
|
|
WOW Mental you've given me a lot of good options !!!
THANKS BRO :-)
I'll let you know how it works out...
Bass |
|
Back to top |
|
|
srbassalot
Joined: 16 Sep 2004 Posts: 229 Location: Earth
|
Posted: Thu Feb 19, 2009 5:19 pm Post subject: |
|
|
mental-HunteR wrote: | Try replacing the +'s with *'s. |
OK first things first :-)
That still gave the same error so I tried your other idea about using a projectile ( I'm already using a script very similar to the gasbag script) and it's a very novel approach, I never would have thought of it for sure and it works great but it has the same problem......they go wherever the tentaclespawner "shoots" them which is very rarely on a ceiling. Is there a way I can keep them from spawning out in the open....let's face it, a tentacle out in the open doesn't exactly look realistic :-)
Thanks Mental.... |
|
Back to top |
|
|
Bleeder91
Joined: 28 Sep 2006 Posts: 265
|
|
Back to top |
|
|
srbassalot
Joined: 16 Sep 2004 Posts: 229 Location: Earth
|
Posted: Thu Feb 19, 2009 6:25 pm Post subject: |
|
|
Bleeder91 wrote: | hmm ya i expected those errors.. i always forget what to put in it; is it vector, is it rotator.. anyways,
Code: |
getaxes(rot(0,1,0)*rand(16384),X,Y,Z);
|
works, replace that |
Yep that works but what about>>>
T = spawn(class'spawnedtentacle',,,Location+CollisionRadius+T.CollisionRadius,RotRand()*rot(0,1,0));
I still get the error about "(ERROR >>> Types are incompatible with '+'"
and I tried "*" as a replacement an it gives the same error?
Thanks Bleeder... :-) |
|
Back to top |
|
|
Bleeder91
Joined: 28 Sep 2006 Posts: 265
|
|
Back to top |
|
|
srbassalot
Joined: 16 Sep 2004 Posts: 229 Location: Earth
|
Posted: Thu Feb 19, 2009 8:27 pm Post subject: |
|
|
Cool I'll try that when I get home from work I can't write any more code right now I think I'm getting a UScript brain tumor LOL
thanks buddy I'll let you know how it works out...
Bass ;-) |
|
Back to top |
|
|
mental-HunteR
Joined: 05 May 2006 Posts: 363 Location: The Netherlands
|
Posted: Fri Feb 20, 2009 9:58 am Post subject: |
|
|
Didn't you tried the gasbag script? as far as i readed you only tryd the projectile thing. _________________
|
|
Back to top |
|
|
srbassalot
Joined: 16 Sep 2004 Posts: 229 Location: Earth
|
Posted: Fri Feb 20, 2009 1:13 pm Post subject: |
|
|
mental-HunteR wrote: | Didn't you tried the gasbag script? as far as i readed you only tryd the projectile thing. |
Yea like I said I'm already using a script very similar to the gasbag script and I'm trying to include the proper code so they are placed on ceilings...
I tried using both yours and Bleeders scripts but it doesn't seem to help, I'm sure it's most likely me but just not sure what to do at this point....*banging head on wall* :-P
Bass |
|
Back to top |
|
|
mental-HunteR
Joined: 05 May 2006 Posts: 363 Location: The Netherlands
|
Posted: Fri Feb 20, 2009 3:53 pm Post subject: |
|
|
If you want them so spawn like gasbags spawn from a giantgasbag just send the files to me. _________________
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|