Author Topic: Scripts  (Read 5066 times)

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
Scripts
« on: December 05, 2019, 03:35:53 pm »
I had a few suggestions for scripts. Posted below

Share on Bluesky Share on Facebook


  • Hero Member
  • *****
  • Posts: 509
    • View Profile
Re: Scripts
« Reply #1 on: December 26, 2019, 07:30:27 pm »
Okay, so it was discussed earlier that text to speech was impossible, but is is possible to animate mouth moving for each sprite and take existing ones and manually sync the sound to the animation?

  • Administrator
  • Sr. Member
  • *****
  • Posts: 407
    • View Profile
Re: Scripts
« Reply #2 on: December 27, 2019, 10:07:01 pm »
Yes, I can make sprite mouth to be manually synced from a dialog XML file. I already have a good idea how to implement that.
I deferred that script because it's a bit pointless when we have no source of voice. So far I could get only two volunteers to take part in this project. Chance of getting a female willing to do voice acting is pretty slim.
If you have good use for that, I can make it work next month.

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
Re: Scripts
« Reply #3 on: December 28, 2019, 12:29:34 am »
We could pay someone?

  • Administrator
  • Sr. Member
  • *****
  • Posts: 407
    • View Profile
Re: Scripts
« Reply #4 on: December 28, 2019, 12:46:32 am »
No way. Any money involved (paid or received) would absolutely ruin this project for me.
Also it could not be more backward if a pirate and volunteer paid own money for something, official author was paid for obtaining.

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
Re: Scripts
« Reply #5 on: December 28, 2019, 07:14:02 am »
I see what you're saying, but on the other hand, we would be adding our own original content and this project is worth a little money. We can just agree to disagree on this one if you'd like

  • Administrator
  • Sr. Member
  • *****
  • Posts: 407
    • View Profile
Re: Scripts
« Reply #6 on: December 28, 2019, 11:27:19 am »
I hope that this project will attract more fans and eventually some may have a good female friend willing to do some little voice acting.
Otherwise I prefer every way around, like some better text-to-speech converter for dialog and ripping voice from some regular **** for sex scene.
I would die of shame if I ever pay real money for something like that. I've been a digital pirate for my entire life, it's a matter of pride and personal standards. Also it's not easy to send or receive money really anonymously. Even Bitcoin transactions are not really anonymous.

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
Re: Scripts
« Reply #7 on: December 28, 2019, 11:50:33 am »
I might though,

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
Re: Scripts
« Reply #8 on: December 29, 2019, 08:42:39 pm »
The controller for kendra’s sodeways scene is broken, I tried replacing the telltarget with references. It works in the testing environment but not in game

on(press, keyPress “ number”) {
Object(_root).focus.camera.area.char.kendra.gotoAndPlay(“a”)
Object(_root).controller.speed_status.gotoAndPlay(“a”)

}

**speed_status is referring to the green speed indicator that I’ve added.

  • Administrator
  • Sr. Member
  • *****
  • Posts: 407
    • View Profile
Re: Scripts
« Reply #9 on: December 29, 2019, 09:41:21 pm »
There are two things wrong with that.

First, everything with round brackets is a function.
  on(...) is and event dispatcher function defining what events (listed in bracket) this particular function shall process, the function body is in { ...} brackets.
  Object() is basic function creating generic object, which is a data structure holding properties and functions (called method when attached to the object). Parameter in bracket is a data to be converted into an object, rarely used.
  So you can create an object named for example "playlist" by an expression:
var playlist = new Object();  // creates empty generic object
playlist.mainhall = "hell.mp3"; // creates new property (variable) named "mainhall" storing string value of "hell.mp3"
playlist.thetower = "dark.mp3"; // creates new property (variable) named "thetower" storing string value of "dark.mp3"
...so you can utilize object storing named list (associative array).

  The expression Object(_root) does not make a sense as it creates simple data structure converting _root pointer into object.
  The correct way of using _root pointer is _root.focus.camera.area.char.kendra.gotoAndPlay(“a”);
However that would work only if the file timeline is a root, which is only case when file is loaded standalone.

When you want the file to work regardless of on a top of what it is loaded, don't use _root pointer, refer objects relatively:
In your file, you have a "focus" object in the main timeline. That contains "camera" object, which contains "area", which contains "char", which contains "kendra".
Also you have a "controller" object in the main timeline, which contains lot of stuff including buttons and "speed_status" object.
So when you have a button script in the "controller" object and want to call a function in the "kendra" object,
you have to use a "_parent" pointer to get a level up in the hierarchy from the "controller" object to file's main timeline (which may have a name if loaded as object atop something in a game), then use object names on the path to kendra, so it is:
_parent.focus.camera.area.char.kendra.gotoAndPlay("a");  to call gotoAndPlay("a") in the kendra object.
And to control "speed_status" object, which is in the same "controller" object as the button, you call
speed_status.gotoAndPlay("a");

That's assuming that you have your speed buttons placed in the "controller" object directly.
If you have your buttons wrapped in some object and then the object placed in the "controller", then you have to use "_parent" pointer twice - first to get from the buttom wrapper to the "controller" object and second to get from "controller" up to file's timeline:
_parent._parent.focus.camera.area.char.kendra.gotoAndPlay("a");
To control neighbor object "speed_status" you have to go one level up and then dive in and call it's function:
_parent.speed_status.gotoAndPlay("a");

That's all I can see now.

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
Re: Scripts
« Reply #10 on: December 29, 2019, 10:00:29 pm »
Awesome I’ll definitely give it a try. I just wish that it was easier to see the hierarchy in Flash

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
Re: Scripts
« Reply #11 on: December 29, 2019, 11:06:01 pm »
Okay I got it to work! Thanks. Also I noticed one of your scripts in jasmin’s controller:

On(release){
Function
}

On(keyPress “2”){
Same function
}

You can condense this into:

On(release, keyPress “2”){
Function
}

  • Administrator
  • Sr. Member
  • *****
  • Posts: 407
    • View Profile
Re: Scripts
« Reply #12 on: December 30, 2019, 11:09:58 am »
Yes, that's how I've been doing that lately. The two function, one for each event, is the way how Crow did it and how I've been doing that when I was learning Flash.
You can find much more mess in Crow's files, like two functions for the same event, each holding part of the action code, or action broken into 3 functions performed on 3 different events: on mouse over, on press and on release. Which could end up in a mess if player presses mouse outside the button, move cursor over button and releases mouse button.

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
Re: Scripts
« Reply #13 on: December 30, 2019, 02:24:09 pm »
Lol Crow’s got that 2-dimensional coding style.

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
Re: Scripts
« Reply #14 on: January 21, 2020, 03:20:10 pm »
Okay so I’ve been thinking about making a script that controls the player genus. I was planning on drawing one full genus (min) to add to every scene for next release. The only way I could think to do it is to add frames to the player body parts with different skins on each frame similar to the p en is. The only issue for me is controlling them to sync to the player_genus value from one script for easy implementation.

Since the frames could be named to match the genus,
Could we write a script that gets the player_genus value but instead of a bunch of if statements,

gotoandstop(player_genus)

Example:

genus = player_genus;

P e n I s.Gotoandstop(genus);
leg.Gotoandstop(genus);

Etc

would flash try to gotoandstop(“player_genus”)
And throw an error since there wouldn’t be a frame named player_genus or would it read it as Gotoandstop(“whatever the genus is”)?

I hope I haven’t confused you.