UDK "Error, 'DefaultMesh': Bad command or expression" - unreal-development-kit

I'm porting UT3 code to UDK, and I am getting the following compile error with the UDK compiler:
C:\UDK\UDK-2010-03\Development\Src\FixIt\Classes\ZPawn.uc(25) : Error, 'DefaultMesh': Bad command or expression
The ZPawn class extends UTPawn.
Line 25 is the following:
DefaultMesh = SkeletalMesh(DynamicLoadObject(ZBotOwner(Owner).MeshToUse, class'SkeletalMesh'));
Where did DefaultMesh go in UDK?

The SkeletalMesh is part of the Mesh Component in a Pawn:
Begin Object Class=SkeletalMeshComponent name=Mesh01
SkeletalMesh=SkeletalMesh'pawnPackage.Meshes.mySkeletalMesh'
AnimTreeTemplate=AnimTree'pawnPackage.Anims.myAnimTree'
PhysicsAsset=PhysicsAsset'pawnPackage.Physics.myPhysicsAsset'
AnimSets(0) =AnimSet'pawnPackage.Anims.myAnimSet'
End Object
Mesh=Mesh01
Components.Add(Mesh01)

Well just to be clear, the line change you will want will be this:
Mesh = SkeletalMesh(DynamicLoadObject(ZBotOwner(Owner).MeshToUse, class'SkeletalMesh'));
Assuming of course your ZBot is all set up correctly.
Also I'm assumign that this is in default properties? Don't forget to add it to your components
Components.Add(Mesh);

Related

Key binding by file type

Description
I'm trying to create a key binding that behaves differently based on the file type.
Ideally what id like to do is the following:
If the file type is .md then run the command markdown-preview-plus:toggle
else run the command script:run
I know it's something along the lines of:
file init.coffee :
editor.command('custom:command', e => {
if ( of file type .md) {
markdown-preview-plus:toggle
} else {
script:run
}
})
Then in the keymap.cson i have to add something like:
'atom-text-editor':
'cmd-i': 'custom:command'
But obviously this is pseudocode. I've tried reading the documentation specifically this
but there isn't enough information.
I was able to do this by adding the following to the keymap.cson file:
"atom-text-editor[data-grammar='source gfm']":
'cmd-i': 'markdown-preview-plus:toggle'
"atom-text-editor:not([data-grammar='source gfm'])":
'cmd-i': 'script:run'
For anyone trying to do something similar to this, I used this as reference:
Atom grammer syntax

What type is a points vector in objective C

I have the following declaration for a function and I don't know what I am doing wrong with regards to the type declaration:
//function is defined in the OpenCVWrapper.mm file .....no errors
+ (NSArray *)analysePoints:(std::vector<cv::Point> )pointsVector{
.......
}
//error is in the OpenCVWrapper.h file
#interface OpenCVWrapper : NSObject
+ (NSArray *)analysePoints:(NSMutableArray *)mutableArray:(std::vector<cv::Point>)pointsArray;
//red marker under the std
#end
I am getting the error "expecting type" for the vector. What am I doing wrong here?
Actually, I found the solution through user11118321 input to look at the bigger picture. I am using this set up in a swift app that uses openCV through a bridging header. It is actually not possible to import or use a vector in swift.

BirdWatching app 'incompatible pointer types initializing'

I just started coding and as I followed Apple's article 'Your Second iOS App:Storyboard', I had a warning that says 'incompatible pointer types initializing Birdsighting *__strong with an expression of type NSString *' from the following code:
detailViewController.sighting = [self.dataController objectInListAtIndex:[self.tableView indexPathForSelectedRow].row];
well you are trying to say (IT SEEMS):
NSString *stringInCurrentTableViewRow = [self.dataController objectInListAtIndex:[self.tableView indexPathForSelectedRow].row];
BirdSighting *yourObject = stringInCurrentTableViewRow;
you are sure the dataController doesnt contain Strings ;)

Flex3 / Air 2: NativeProcess doesn't accepts standard input data (Error #2044 & #3218)

I'm trying to open cmd.exe on a new process and pass some code to programatically eject a device; but when trying to do this all I get is:
"Error #2044: Unhandled IOErrorEvent:. text=Error #3218: Error while writing data to NativeProcess.standardInput."
Here's my code:
private var NP:NativeProcess = new NativeProcess();
private function EjectDevice():void
{
var RunDLL:File = new File("C:\\Windows\\System32\\cmd.exe");
var NPI:NativeProcessStartupInfo = new NativeProcessStartupInfo();
NPI.executable = RunDLL;
NP.start(NPI);
NP.addEventListener(Event.STANDARD_OUTPUT_CLOSE, CatchOutput, false, 0, true);
NP.standardInput.writeUTFBytes("start C:\\Windows\\System32\\rundll32.exe shell32.dll,Control_RunDLL hotplug.dll");
NP.closeInput();
}
I also tried with writeUTF instead of writeUTFBytes, but I still get the error. Does anyone have an idea of what I'm doing wrong?.
Thanks for your time :)
Edward.
Maybe cmd.exe doesn't handle standardInput like a normal process.
You could try passing what you want to execute as parameters to the cmd process, rather than writing to the standard input
I think
cmd.exe /C "start C:\Windows\System32\rundll32.exe shell32.dll,Control_RunDLL hotplug.dll"
is the format to pass something as a parameter to cmd to execute immediately.
This site has an example of passing process parameters using a string vector:
http://blogs.adobe.com/cantrell/archives/2009/11/demo_of_nativeprocess_apis.html
Try it without the last line "NP.closeInput();"
See also:
http://help.adobe.com/en_US/as3/dev/WSb2ba3b1aad8a27b060d22f991220f00ad8a-8000.html
I agree with abudaan, you shouldn't need to closeInput().
Also, suggest you add a line break at the end of the writeUTFBytes() call, e.g.:
NP.standardInput.writeUTFBytes("start C:\\Windows\\System32\\rundll32.exe shell32.dll,Control_RunDLL hotplug.dll **\n**");
Lastly, I recommend you listen to other events on the NativeProcess, I use a block of code something like this:
NP.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onStdOutData);
NP.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onStdErrData);
NP.addEventListener(Event.STANDARD_OUTPUT_CLOSE, onStdOutClose);
NP.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, onStdInputProgress);
NP.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, onIOError);
NP.addEventListener(IOErrorEvent.STANDARD_INPUT_IO_ERROR, onIOError);
NP.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, onIOError);
with the normal event handler functions that at least trace what they receive.
Best of luck - I've just spent a few hours refining NativeProcess with cmd.exe - its fiddly. But I got there in the end and you will too.

UDK "Error, Unrecognized member 'OpenMenu' in class 'GameUISceneClient'"

Upon compiling, I am getting the following error:
C:\UDK\UDK-2010-03\Development\Src\FixIt\Classes\ZInteraction.uc(41) : Error, Unrecognized member 'OpenMenu' in class 'GameUISceneClient'
Line 41 is the following:
GetSceneClient().OpenMenu("ZInterface.ZNLGWindow");
But when I search for OpenMenu, I find that it is indeed defined in GameUISceneClient.uc of the UDK:
Line 1507: exec function OpenMenu( string MenuPath, optional int PlayerIndex=INDEX_NONE )
It looks like I have everything correct. So what's wrong? Why can't it find the OpenMenu function?
From the wiki page on Legacy:Exec Function:
Exec Functions are functions that a player or user can execute by typing its name in the console. Basically, they provide a way to define new console commands in UnrealScript code.
Okay, so OpenMenu has been converted to a console command. Great. But still, how do I execute it in code? The page doesn't say!
More searching revealed this odd documentation page, which contains the answer:
Now then, there is also a function
within class Console called 'bool
ConsoleCommand(coerce string s)'. to
call your exec'd function,
'myFunction' from code, you type:
* bool isFunctionThere; //optional
isFunctionThere = ConsoleCommand("myFunction myArgument");
So, I replaced my line with the following:
GetSceneClient().ConsoleCommand("OpenMenu ZInterface.ZNLGWindow");
Now this causes another error which I covered in my other question+answer a few minutes ago. But that's it!
Not sure if this is your intent, but if you are trying to create a UIScene based on an Archetype that has been created in the UI Editor, you want to do something like this:
UIScene openedScene;
UIScene mySceneArchetype;
mySceneArchetype = UIScene'Package.Scene';
GameSceneClient = class'UIRoot'.static.GetSceneClient();
//Open the Scene
if( GameSceneClient != none && MySceneArchetype != none )
{
GameSceneClient.OpenScene(mySceneArchetype,LocalPlayer(PlayerOwner.Player), openedScene);
}

Resources