If you are interested here is my code for the pickup. Not much there but this seemed to be the only way that worked for me getting the Pawn:
class PointPickup extends Actor placeable ClassGroup(GenericMenus, Placeables) HideCategories(Advanced, Movement, Display, Attachment, Collision, Physics, Debug, Mobile); var(Points) int Points; var GenericPC GPC; var GenericPawn GP; event Touch(Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal) { GPC = GenericPC(GetALocalPlayerController()); GP = GenericPawn(GPC.Pawn); GP.PlayerPoints += Points; Destroy(); } defaultproperties { Points = 100 bCollideActors = true Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment bEnabled=true End Object Components.Add(MyLightEnvironment) Begin Object Class=StaticMeshComponent Name=PickupMesh StaticMesh=StaticMesh'UN_SimpleMeshes.TexPropCube_Dup' Materials(0)=Material'EditorMaterials.WidgetMaterial_Y' LightEnvironment=MyLightEnvironment Scale3D=(X=0.125, Y=0.125, Z=0.125) End Object Components.Add(PickupMesh) Begin Object Class=CylinderComponent Name=CollisionCylinder CollisionRadius=16.0 CollisionHeight=16.0 BlockNonZeroExtent=true BlockZeroExtent=true BlockActors=true CollideActors=true End Object CollisionComponent=CollisionCylinder Components.Add(CollisionCylinder) }
While looking through some tutorials I also found a way to change Flash elements directly from UnrealScript, which cuts down on memory overhead by eliminating redundant functions in Unrealscript and Actionscript.
Here is how to change a text in a text box:
var GFxObject RootMC; RootMC = GetObjectObject("_root.textboxInstanceName"); RootMC.SetText("Insert Text Here");
And here you can go to a frame of a movieclip:
RootMC = GetVariableObject("_root.movieclipInstanceName"); RootMC.GotoAndStopI(2); RootMC.GotoAndStop("Start");
I put two examples of how to go to a frame within a movie clip. The first one GotoandStopI() expects an integer as a parameter(that is why there is an "I" at the end) while GotoAndStop() expects a string. The string has to match a keyframe label you assigned in Flash.
Knowing how to do this now, I want to go back through the upgrade screen and optimize it more. Right now I have duplicate functions in AS3 and Unrealscript to get them to communicate all the information I needed to get through. With this I can do away with the hacky way of getting Unrealscript variables into AS3.
Thanks for reading, if you ever have any questions about my work, or suggestions on how to improve, don't hesitate to comment. I'm still new to this but will try and help as much as I can.
*On a side note: BlogTrog is a great little resource for making the code windows above. You just paste your text into the textfield on their site and select the language and it does the rest. Unfortunately they don't have Unrealscript or Actionscript 3 as languages you can select, but C# comes close in terms of highlighting.
No comments:
Post a Comment