View Full Version : Error from #exec statement...
TheCatcher
11-18-2007, 07:10 AM
The following #exec command is giving me an error.
#exec OBJ LOAD FILE=Animations\CaptureTheTreeUKX.ukx PACKAGE=CaptureTheTreeUT3V10
This is the error...
...\Development\Src\CaptureTheTreeUT3V10\Classes\X masTreeBlue.uc(6) :
Error, Unrecognized compiler directive exec
It might be because the ukx file is from the UT2004 Editor (I haven't created a new SkeletalMesh for the Christmas Tree yet). But the error makes it sound like the #exec command is invalid.
Any help would be greatly appreciated.
It doesn't look like #exec directives are used anymore with the new engine. Instead, check out the defaultproperties section of the script.
Begin Object Class
[...]
End ObjectThe script you're probably looking for is UTCTFBlueFlag.uc (and the redflag) in UTGameContent\Classes...
You'll almost definately need to create a new skelmesh & material for your object.
Sucks having no docs yet to work with, but let us know what you figure out :)
jansoft88
12-24-2007, 07:43 PM
Okee. I was having the same prob. It's kinda stupid but I thought that to get a proper hang of the script I should watch the UT2k4 scripting VTMs by 3dBuzz. I tried making the HealthSphere and got the exec command error. Now that I am looking in UTPickupFactor_MediumHealth I see the Begin Object Class and Eng Object segements of the code. I understand what they are saying, but ,, here's the thing, they are referring to UPK cooked packages that came with the game, I suppose my HealthSphere should also be in a package. So I'm gonna try it out...
P.S. I just realized that this post is neither a question nor an answer and is simply a rant. Sorry for that. At least it will work as a bump :D.
immortius
12-24-2007, 09:54 PM
Yeah, with UT3 you no longer need to use load directives. Your mesh/material/sound packages will need to be in the correct location (the published\CookedPC or unpublished\CookedPC directory or subdirectories, I believe), and if it is in the unpublished directory you will need to run UT3 make with the -useUnpublished option.
jansoft88
12-24-2007, 10:30 PM
Haven't been able to get it working. Can you upload the details of a custom setup that works? Like the segment of code and information on what it's doing?
immortius
12-24-2007, 11:08 PM
Ok, this is referencing a material though:
1.
I have my code in .\Documents\My Games\Unreal Tournament 3\UTGame\Src\MyMutator\Classes, and MyMutator listed in UTEditor.ini under [ModPackages].
2.
I have a package containing my material in .\Documents\My Games\Unreal Tournament 3\UTGame\Unpublished\CookedPC\CustomEffects called MyEffects.upk. The material is called MyEffectMaterial and is in the Material group.
3.
I have code which makes use of the material, which is something like this:
local Material effectMaterial;
effectMaterial = Material'MyEffects.Material.MyEffectMaterial';
effectMesh.SetMaterial(0, effectMaterial);
4.
When compiling I have to run UT3 make -UseUnpublished or the resource can't be found, at least until the new material is published/cooked.
The new Begin Object ... End Object stuff is irrelevant to referencing custom resources. It is relevant for how you set the static mesh for an object though, so here's the default properties I've used for one of my items - it is using a standard UT3 mesh at the moment but does use the custom material.
DefaultProperties
{
Begin Object Class=StaticMeshComponent Name=StaticMeshComp
StaticMesh=StaticMesh'HU_Deco.SM.Mesh.S_HU_Deco_SM _ChineseLanterns'
Materials(0)=Material'MyEffects.Material.MyEffectM aterial'
CullDistance=7000.000000
CachedCullDistance=7000.000000
bUseAsOccluder=False
bForceDirectLightMap=True
bCastDynamicShadow=False
LightingChannels=(BSP=True,Static=True)
CollideActors=True
BlockActors=True
End Object
Components(0)=StaticMeshComp
CollisionComponent=StaticMeshComp
}
This specifies a Static Mesh Component, adds it to the class' component list and sets it up as the Collision component as well (I was too lazy to specify a collision cylinder). The name in the Begin statement is how the object is referenced in later default properties for the class.
jansoft88
12-25-2007, 12:49 AM
For some reason, for me .. it is only working if my package is located in the game install directory's cookedPC directory.
Anyhow, This code that you provided:
local Material effectMaterial;
effectMaterial = Material'MyEffects.Material.MyEffectMaterial';
effectMesh.SetMaterial(0, effectMaterial);
How do you change it if you're using a mesh? So far for the mesh I'm using the Begin Object...End Object setup.
immortius
12-25-2007, 10:32 AM
To programmatically change a mesh I would do something along the lines of:
local StaticMeshComponent meshcomp;
foreach targetActor.ComponentList(class'StaticMeshComponen t', meshcomp) {
meshComp.SetStaticMesh(StaticMesh'MyPackage.MyGrou p.MyMesh');
break;
}
Where targetActor is the actor who's mesh I wanted to change. Some classes have specific variables to expose their mesh component which makes things easier.
Powered by vBulletin® Version 4.1.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.