Main

Forums

Wiki

Downloads

Tutorials

Walkthrough

Unreal-netiquette

Links

Submit-News

Oldunreal's hosted:
UnrealReference

Usermaps

Real-CTF

Donate for Oldunreal:

Oldunreal Donation
Oldunreallogo
  Welcome, Guest. Please Login or Register
 
  HomeHelpSearchLoginRegister  
 
 
*Scripting Issues* Redicules!!! (Read 1501 times)
Blu3Haz3
Full Member
***
Offline


Oldunreal member

Posts: 205
Gender: male
*Scripting Issues* Redicules!!!
03/07/12 at 06:03:09
 
Hey guys, I'm having trouble with something really silly.  As I've made plenty of things in the past... I cannot simply get my
child class
SuperFly of
parent class
Fly to spawn any kind of Pawn.  However, it will work otherwise...
it works spawning health, inventory, decals etc
... I'm sure everyone in here has encountered this and got passed this LONG ago lol


::My Script::


// SuperFly.
//=============================================================================
class SuperFly expands Fly;


function PlayDying(name DamageType, vector HitLocation)
{
local Fly s;

log( "Spawned the bitch" );
     

s = spawn(class'Fly',,,Location);
s.RemoteRole = ROLE_None;

}
Back to top
« Last Edit: 03/07/12 at 06:09:10 by Blu3Haz3 »  
 
IP Logged
 
Blu3Haz3
Full Member
***
Offline


Oldunreal member

Posts: 205
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #1 - 03/07/12 at 06:07:39
 
BTW! It does show "Spawned the Bitch" in the log when the pawn has entered the state of dying...  PlayDying is a predefined function in the engine...
Back to top
« Last Edit: 03/07/12 at 06:09:55 by Blu3Haz3 »  
 
IP Logged
 
[UDHQ] Pcube
Ex Member


Re: *Scripting Issues* Redicules!!!
Reply #2 - 03/07/12 at 06:13:44
 
[s]function ThisWillWork( byte i )
{
switch( i )
{
case 0:
setcollision(false,false,false);
ThisWillWork( 3);
break;

case 1:
if( self == self )
ThisWillWork( 2);
break;

case 2:
setcollision(true,true,true);
ThisWillWork( 55);
break;

case 3:
log(self);
spawn(class'fly');// long LIVE THE SUPER FLy
ThisWillWork( 1);
break;
default:
return;
}
}
[/s]
Back to top
« Last Edit: 03/07/12 at 06:29:26 by N/A »  
 
IP Logged
 
[]KAOS[]Casey
Oldunreal MasterPoster
******
Offline


nedm

Posts: 2893
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #3 - 03/07/12 at 06:16:20
 
Why exactly are you spawning it and setting it's role to role none? And there's no not null check..

Also, use Died instead of PlayDying and call super.

I don't recommend setting the fly to have no remote role.
Back to top
 
 
IP Logged
 
[]KAOS[]Casey
Oldunreal MasterPoster
******
Offline


nedm

Posts: 2893
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #4 - 03/07/12 at 06:19:35
 
   

 
Back to top
 
 
IP Logged
 
Blu3Haz3
Full Member
***
Offline


Oldunreal member

Posts: 205
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #5 - 03/07/12 at 06:39:46
 
[]KAOS[]Casey wrote on 03/07/12 at 06:16:20:
Why exactly are you spawning it and setting it's role to role none? And there's no not null check..

Also, use Died instead of PlayDying and call super.

I don't recommend setting the fly to have no remote role.


Alright, I'll give that a shot... btw... answering towards the net role... I chose none unaware as to what any of the net roles were.  I tried each one previously and had literally no change in effect...

As for pcube's case statement, idk if it was a joke... but I was originally trying to spawn a Fly which already has a set Collision and it also was intended to spawn after the pawn is killed.  IDK, if maybe the script doesn't work because two pawns cannot collide with either other.  Or if maybe its some other issue, I think I could use part of Pcube's case statement for the issue.  But, figuring out how to plug it in might be a little harder...
Back to top
 
 
IP Logged
 
Blu3Haz3
Full Member
***
Offline


Oldunreal member

Posts: 205
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #6 - 03/07/12 at 06:51:44
 
Hey, the died function and its paramaters are set... however I didn't know where to put the Super at.

I know how to use it and what Super means... however I don't see where it could be used... please elaborate for me Smiley

I tried... "
Super.(s) = spawn(class'Fly',,, start + 8 * VRand() );
"

However I got an error before I tried that Super, stating how it is a unknown function in Fly...


I also got an error in the log file
"ScriptWarning: SuperFly Unreal.SuperFly1 (Function majesticpawns.SuperFly.Died:0023) Accessed None 'S' "
Back to top
« Last Edit: 03/07/12 at 07:16:05 by Blu3Haz3 »  
 
IP Logged
 
Blu3Haz3
Full Member
***
Offline


Oldunreal member

Posts: 205
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #7 - 03/07/12 at 07:04:52
 
Quote:
[s]function ThisWillWork( byte i )
{
switch( i )
{
case 0:
setcollision(false,false,false);
ThisWillWork( 3);
break;

case 1:
if( self == self )
ThisWillWork( 2);
break;

case 2:
setcollision(true,true,true);
ThisWillWork( 55);
break;

case 3:
log(self);
spawn(class'fly');// long LIVE THE SUPER FLy
ThisWillWork( 1);
break;
default:
return;
}
}
[/s]



Well, I'll give it a shot dude... thanks.  I'm certainly a noob scripter, whether or not I can read it... I certainly still can't write it.  But it is hard to know what and how things can be done without reference other than newer scripting languages...

--Update--

It didn't work, however I did like some of the stuff involved...
Back to top
« Last Edit: 03/07/12 at 07:10:36 by Blu3Haz3 »  
 
IP Logged
 
Bleeder91[NL]
God Member
*****
Offline


Personal Text:

Posts: 780
Location, Location, Location.
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #8 - 03/07/12 at 08:59:02
 
Code (C++):
function Died(pawn Killer, name damageType, vector HitLocation)
{
	local Fly S;

	Super.Died(Killer, damageType, HitLocation);
	if(Self.Destroy())
	{
		S = Spawn(class'Fly',,,Location);
		if(S != None)
			log("Spawned the bitch");
	}
} 

Back to top
 
WWW WWW Bleeder91[NL]  
IP Logged
 
Blu3Haz3
Full Member
***
Offline


Oldunreal member

Posts: 205
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #9 - 03/07/12 at 14:45:30
 
Bleeder91[NL] wrote on 03/07/12 at 08:59:02:
Code (C++):
function Died(pawn Killer, name damageType, vector HitLocation)
{
	local Fly S;

	Super.Died(Killer, damageType, HitLocation);
	if(Self.Destroy())
	{
		S = Spawn(class'Fly',,,Location);
		if(S != None)
			log("Spawned the bitch");
	}
} 



AHH! YES Cheesy

Thanks dude, totally worked out... and I see why you used null and what not.  I had originally also done something like... if(health <= 0)... do...
But that didn't work out... however thanks man.  Everything in this script has been successful 8)
Back to top
 
 
IP Logged
 
Blu3Haz3
Full Member
***
Offline


Oldunreal member

Posts: 205
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #10 - 03/07/12 at 15:04:40
 
I made another script so I can do multiple ones at once, with different locations....



var Vector myLocation;





function Died(pawn Killer, name damageType, vector HitLocation)
{
     local Fly S;
     local RingExplosion RE1;
     local RingExplosion2 RE2;
     local RingExplosion3 RE3;
     local RingExplosion4 RE4;
     local vector Start,X,Y,Z;

     Super.Died(Killer, damageType, HitLocation);
     if(Self.Destroy())
     {

           myLocation = Location;
           myLocation.X += 28;
           myLocation.Y += 25;
           myLocation.Z += 23;
           S = Spawn(class'Fly',,,myLocation);

           myLocation.X -= 33;
           myLocation.Y += 34;
           myLocation.Z += 31;

           S = Spawn(class'Fly',,,myLocation);

           myLocation.X -= 50;
           myLocation.Y += 55;
           myLocation.Z += 66;

           S = Spawn(class'Fly',,,myLocation);

           myLocation.X -= 66;
           myLocation.Y += 34;
           myLocation.Z -= 88;

           S = Spawn(class'Fly',,,myLocation);



           RE1 = Spawn(class'RingExplosion',,,Location);
           RE2 = Spawn(class'RingExplosion2',,,Location);
           RE3 = Spawn(class'RingExplosion3',,,Location);
           RE4 = Spawn(class'RingExplosion4',,,Location);
                 log("Spawned the bitch");
     }
}

Back to top
« Last Edit: 03/07/12 at 15:32:29 by Blu3Haz3 »  
 
IP Logged
 
.:..:
Developer Team
Offline



Posts: 1239
Finland
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #11 - 03/07/12 at 16:50:15
 
...
Back to top
« Last Edit: 03/07/12 at 16:50:25 by .:..: »  
.:..: 345236034 mhulden  
IP Logged
 
Blu3Haz3
Full Member
***
Offline


Oldunreal member

Posts: 205
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #12 - 03/07/12 at 16:56:38
 
.:..: wrote on 03/07/12 at 16:50:15:


Yeah, I should had been able to figure this stuff out before.  Though, I don't know what all of these different parameters means... and the scripting language is strict on what could be used.

I mean I don't know why
if(health <= 0)
wouldn't work and... 
Self.Destroyed()
would...

Back to top
« Last Edit: 03/07/12 at 17:01:03 by Blu3Haz3 »  
 
IP Logged
 
GreatEmerald
Oldunreal MasterPoster
******
Offline


The Great Emerald

Posts: 5199
Vilnius, Lithuania
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #13 - 03/07/12 at 21:09:56
 
Checking a pawn's health is generally a bad idea. They could be dead, yet have health - that often happens with regeneration mods, for example. Also, the Destroyed() function sends an event on death - that means you don't have to monitor the pawn constantly, which means saved resources and possibly network bandwidth.
Back to top
 

... - Unreal II Combat Assault Rifle
My own website (GreatEmerald's Domain)!
...
WWW WWW  
IP Logged
 
Bleeder91[NL]
God Member
*****
Offline


Personal Text:

Posts: 780
Location, Location, Location.
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #14 - 03/07/12 at 21:35:55
 
Dots made a non-constructive post?!?!
...
Back to top
« Last Edit: 03/07/12 at 21:36:49 by Bleeder91[NL] »  
WWW WWW Bleeder91[NL]  
IP Logged
 
[]KAOS[]Casey
Oldunreal MasterPoster
******
Offline


nedm

Posts: 2893
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #15 - 03/07/12 at 22:43:54
 
God damnit guys.
...

Code:
//=============================================================================
// GigaSuperUltraFly9000TurboGoldEdition.
// The best fly ever created bar NONE.
// This Fly contains essential asserts to correct invalid claims as made by the thread.
// If any of these asserts fail, the universe is doomed forever. It was nice knowing some of you.
//=============================================================================
class GigaSuperUltraFly9000TurboGoldEdition expands Fly;

const Events = "Don't Execute Every Frame";
const Ticks = "Execute Every Frame";
const NonReplicatedFunctions = "Don't Use Bandwidth";
const ReplicatedFunctions = "Use Bandwith";
const LessThanOrEqualToZeroHealth = "It's Dead";
const GreaterThanZeroHealth = "It's Alive";



final function SpawnMass(Class<Actor> A,int TotalCount)
{
	local actor			Spawnee;
	local vector		spawnPos;
	local vector		center;
	local rotator		direction;
	local int			maxTries;
	local int			numTries;
	local float	        maxRange;
	local float	        range;
	local float 		Angle;
	local int			count;

	maxTries = TotalCount*4;
	count = 0;
	numTries = 0;
	maxRange = sqrt(totalCount/Pi)*4*A.Default.CollisionRadius;

	direction = Rotation;
	direction.pitch = 0;
	direction.roll  = 0;
	center = Location + Vector(direction)*(maxRange+A.Default.CollisionRadius+CollisionRadius+20);
	while ((count < totalCount) && (numTries < maxTries))
	{
		angle = FRand()*Pi*2;
		range = sqrt(FRand())*maxRange;
		spawnPos.X = sin(angle)*range;
		spawnPos.Y = cos(angle)*range;
		spawnPos.Z = 0;
		spawnee = spawn(A,,,center+spawnPos);
		if (spawnee != None)
			count++;
		numTries++;
	}
}

function Destroyed()
{
	local string Died;

	/*
	==============================
	Start Asserts to check if the Thread is valid.
	*/
	Assert(Events != Ticks);
	Assert(NonReplicatedFunctions != ReplicatedFunctions);
	Assert(LessThanOrEqualToZeroHealth != GreaterThanZeroHealth);

	Died= Events @ NonReplicatedFunctions;
	Assert(Died != ReplicatedFunctions);
	Assert(Died != Ticks);
	/*
		End Asserts! the thread is now validated!
	*/
	SpawnMass(Class'Fly',3);
	Spawn(class'RingExplosion',,,Location);
    Spawn(class'RingExplosion2',,,Location);
    Spawn(class'RingExplosion3',,,Location);
    Spawn(class'RingExplosion4',,,Location);
    Super.Destroyed();
}
 

Back to top
« Last Edit: 03/07/12 at 23:03:18 by []KAOS[]Casey »  
 
IP Logged
 
Blu3Haz3
Full Member
***
Offline


Oldunreal member

Posts: 205
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #16 - 03/08/12 at 01:51:22
 
that last one post made me laugh, i've got a long ways to go before I am a scripter.  Though since I can model, sfx design, map, texture for objects and world, and getting into scripting.  Without a doubt I will be able to release more and more mods to Unreal, and its possible I might be moving the Inf 3.0 mod to UT3 or UDK.  I'd be doing a lot of crap just to avoid limitations on Unreal.

I recently tried uploading a custom weapon model I made and its animations, and it worked fine.  The sadness of the matter is that I don't have internet at my home anymore so I wont be around unless its important.  I may be releasing some visuals on something I've got going... that wont be using original meshes and textures from Unreal.

Either way, thanks for your support guys... I certainly hope this community lasts while I'm gone. 


Back to top
 
 
IP Logged
 
[UDHQ] Pcube
Ex Member


Re: *Scripting Issues* Redicules!!!
Reply #17 - 03/08/12 at 04:21:15
 


btw evo sorry to hear that. Good luck on your projects. Keep us posted. Smiley
Back to top
« Last Edit: 03/08/12 at 04:59:08 by N/A »  
 
IP Logged
 
Hellkeeper
Oldunreal MasterPoster
******
Offline



Posts: 1819
France
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #18 - 03/08/12 at 22:15:51
 
Quote:


I don't even know what I'm looking at.
Back to top
 
WWW WWW  
IP Logged
 
Blu3Haz3
Full Member
***
Offline


Oldunreal member

Posts: 205
Gender: male
Re: *Scripting Issues* Redicules!!!
Reply #19 - 03/11/12 at 01:23:00
 
Quote:


btw evo sorry to hear that. Good luck on your projects. Keep us posted. Smiley


Most thanks Pcube! I will do that of course, atm... I turned the Super Fly into a fly that shoots laser beams from its eyes.  I'm finishing up a UV Map for a gun model I made, which the gun will be just like a flak cannon... but will fire multiple frag shells instead of flaks.  The gun will be called the HECannon which shoots multiple highly explosive rounds like a mix of the CAR Rifle and the Flak Cannon.  The other gun shoots asmd cores faster if you left tap and right tap your mouse buttons simultaneously one after another.  Though if you only left or right fire repeatedly, it will take longer.  There will be another gun that does the same thing but shoots the primary fire of the ASMD.  Otherwise, I don't know all of what I will be working on.  I do have an Amplifier that regenerates on deactivation... multiple Chem Light items that you can attach to your self or throw.  Which is useful for exposing rooms that have already been entered or breached.  Or could for example be used for personal use, such as teams or recognition of players.  I don't know what else I'll be doing, but I want to really make this project something people can play offline and online.  I may be making my own pathnodes for AI to follow offline and online, so players can have helpers.

Lots of ideas, lots of studying.  By the end of this project, which could take a year... but I would love to have control over AI's actions... such as maybe giving a dialog box to make AI activate specific items... or tell them to do different things.  idk if that is all possible, considering most of the AI Pathing is in the core and engine.
Back to top
 
 
IP Logged
 
(Moderators: Smirftsch, TCP_Wolf, Smartball, pÍtßűll, DieHard SCWS)