RealityFactory 0.80 - WIP
- metal_head
- Posts: 1244
- Joined: Sat Jan 05, 2008 8:31 pm
- Location: Bulgaria,Sofia
- Contact:
Re: RealityFactory 0.80 - WIP
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
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: RealityFactory 0.80 - WIP
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)
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
Fantastic stuff QuestOfDreams
Terry
Terry
Equity_8RF0.1 ( Dedicated )
http://sourceforge.net/projects/equity8rf/
Equity10 ( Ogre Engine )
https://sourceforge.net/projects/hgts123/
http://sourceforge.net/projects/equity8rf/
Equity10 ( Ogre Engine )
https://sourceforge.net/projects/hgts123/
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: RealityFactory 0.80 - WIP
Quick update: completion of following features
- Scriptable Messages
- Writing log entries from scripts
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: RealityFactory 0.80 - WIP
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):
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:
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
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
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.
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>
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
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();
}]
}
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
Message_OnCloseClicked gets called when we click the Close button. Here we just switch back to the normal play state.
- Attachments
-
- Scripted message
- wip080_01.jpg (33.35 KiB) Viewed 13566 times
Re: RealityFactory 0.80 - WIP
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?
Also, the "Log" and the "GUI.FontManager" objects look interesting. Do they work in all kind of scripts or just with the scripted messages?
Everyone can see the difficult, but only the wise can see the simple.
-----
-----
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: RealityFactory 0.80 - WIP
You can still define messages that don't need a script, however you will need a layout file to define the look, e.g.:
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.
Code: Select all
[Simple]
layout = message_simple.layout
textwindow = Message/Simple/Text
displaytime = 2
fadeintime = 0.2
fadeouttime = 0.2
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.
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: RealityFactory 0.80 - WIP
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.
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: RealityFactory 0.80 - WIP
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
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
Nice. Big improvement over the existing.
Many Bothans died to bring you this signature....
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: RealityFactory 0.80 - WIP
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
http://www.youtube.com/watch?v=dXudzp7m1aw
Re: RealityFactory 0.80 - WIP
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.
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: RealityFactory 0.80 - WIP
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.
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
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.
Somewhere in Nevada...
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: RealityFactory 0.80 - WIP
Yes, I'm still working on it. I'll post a video of the new conversation system ASAP.