Chaosy
Tutorial Reviewer
- Joined
- Jun 9, 2011
- Messages
- 13,239
I was toying around with methods of how to make a cinema as easily as possible.
I came up with the following
The demo will make the footman say three messages, each lasting for 5 seconds and when the John Cena message is displayed the unit disappears.
Using this method you can make all your dialog neatly stacked at one place while putting camerawork and movement elsewhere.
This is obviously not a final product but I think the concept is worth exploring, thoughts?
I came up with the following
JASS:
//! zinc
library Cinema
{
public type callback extends function(integer);
integer count = 0;
public function Transmission(unit u, string name, string msg, real dur, callback cb) {
TransmissionFromUnitWithNameBJ(GetPlayersAll(), u, name, null, msg, bj_TIMETYPE_SET, dur, true);
count += 1;
cb.evaluate(count);
}
public function Default(integer i) {
debug BJDebugMsg(I2S(i));
}
}
//! endzinc
JASS:
//! zinc
library DEMO requires Cinema{
callback scene[];
unit u;
function onInit() {
u = CreateUnit(Player(0), 'hfoo', 0, 0, 0);
// function needs to take an integer
scene[0] = function(integer i) {
ShowUnit(u, false);
};
Transmission(u, "Footman", "Hallo", 5, Default);
Transmission(u, "Footman", "My name is", 5, scene[0]);
Transmission(u, "Footman", "John Cena", 5, Default);
}
}
//! endzinc
The demo will make the footman say three messages, each lasting for 5 seconds and when the John Cena message is displayed the unit disappears.
Using this method you can make all your dialog neatly stacked at one place while putting camerawork and movement elsewhere.
This is obviously not a final product but I think the concept is worth exploring, thoughts?