Page 4 of 5

Re: RealityFactory 0.80 - WIP

Posted: Mon Dec 14, 2009 2:54 pm
by metal_head
Yeah, well anyways I won't be using RF to develop MF anymore, I'm working on a side scroller and thank god, sidescrollers don't need pathfinding :D

Re: RealityFactory 0.80 - WIP

Posted: Wed Dec 23, 2009 5:27 pm
by QuestOfDreams
Finally some holydays so I can work a bit more on RF. Unfortunately there's still quite some work to do...

Some recent changes:

Unlimited number of predefined effects (previously 200)
Unlimited number of predefined explosions (previously 50)
Unlimited number of projectile definitions (previously 50)
Unlimited number of different actor files per level (previously 1024)
Bug fix: Explosion Manager and Effect Manager were updated 2x per frame (delay & lifetime of effects halved)

Re: RealityFactory 0.80 - WIP

Posted: Wed Dec 23, 2009 6:19 pm
by hgt_terry
Fantastic stuff QuestOfDreams

Terry

Re: RealityFactory 0.80 - WIP

Posted: Thu Dec 31, 2009 7:15 pm
by QuestOfDreams
Quick update: completion of following features
  • Scriptable Messages
  • Writing log entries from scripts

Re: RealityFactory 0.80 - WIP

Posted: Mon Jan 04, 2010 9:31 pm
by QuestOfDreams
Just to elaborate on my last post, here's a simple example of a scripted message.

First you create a layout file for the message (I've done it manually but you can use the CEGUI layout editor for this task):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<GUILayout >
	<Window Type="TaharezLook/FrameWindow" Name="Message/Scripted/Window">
		<Property Name="UnifiedPosition" Value="{{0.3,0},{0.15,0}}" />
		<Property Name="UnifiedMaxSize" Value="{{0.5,0},{0.5,0}}" />
		<Property Name="UnifiedMinSize" Value="{{0,128},{0,128}}" />
		<Property Name="UnifiedSize" Value="{{0.4,0},{0.3,0}}" />
		<Property Name="Text" Value="Message Window" />
		<Event Name="Shown" Function="Message_OnShown" />
		<Event Name="CloseClicked" Function="Message_OnCloseClicked" />

		<Window Type="TaharezLook/StaticText" Name="Message/Scripted/Text" >
			<Property Name="TextColours" Value="tl:FF648CDC tr:FF648CDC bl:FF648CDC br:FF648CDC" />
			<Property Name="FrameEnabled" Value="False" />
			<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
			<Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.1,0},{0.9,0},{0.8,0}}" />
			<Property Name="BackgroundEnabled" Value="False" />
			<Property Name="HorzFormatting" Value="WordWrapCentred" />
		</Window>

		<Window Type="TaharezLook/Button" Name="Message/Scripted/Close" >
			<Property Name="Text" Value="Close" />
			<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
			<Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.75,0},{0.9,0},{0.9,0}}" />
			<Property Name="Tooltip" Value="Click to close message window" />
			<Event Name="Clicked" Function="Message_OnCloseClicked" />
		</Window>
	</Window>
</GUILayout>
This is a simple window with 2 children, namely a static text window (which actually receives the message text) and a button to close the window. Besides the property definitions like the window size, the event attributes may have caught your attention. These attributes actually connect events with script methods.

Before we get to the script, let's make this layout available for message entities. To do this we are using the message.ini file as in earlier RF versions, however the definition looks different now:

Code: Select all

[Scripted]
layout = message_scripted.layout
textwindow = Message/Scripted/Text
script = message.s
Here we specify the layout file (the one above), the window that will receive the message text and the script that will handle events from the message window.

And this brings us to the actual script

Code: Select all

{
	Message_OnShown[(e)
	{
		DialogState.UpdateLevel(false);
		DialogState.RenderLevel(true);		// default
		DialogState.Enter();

		Log.SetFile("message_script.log");	// open log file
		Log.SetPriority(Log.DEBUG);			// set output level
		Log.Print("Log.Print");
		Log.Debug("Log.Debug");
		Log.Info("Log.Info");
		Log.Notice("Log.Notice");
		Log.Warning("Log.Warning");
		//Log.Error("Log.Error");
		//Log.Critical("Log.Critical");
		Log.Log(Log.DEBUG, "Log.Log");
		
		// iterate over all loaded fonts and print their heights
		for each font in GUI.FontManager
		{
			Log.Print("font height " # toString(font.getFontHeight()));
		}

		Log.SetFile("RealityFactory.log");	// reset log file to default
	}]

	Message_OnCloseClicked[(e)
	{
		DialogState.Exit();
	}]
}
Message_OnShown gets called when the message entity gets activated and the layout is shown. Right at the start of this method we change into DialogState which restricts user interaction to the GUI. You can choose whether the level should continue to run during this state or time will be frozen (DialogState.UpdateLevel). Also rendering the level is optional in this state (DialogState.RenderLevel).
Next in this method is a test of various Log functions, which produce the following output in the file message_script.log

Code: Select all

Log.Print
[debug]   Log.Debug
[info]    Log.Info
[notice]  Log.Notice
[warning] Log.Warning
[debug]   Log.Log
font height 14.493395
Also demonstrated in this method is a nifty little feature of Simkin that let's you iterate over a set of values in custom objects in a 'for each' statement (provided you wrote the corresponding iterator class). In this example we run through all fonts loaded in the FontManager and print their height to the log file.

Message_OnCloseClicked gets called when we click the Close button. Here we just switch back to the normal play state.

Re: RealityFactory 0.80 - WIP

Posted: Mon Jan 04, 2010 11:09 pm
by Jay
Wow. Seems like you have been busy with this. Will all messages have to be scripted, or will the current ones still work?

Also, the "Log" and the "GUI.FontManager" objects look interesting. Do they work in all kind of scripts or just with the scripted messages?

Re: RealityFactory 0.80 - WIP

Posted: Tue Jan 05, 2010 9:50 am
by QuestOfDreams
You can still define messages that don't need a script, however you will need a layout file to define the look, e.g.:

Code: Select all

[Simple]
layout = message_simple.layout
textwindow = Message/Simple/Text
displaytime = 2
fadeintime = 0.2
fadeouttime = 0.2
This defines a message that fades in and out while the game continues to run, very much like it's used to be. One thing to note is that only 1 instance of a layout file/message definition can be active at any one time. So if you have several message entities using the same definition and more than 1 entity gets activated, the text will be set to the one of the last activated message. (If it's in the process of fading out it will of course stop and fade in again with the new message text)

The Log and GUI objects are globals and can be used in any script. The GUI object will give you access to a major part of the CEGUI API.

Re: RealityFactory 0.80 - WIP

Posted: Sat Jan 23, 2010 1:51 pm
by QuestOfDreams
Just wanted to let you know that the Simkin wrapper for CEGUI is almost completed. There are just a few window types and the Falagard system left that need to be exposed, however the latter may get added at a later date.

Re: RealityFactory 0.80 - WIP

Posted: Sun Mar 21, 2010 9:58 pm
by QuestOfDreams
Simkin wrapper completed, new scriptable inventory system almost finished.

Short video of a basic drag&drop based inventory (other systems like listboxes are possible, too).
http://www.youtube.com/watch?v=qENgK7xtyrg

Re: RealityFactory 0.80 - WIP

Posted: Mon Mar 22, 2010 3:35 pm
by paradoxnj
Nice. Big improvement over the existing.

Re: RealityFactory 0.80 - WIP

Posted: Mon Jun 21, 2010 3:32 pm
by QuestOfDreams
Another inventory type which is visible all the time in-game. Note the automatic removal of empty slots.

http://www.youtube.com/watch?v=dXudzp7m1aw

Re: RealityFactory 0.80 - WIP

Posted: Sat Jun 26, 2010 4:23 pm
by Wraps
VERY NICE!What would we need rf2 for if rf1 can do this?Seriously....if rf1's worldsize and number of actors is upped a bit, as stated above...I'd have no need for rf2...or anything else.RF1's editors are the greatest ever.

Re: RealityFactory 0.80 - WIP

Posted: Thu Aug 12, 2010 8:18 pm
by QuestOfDreams
Well, it's difficult to update the graphics system, the main reason for writing RF2.
I'm trying to write all new components in RF in a way so they can easily be adapted to RF2.

Update:
Fixed ogg vorbis playback (updated to libogg 1.2.0, and libvorbis 1.3.1) :)
I'm trying to get the new conversation system done within the next few days.

Re: RealityFactory 0.80 - WIP

Posted: Thu Sep 09, 2010 12:24 am
by madness
Is this still in the works? I'm trying to build my own little RF oriented towards my game needs but I'd like to see some activity here as well. :o

Re: RealityFactory 0.80 - WIP

Posted: Fri Sep 10, 2010 5:21 pm
by QuestOfDreams
Yes, I'm still working on it. I'll post a video of the new conversation system ASAP.