PDA

View Full Version : Subclassing Adrenaline


King Mango
08-20-2004, 07:45 PM
I want to have an adreanaline pickup where the amount of adrenaline can be specified in UED. I tried this but still only get two adrenaline when I pickup.

I get the var in the properties window but I must be using the wrong name(AdrenalineAmount) for the property?

SuperApe
08-21-2004, 12:55 AM
I want to have an adreanaline pickup where the amount of adrenaline can be specified in UED.


//=============================================================================
// SuperAdrenalinePickup.
//=============================================================================
class SuperAdrenalinePickup extends AdrenalinePickup
placeable;

var() int SuperAmount; // new AdrenalineAmount

simulated function PostBeginPlay()
{
AdrenalineAmount = SuperAmount;
}

King Mango
08-21-2004, 01:15 AM
Why am I not surprised? lol thx very much Ape. :D

I actually started playing around with AdrenalineAmount= but couldn't figure out anything.

SuperApe
08-21-2004, 01:25 AM
Why am I not surprised? lol thx very much Ape. :D

I actually started playing around with AdrenalineAmount= but couldn't figure out anything.
You had the name right, but the name has already been defined in the parent class. You can't redefine a variable.
So, you could simply set AdrenalineAmount as N in the code.
( PostBeginPlay() { AdrenalineAmount = 75 }; )
Or you could define a new variable (Super), let that be accessible to the user, and then assign it as I did. (Btw, the syntax is, "var() <type> <name>", for user-accessible variables.)

Lord_Simeon
09-21-2004, 07:28 PM
I'm glad i remembered this thread, SuperApe....YOU RULE :D

I just went through the same trouble as the King, but then remebered about your code fix. :D

Aquablue
09-22-2004, 08:34 AM
Awesome stuff mr. Ape. Thank you very much. :)

Lord_Simeon
09-22-2004, 08:40 AM
LOL, after stuffing around for an hour trying to get my spawner working (my health spawner worked no worries, the adrenaline didn't) i finally remembered that ADR isn't used in ONS.
I converted to a sheild pickup instead.......still, top stuff Mr Ape, i used your code and it worked a treat for the ADR pickups, just not in my ONS map....lol. :D

Zinia
09-22-2004, 08:46 AM
LOL, after stuffing around for an hour trying to get my spawner working (my health spawner worked no worries, the adrenaline didn't) i finally remembered that ADR isn't used in ONS.
I converted to a sheild pickup instead.......still, top stuff Mr Ape, i used your code and it worked a treat for the ADR pickups, just not in my ONS map....lol. :D

You keep that adrenaline shtuff out of ONS. :evil:

SuperApe
09-22-2004, 12:38 PM
It was my pleasure.
Coding is fun when you're helping.

NOS
09-22-2004, 12:40 PM
coding isnt fun if you suck at it

<<<

im buggered on a script, anyone able to help with MSN or something?

Blitz
10-06-2004, 07:50 AM
A few notes...you can still edit variables that don't normally show up in the properties.

After placing the object in your level, look at its Object->Name property. For example, it might be: AdrenalinePickup28

Then in the command line at the bottom of the editor, type: editobj AdrenalinePickup28

You will be able to set the AdrenalineAmount in the "None" section of the properties box that pops up.

Alternatively, if you decide to write your own adrenaline subclass, you can change the default AdrenalineAmount by typing:

editdefault class=mylevel.MyAdrenalinePickup

You shouldn't need any code in your subclass other than the class declaration.

Note: Do NOT change the default value of the actual adrenaline class, as that would cause a binary change to a default Epic package (if you were to save the package). Always create a subclass in order to alter default values.

King Mango
02-28-2005, 02:22 PM
is it just me or is the 'use' button in editdefault properties box broken?
I can't even type in certain things. I am trying to add a horn sound to a subclassed space fighter and it won't let me even type anything in.
I WAS able to change the crosshairs by modifying the existing string to the name of the tex I wanted. (well, haven't actually TESTED that in game, but it didn't change back to the original when I deactivated that field)

Also, anyone have problems with the sound browser only playing sounds when you close the browser?
Anybody want to buy an Audigy2 gamer cheap?