You shouldn’t need to reinvent too many wheels, depending on what your code was doing. The general idea to keep in mind, UnrealScript has similar syntax to C++ already, and by and large, your algorithms should be able to be ported over to C++ with virtually no difficulty, and should continue to work.
The only things that are absolutely not able to be ported are States, replication blocks and your default properties block. States do not exist any longer, replication is handled in a very similar fashion, but not exactly the same, and your default properties block is now your C++ constructor, as it should have been the whole time.
It is quite unfortunate that you feel this is too much of an undertaking, as I think that working in C++ has been a pretty healthy release from the UnrealScript world. I am playing with the idea of writing an UnrealScript binding that would allow you to move your UDK based UnrealScript to work in UE4 land. If you are interested in it, I would love to have a chat and maybe sort out the details.
There is also the option of not porting the code if it seems like its going to be too daunting a task, you could finish up what you were doing on UDK and start a smaller learning project on UE4 if youre not entirely confident
You can recreate a similar type of functionality, but nothing quite as easy to parse at a glance in C++. One road is to have a switch that executes sub methods for each state, and default for when that state should skip an event.
You can also play with composition, where you compose a given object with a reference to an instance of a method that is friendly and executes something, similar to components. The trick here is that you need to swap instances in and out as your states need to be transitioned.
There are other opportunities for you as well, like making extremely obfuscated Macros that allow you to do one or both of the above. There is, however, no simpler solution in C++, at least not yet =) Maybe I will go ahead and write it if you all send me a check.
This is absolutely not a NOOB question. You did good, keep it up. Questions like this are the inspiration to many.
But I don’t use states just for AI, I made a fresh UDK install about 5 days ago and have a pawn that uses states for all of its different movement behavior (I was experimenting with wall-running and the like). Looks like its back to if statements.
With that mindset you would also be able to argue that transitioning between Java and C is an easy transition. I know of no one who would agree with that. Unrealscript has its oddities and will require a non trivial amount of time to move over. The syntax constructs, and organization of code is similar, but there are some patterns that you fall into found in the language that may need to be unlearned, like accessed Nones.
What mean by “easy to transition” is fact that in API i can see exact same patterns which might be helpful with transitioning once you learn C++ basis which i know it’s wall which once you cross it things become easier.
Okay, I’ve made a project and I have a few simple scripts that successfully compile. Let me check my understanding. I will be using my class constructors as I used to use default properties and postbeginplay?
As JamesG said, you override virtual functions now to extend base classes. You should be happy to find out that most of the methods you have used previously in UnrealScript are likely to be available, in one incarnation or another, in UE4s Source. There are absolutely methods that have been deprecated (like using placeable as a UClass directive for instance) that will only be addressed with experience with the new platform.
And of course you have the giants around you to stand on top of.
You can wrap such functionality into struct and the use ticker to switch between “states”. For example in your struct you have IsMoving, in ticker you add if(IsMoving) DoSomething. You of course need to manage setting up bools.
Sorry for obfuscated example but I’ writing it from my tablet. I will give you my more detailed solution once I’m in home.
@up I don’t know why would you switch to unity if you can use blueprints inside UE4?