Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

MV Script Calls

eivl

Local Hero
Xy$
0.00
Here is a general IF-Else call

JavaScript:
if (time < 10) {
    greeting = "Good morning";
} else if (time < 20) {
    greeting = "Good day";
} else {
    greeting = "Good evening";
}
you can have multiple else if statements as well..
remember that you check for errors before you run an condition check. gameSwitches.value(n) must be valid or the statement will fail.
 

David FoxFire

Adventurer
Xy$
0.00
Here is a general IF-Else call

JavaScript:
if (time < 10) {
    greeting = "Good morning";
} else if (time < 20) {
    greeting = "Good day";
} else {
    greeting = "Good evening";
}
you can have multiple else if statements as well..
remember that you check for errors before you run an condition check. gameSwitches.value(n) must be valid or the statement will fail.
IF-Else in Javascript I know. And in case I forget there's always the pile of JS for Idiots books I have with me.

I keep a list of Switches and Attributes I use in a project for validity's sake. OneNote is handy like that.
 

Minty

Knight
Xy$
0.00
I'm a little lost on showing the balloon.
character.requestBalloon(1); this.setWaitMode('balloon');
This gives me the error "can't read property "isBalloonPlaying" of null

(Sorry if I seem like a noob here. I know quite a bit ov JS but I'm kinda inexperienced with stuff like this)
 

Minty

Knight
Xy$
0.00
I tried this character.requestBalloon(10; this.setWaitMode('balloon'); in an event just as script and in set movement route for the event.
For one, you're missing a parenthesis here V
character.requestBalloon(10; this.setWaitMode('balloon');


Where and how do you call it?
In an event, through the script function on the third page. I also tried through movement route and a common event, both gave back the same error.
 

PAC918

Towns Guard
A few different things happened and without changing anything in that script line. The very first time I entered it and tested the game it showed a balloon but it was blank. So, I thought I'd try walking or stepping animation so it would cycle through the graphics as it should but nope. Got an error saying something like the balloon graphic not found.
 

eivl

Local Hero
Xy$
0.00
JavaScript:
$gamePlayer.requestBalloon(1);
what if you define your player first.. since i do not know what character or map event you want to do this to, i made it work with the player.
[doublepost=1446393094,1446392958][/doublepost]Or maby you need it on an event.

JavaScript:
$gameMap.event(1).requestBalloon(1);
 

PAC918

Towns Guard
JavaScript:
$gamePlayer.requestBalloon(1);
what if you define your player first.. since i do not know what character or map event you want to do this to, i made it work with the player.
[doublepost=1446393094,1446392958][/doublepost]Or maby you need it on an event.

JavaScript:
$gameMap.event(1).requestBalloon(1);
Tried it for event and only shows blank balloon. I'm looking to get the Zzz to repeat for a scene.
 

eivl

Local Hero
Xy$
0.00

[doublepost=1446393464,1446393404][/doublepost]
Tried it for event and only shows blank balloon. I'm looking to get the Zzz to repeat for a scene
Baloon id 1 = wite with ! symbol.

you need to just check to find it..
[doublepost=1446393526][/doublepost]Zzz = requestBalloon(10)
 

Minty

Knight
Xy$
0.00
JavaScript:
$gamePlayer.requestBalloon(1);
what if you define your player first.. since i do not know what character or map event you want to do this to, i made it work with the player.
[doublepost=1446393094,1446392958][/doublepost]Or maby you need it on an event.

JavaScript:
$gameMap.event(1).requestBalloon(1);
I did define it in RM. I put "character" here for generalization.
 

eivl

Local Hero
Xy$
0.00
Ps: make a new post in the support forum, say what you want to do, what you have tested, and i will assist in detail.
This thread is for script calls :)
 

Minty

Knight
Xy$
0.00
I'm looking to get the Zzz to repeat for a scene.
That's easy to do without a script. Make a loop and put the balloon icon in the loop. Ehm, if that's confusing, I'm sort. I'd provide a screenshot but Steam is telling me MV isn't installed on my computer @-@
 

LTN Games

Master Mind
Resource Team
Xy$
0.01
Ps: make a new post in the support forum, say what you want to do, what you have tested, and i will assist in detail.
This thread is for script calls :)
Yes as eivl has mentioned, please open up a support thread in MV Support for further help. This thread is for MV Scripts calls, not support. Thank you :)
 
Top