C
Cesur Basoglu
Guest
So, I try to combine Beyond Us Games' s multi dialogue system with FriendlyCosmonaut's cutscene system. The abomination actually works for the most part. The problem is when the time comes for scrCutsceneDialogue, the game created a lot of dialogue boxes, this is evident because I programmed the text to write like a typewriter and make a sound as it is typing. So as soon as the first dialogue box is created you can hear more typewriting sounds in the background and when you choose an option, the first text box is destroyed, but in this case, another text box is beneath the second one.
obj_player > Create Event
The code above is in my obj_player's Create Event, and it is suppose to statr the cutscene when the player presses B.
scrCreateCutscene
When this script is run, it takes the scene from the given object and runs the obj_cutscene's User Event[0].
obj_cutscene > User Event[0]
This is a bit confusing to explain. What it does is, it takes the scene information (which has scripts with arguments) from the crate event of the object. Then it removes all scripts from their arguments with '-1' and that information is stored in 'len'. In other words that line helps to remove the first entry in the array length which are scripts. Then current scene array is set to '-1' to use this event again and again. The fourth line is to set all entries to 0. At last copy, the current_scene to current_scene_array.
obj_sergent > Creation Code
The Cutscene part is what it should be running when the player hits B. And it works perfectly until and it starts to create a lot of text objects at the same time. scrCutsceneDialogue is supposed to create a dialogue box and type 'The Dialogue' section.
If you need/want to see more of the code you can ask me.
obj_player > Create Event
Code:
if(!instance_exists(obj_cutscene)){
if(keyboard_check_pressed(ord("B"))){
with(obj_sergent){
scrCreateCutscene(t_scene_info);
}
}
}
scrCreateCutscene
Code:
/////@description Create Cutscene
var inst = instance_create_layer(0,0,"Instances", obj_cutscene);
with(inst){
scene_info = argument0;
event_perform(ev_other, ev_user0);
}
obj_cutscene > User Event[0]
Code:
current_scene = scene_info[scene];
var len = array_length_1d(current_scene) -1;
current_scene_array = -1;
current_scene_array = array_create(len, 0);
array_copy(current_scene_array, 0, current_scene, 1, len);
obj_sergent > Creation Code
Code:
///–––––Vars
voice = snd_voice3;
text_col = c_green;
font = fnt_14;
///–––––Cutscenes
t_scene_info = [
[scrCutsceneWait, 1],
[scrMoveObject, obj_sergent, 352, 610, false, 4],
[scrCutsceneWait, 1],
[scrCutsceneDialogue, id, 0],
[scrMoveObject, obj_sergent, 52, 61, false, 4],
];
///–––––The Dialogue
myDialogue[0,0] =@"Sir we've lost our second and third engine and the planet belove us is pulling the ship. What
should we do?";
///–––––Options
myDialogue[0,1] = "Hold on." + "99"
myDialogue[0,2] = "Every one to the escape pods" + "99"
myDialogue[0,3] = "Pray" + "99"
If you need/want to see more of the code you can ask me.