So right now I'm trying to create a cutscene engine that runs on a counter, an INI, and as few events as humanly possible. So far it works, but for some reason the expression editor won't accept this expression that I'm giving it. I'm gonna go into more detail than I should here in case you guys have any better ideas.
The INI file contains the scripting for the scene. Dialogue, Actions, ect. It's all in one group, with the items named something like "nameX = "blah"", with X being the stage of the scene. Fusion will read every event whos X is equal to the counter I mentioned, which advances when needed. For example, the dialogue.
The ini will read:
Name0 = "Ivan"
Text0 = "Why did the chicken cross the road?"
Name1= "Rex"
Text1 = "To beat up the idiot making jokes about him, probably."
Name2 = "Anna"
Text2 = "...Aren't chickens female?"
The counter starts at 0, so the game reads Name0 and Text0 first, so the dialogue box reads
Ivan
Why did the chicken cross the road?
Each time the player presses "Enter", that counter goes up one. So, player presses enter, Counter +1, Counter now equals 1 and reads Name1 and Text1 instead, Dialogue box Displays Rex's line. Repeat one more, counter = 2, Box displays Anna's line.
This works great for dialogue but now I'm trying sprite movement. I'm trying NOT to create events for each sprite, that would completely defeat the point. So, while the actions will have to be in separate events, I'm trying set it up so the events can discriminate between sprites.
My current idea is to set an alterable string in each sprite, like their name. Alt. String A = "IVN", "REX," "ANA" ect. And use those strings as the names for the events in the INI.
INI reads:
IVN_ACT0 = 1
REX_ACT1 = 3
ANA_ACT2 = 2
And all the sprites are in the "Player" qualifier. So, if conditions are met, Goup.Player does whatever, but still discriminates between sprites. Like Rex will only do Rex commands, ect ect.
Can't set the conditions to the events to the Ini's properties for some reason so I wanna set each sprites Alt. Value to whatever the INI's value is whenever the counter advances, and use that as the conditions for the event. So the expression I want to use to set the Alt is:
Val(GroupItemValue( "INI", "EVENT", Str$(Alterable String A( "Group.Player" ) ) + "_ACT" + Str$(value( "dialoguecounter" ) ) ) )
But there lies the problem: The expression Editor won't accept it. Keeps saying it's a mix of strings and numbers, which I don't get. Yeah it has strings in the equation but the end result should ultimately be a number, wouldn't it?
If anyone knows whats wrong here or has any better ideas of how I could tackle this, please let me know.




Reply With Quote















