PDA

View Full Version : fscommand should not be used for production......error



joesan
11-12-2010, 07:47 AM
I just have one fscommand in my map that closes the my swf in the 'open GFx movie' command. When I open my load the map it comes out with the above error plus this "....This is for prototyping only FxEvent_FsCommand .... (name of my map)

what am I doing wrong?

tegleg
11-12-2010, 08:16 AM
here you are, i asked the same thing
http://forums.epicgames.com/showthread.php?t=746141

joesan
11-13-2010, 03:08 AM
Thank you but the remedy is Chinese to me. Where do I insert the code that EUROSAT7 mentions? and what is the answer from Doyle: "External Interface" means ????

Matt Doyle
11-15-2010, 10:27 AM
From Flash:


import flash.external.ExternalInterface;
// ...
ExternalInterface.call("MyUnrealScriptFunction", param1, param2, param3);

The above code would then look for a function called "MyUnrealScriptFunction" in the current GFxMoviePlayer instance in Unreal, convert the parameters to the parameters of that function in UnrealScript, and call the function. Note that the UnrealScript function's parameter list is authoritative in this case, so if the parameters passed from ActionScript cannot be cast to the UnrealScript function's parameter types, they will be NULL or their default value, as appropriate.

joesan
11-15-2010, 02:50 PM
I still don't understad. I have a simple Flash button with some text, I right click the Button and call Action, there I write this:


on (press) {
fscommand("start");

}

In Kismet I open the GFx Movie and so on and separately I place a fscommand with "start" as the fscommand. The output just does a CloseGFx Movie command
And IT WORKS OK but when I open the map it says always:


My_scaleform_test GFxEvent_FSCommand_0 FS Commands should not be used for production. This is for prototyping only GFxEvent_FSCommand

Please Matt Doyle what is the right procedure? where do I install the code you mention above?
I appreciate it

Matt Doyle
11-15-2010, 02:57 PM
So, your Flash button would instead have his:

ActionScript 2.0 Method



on (press)
{
import flash.external.ExternalInterface;
ExternalInterface.call("MyUnrealScriptFunction");
}

You can pass as many or as few parameters as you like with an ExternalInterface call (example: ExternalInterface.call("MyFunction", "Matthew", 37, true) passes a string value, an integer, and a boolean). In this case, we aren't passing any. We're just calling the function MyUnrealScriptFunction.

And in your UnrealScript, you would have this:



class MyMoviePlayer extends GFxMoviePlayer;

//function to receive External Interface call
function MyUnrealScriptFunction()
{
`log("###### ExternalInterface Call Received #####");
TriggerRemoteKismetEvent('MyEvent');
}

//function to trigger a remote kismet event
function TriggerRemoteKismetEvent( name EventName )
{
local array<SequenceObject> AllSeqEvents;
local Sequence GameSeq;
local int i;

GameSeq = GetPC().WorldInfo.GetGameSequence();
if (GameSeq != None)
{
// find any Level Reset events that exist
GameSeq.FindSeqObjectsByClass(class'SeqEvent_Remot eEvent', true, AllSeqEvents);

// activate them
for (i = 0; i < AllSeqEvents.Length; i++)
{
if(SeqEvent_RemoteEvent(AllSeqEvents[i]).EventName == EventName)
SeqEvent_RemoteEvent(AllSeqEvents[i]).CheckActivate(GetPC().WorldInfo, None);
}
}
}

Add a Remote Event Kismet node in the level, and give it a name of MyEvent.

Then link that event to whatever you desire to occur.

joesan
11-16-2010, 02:19 AM
Thank you I'll try. But one question remains: where do I write the code in UnrealScript? which file? in which folder of UDK?, is it a new file.uc that I must create or do I write it inside one of the many .uc files?
Not having written any code in UnrealScript (just copying verbose what I read from examples) you may understand my predicament here.

Matt Doyle
11-16-2010, 10:25 AM
Sounds like you need to start from the beginning. Everything you need to know has already been written in documentation or put into tutorial videos. Please review the Getting Started with GFx sticky forum post - there are tons of links to tutorials there.

joesan
11-17-2010, 08:48 AM
Yes sure !!, I have tried to do that with all of your Video tutorials. The last one "Getting started with CLIK Video tutorial 1 (9 steps) and it is almost impossible to follow BECAUSE OF UDK AND FLASH AND PHOTOSHOP constantly coming out with new versions.
By following the first 2 Steps of the above tutorial when I run it with Test with FxMediaPlayer in comes out with the following error list
, Line 1 There is no class or package with the name 'gfx.controls' found in package 'gfx'.
, Line 1 There is no class or package with the name 'gfx.controls' found in package 'gfx'.
, Line 1 There is no class or package with the name 'gfx.controls' found in package 'gfx'.
, Line 1 There is no class or package with the name 'gfx.controls' found in package 'gfx'.
H:\UDK\UDK-2010-10\Development\Flash\CLIK\gfx\controls\Button.as, Line 442 Type mismatch in assignment statement: found Number where Boolean is required.

H:\UDK\UDK-2010-10\Development\Flash\CLIK\gfx\controls\Button.as, Line 318 There is no property with the name 'bindingEnabled'.
H:\UDK\UDK-2010-10\Development\Flash\CLIK\gfx\controls\Button.as, Line 313 There is no property with the name 'bindingEnabled'.

plus the DOS window created shows this:
"jpeg system is not installed.... Load _level10.optionsBtn

It is discouraging. Thanks for your time anyway.

Matt Doyle
11-17-2010, 10:27 AM
I advise you to ignore the CLIK videos for now, and focus on reading the UDN Scaleform web pages, and watching the UDK specific video tutorials. They cover most if not all of what you are asking help with.

For instance, if you read the UDN docs, you will see that jpeg is not to be used. You must set all images to PNG/lossless compression in Flash. And the docs, as well as the first UDK video explains how to do that.

Also, you said:



where do I write the code in UnrealScript? which file? in which folder of UDK?

These questions are answered in the UDK video on creating a custom menu.

So, rather than repeat myself on the forums, I recommend those docs and tutorials. Study them thoroughly and you will be well on your way to understanding how it all works. But, if you don't know how to write code, and don't understand UnrealScript, you're going to need to learn that as well.

Matt Doyle
11-17-2010, 03:46 PM
It is true that there are many revisions from month to month as UDK changes, etc. And, sadly, I can't keep up with new video tutorials very often, especially considering UDK tutorials are not my only responsibilities here at Scaleform. But I'm confident you should still be able to get some good value out of the ones available now - most of which were put together on August & September UDK, using Flash CS4.

A few months down the road, I'm sure we'll revise these tutorials to bring them up to date, and probably continue to revise them every few months or so (if needed).

joesan
11-22-2010, 05:12 AM
Mr. Doyle, please just let me know where do I place the code in Unreal script that you mention to remedy the fscommand error mentioned above. I can enter code but in which .uc file and which folder? or do I have to create another uc file and then compile.
I appreciate it because everytime I use this fscommand it shows the error and it becomes irritating

joesan
11-22-2010, 10:11 AM
Matt Doyle: would you please tell me into which file and which folder do I introduce the Unreal script code you mentioned above? or is it a new file to make?
I have changed .uc files within UDk (to include a new character in my games) so I would know how to do it I only need where?
Thank you

tegleg
11-22-2010, 10:16 AM
you need to make a new file and put it in your script package, if you dont have your own yet do a getting started in udk or a simple game tutorial or something.

one question remains though matt doyle please
why is fscommand not reccomended?
will it break or what?

Matt Doyle
11-22-2010, 10:17 AM
You have to create a new class file. This class file should live in the UDKGame classes folder under Development/Src. Call the class whatever you want. Put the code in there. The class must extend GFxMoviePlayer.

In Kismet, when you use OpenGFxMovie, in the dropdown where you choose GFxMoviePlayer, change it to your new class file.

If you watch video tutorial 6 (creating custom menus) it tells you all the details of this (creating a new class, and setting up Kismet, etc.)

ZeJudge
11-26-2010, 01:29 PM
Hey there guys,

I was wondering, is there a way to do this same thing, but only in kismet rather than going into code?

I'm trying to achieve a change being activated in scaleform via kismet.
For example, if a player completes a level, I would like a colour change to be displayed on their map, but, but their map is entirely scaleform and kismet based, no scripts involved.

Thanks

taz1004
11-26-2010, 08:38 PM
I'm actually wondering why. Why shouldn't fscommand used for production? What would happen if it's used for production?

joesan
12-02-2010, 09:08 AM
Matt, I tried the fscommand substitute scripts you mentioned above and it works (what else?)
In Flash I am having 10 buttons in a switch case and each has

ExternalInterface.call("MyUnrealScriptFunction",1);
ExternalInterface.call("MyUnrealScriptFunction",2); etc...
Now in Kismet I place the RemoteEvent and name it MyEvent .... but how do I pass the second parameter (1,2,etc)
Thanks

tegleg
12-03-2010, 06:14 AM
I'm actually wondering why. Why shouldn't fscommand used for production? What would happen if it's used for production?

i tried using it in production and my neighbours cat exploded!
no not really ;)
does seem strange that fscommand exists (and works fine) but gives an error (that isnt really a propper error).

any clues?
or nobody knows why?

joesan
12-03-2010, 09:37 AM
Matt again:
I didn't get an answer from my last request above so I tried an approach that WORKS but seems to me too long:
code in MyGFxMoviePlayer.uc:


//function to receive External Interface call
function MyUnrealScriptFunction(int n)
{

switch(n)
{
case 0:
TriggerRemoteKismetEvent('MyEvent0');
break;
case 1:
TriggerRemoteKismetEvent('MyEvent1');
break;
case 2:
TriggerRemoteKismetEvent('MyEvent2');
break;
........ etc for all numbers

It's a pity that the RemoteEvent in Kismet cannot take any parameters otherwise it would be easy and much shorter.
Comments?

Matt Doyle
12-03-2010, 10:08 AM
Sorry. I was out of the office yesterday. Yes, Remote event does not take parameters. You'll have to figure something else out if you want to send parameters. Some things you could do:

A. Create your own kismet remote event sequence that DOES accept parameters - this is beyond the scope of Scaleform UI though.
B. Store the parameters in variables in Flash/AS, then get those variables with the Kismet node: GFx GetVariable. Using that, you put the fully qualified path to the variable in Flash/AS in the Variable field, and then you connect the Result to whatever variable type it is (string, int, bool, etc.).

A_udk_forum_login
03-29-2011, 03:53 AM
It also seems possible to use "GFX get variable" to replace fscommands entirely.

By creating a loop that periodically checks the value of a variable in flash, kismet can respond to an event in flash which changes that variable.

Combined with a switch statement it can then respond to multiple events.

For use when the "fscommands are only for prototyping" errors are bugging you and you don't want to write any unreal script.

Just make sure that the flash movie is still loaded when you check the variable, otherwise UDK completely crashes.

ChinChecker
12-17-2011, 07:50 PM
Matt if you could please help shed some light on why i cant get the external interface to call my function in uscript id be so grateful.when i use the scaleform launcher in flash i see it log callback myunrealscriptfunction but in my GFxMoviePlayer class in udk it never calls the myunrealscriptfunction! everything else works perfect i just cant for the life of me get it to fire my function. thanks in advance