Character callbacks?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Character callbacks?
I'm squinting my way through the reference files, and I'm curious about the optional callback parameter of the character note.
What kind of function does it call back to? A Python function? A renpy function? (it seems like it could take a renpy function, but to do anything intelligent with the passed values you'd need a python one...)
Specifically, I have a character who makes a call over the radio. I'd like to have an audio crackle play whenever he walks (but not after {w}'s)
Is that possible?
And while I'm posting (see me deviously slip this into the main forum...)
This is the project file of the educational prototype my Bio Systems class did for the College of St Catherines.
http://www.emopanda.com/2davids.zip
It's frustratingly incomplete- we were aiming to have 1 of the 3 'areas' done in addition to the shell/intro sequence. We ended up with that area implemented- but empty of content. Two days more and it would have been done-- how frustrating!
Oh well, it's still fun to look at- this is what happens when you dump more than 200 hours of photoshop into a project.
Our client seemed pleased- he's looking at giving the project files over to a couple of his grad students to finish, since Renpy's structure is considerably more rigid than the usual flash project, this should make it easier for a second team to take up the baton.
Uh- the project's purpose is to serve as a primer on climate change for incoming freshmen who are taking environmental science classes solely because they don't want to take physics or chemistry, and have no previous experience with the subject.
I wanna thank Tom especially for all his help with my questions. Hopefully he gets a kick out of the project file- it's definitely not the conventional application of the renpy engine.
What kind of function does it call back to? A Python function? A renpy function? (it seems like it could take a renpy function, but to do anything intelligent with the passed values you'd need a python one...)
Specifically, I have a character who makes a call over the radio. I'd like to have an audio crackle play whenever he walks (but not after {w}'s)
Is that possible?
And while I'm posting (see me deviously slip this into the main forum...)
This is the project file of the educational prototype my Bio Systems class did for the College of St Catherines.
http://www.emopanda.com/2davids.zip
It's frustratingly incomplete- we were aiming to have 1 of the 3 'areas' done in addition to the shell/intro sequence. We ended up with that area implemented- but empty of content. Two days more and it would have been done-- how frustrating!
Oh well, it's still fun to look at- this is what happens when you dump more than 200 hours of photoshop into a project.
Our client seemed pleased- he's looking at giving the project files over to a couple of his grad students to finish, since Renpy's structure is considerably more rigid than the usual flash project, this should make it easier for a second team to take up the baton.
Uh- the project's purpose is to serve as a primer on climate change for incoming freshmen who are taking environmental science classes solely because they don't want to take physics or chemistry, and have no previous experience with the subject.
I wanna thank Tom especially for all his help with my questions. Hopefully he gets a kick out of the project file- it's definitely not the conventional application of the renpy engine.
- PyTom
- Ren'Py Creator
- Posts: 16122
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Character callbacks?
Wow... that's a really good use of Ren'Py's effects programming code. I just upped back up the sound buffer size, since I was getting some sound skipping.
(Of course, I'm not sure I buy climate change, or at least the premise that it's human-caused and something we should actively prevent.)
(Of course, I'm not sure I buy climate change, or at least the premise that it's human-caused and something we should actively prevent.)
It's a python function, that takes a single argument. You could write something like:derik wrote:What kind of function does it call back to? A Python function? A renpy function? (it seems like it could take a renpy function, but to do anything intelligent with the passed values you'd need a python one...)
Specifically, I have a character who makes a call over the radio. I'd like to have an audio crackle play whenever he walks (but not after {w}'s)
Code: Select all
init:
python:
def static_cb(event, **kwargs):
if event == "begin":
renpy.sound.play('static.ogg', channel=2)
$ sj = Character("Staticy Joe, the Electric Hobo", callback=static_cb)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Miko-Class Veteran
- Posts: 651
- Joined: Sat May 21, 2005 12:28 pm
- Location: University of Utah
- Contact:
Nah, class was broken up into small groups. And I did 95% of the PS work for mine.DaFool wrote:That is so insane! 200 hours photoshopping (by an entire class no less), no kidding!
You know, I've never seen utsukushii effects. I think the only link I ever found for it had expired.DaFool wrote:It's like utsukushii effects x 1000.
I'm actually rather self-conscious about the code, because I never bothered to clean up the pauses with touchbacks to skip you ahead if you skipped, so it's possible to throw some of the sequences off.
Four simultaneous panning elements with alpha (over 2000 pixels wide I think) plus particles might have been a bit much to ask of the software...ShiraiJunichi wrote:Wow- that's very impressive. It did seem a bit jumpy sometimes though- like when it would begin a pan or something.
Re: Character callbacks?
Oh, was that what was cauaing it? I assumed it was because I had all mp3's. (couldn't quite get the wav settings figured out to work.)PyTom wrote:Wow... that's a really good use of Ren'Py's effects programming code. I just upped back up the sound buffer size, since I was getting some sound skipping.
Do you have an ogg converter you recommend? (I know nothing about ogg format.)
Only 2/3 of the carbon dumped into the atmosphere by manmade processes gets scrubbed out again. The net result has been (IIRC) a 5% increase in carbon in the atmosphere.PyTom wrote:(Of course, I'm not sure I buy climate change, or at least the premise that it's human-caused and something we should actively prevent.)
You can sell me on the idea that the earth goes through hot/cold cycles as part of it's rotation- but I really don't believe the carbon cycle is supposed to fluctuate like that. 5% increase in a system that was at equilibrium... is bad.
(The project included us doing all our own research, I did deforestation for carbon binding, reading like 40 different articles and perspectives and synthesizing what I felt was 'really' happening.)
...that's loosk simple enough. Wait-- what's a 'kwarg'?PyTom wrote:It's a python function, that takes a single argument. You could write something like:derik wrote:What kind of function does it call back to? A Python function? A renpy function? (it seems like it could take a renpy function, but to do anything intelligent with the passed values you'd need a python one...)
Specifically, I have a character who makes a call over the radio. I'd like to have an audio crackle play whenever he walks (but not after {w}'s)
Code: Select all
init: python: def static_cb(event, **kwargs): if event == "begin": renpy.sound.play('static.ogg', channel=2) $ sj = Character("Staticy Joe, the Electric Hobo", callback=static_cb)
- PyTom
- Ren'Py Creator
- Posts: 16122
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Character callbacks?
You can grab the code to fix it from:derik wrote:Oh, was that what was cauaing it? I assumed it was because I had all mp3's. (couldn't quite get the wav settings figured out to work.)
http://www.renpy.org/wiki/renpy/releases/5.6.6
I tend to use the command-line oggenc, and I hear oggdrop is fairly good. One thing is that oggs can generally be encoded at fairly low quality settings, and still sound good... 1 or 2 is probably okay.Do you have an ogg converter you recommend? (I know nothing about ogg format.)
The thing is, CO2 has increased from 0.0313% to 0.0367% between 1960 and 2005. I show that as a 17% increase, but the absolute amount is fairly small.Only 2/3 of the carbon dumped into the atmosphere by manmade processes gets scrubbed out again. The net result has been (IIRC) a 5% increase in carbon in the atmosphere.
I'm not sure where you get the 5% from. You really need to give a time period on that. I'm showing 17% over 45 years, or about .4% increase a year.You can sell me on the idea that the earth goes through hot/cold cycles as part of it's rotation- but I really don't believe the carbon cycle is supposed to fluctuate like that. 5% increase in a system that was at equilibrium... is bad.
The thing is, it's not clear it's worth doing anything about. The temperature record is a statistical mess (see the Wegman report), so we don't have a good idea of temperature over time, or the amount of the change attributable to human causes.
It's also not clear that acting drastically now is the right response... A better approach might be to put money into projects like nuclear fusion (ITER) and pebble-bed reactors, and use those to lower the carbon output.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Character callbacks?
*checks his notes now that he's home.* OOhs, 5 years, not 5%, I knew there was a 5 in there somewhere.PyTom wrote:I'm not sure where you get the 5% from. You really need to give a time period on that. I'm showing 17% over 45 years, or about .4% increase a year.You can sell me on the idea that the earth goes through hot/cold cycles as part of it's rotation- but I really don't believe the carbon cycle is supposed to fluctuate like that. 5% increase in a system that was at equilibrium... is bad.
The thing is, it's not clear it's worth doing anything about. The temperature record is a statistical mess (see the Wegman report), so we don't have a good idea of temperature over time, or the amount of the change attributable to human causes.
It's also not clear that acting drastically now is the right response... A better approach might be to put money into projects like nuclear fusion (ITER) and pebble-bed reactors, and use those to lower the carbon output.
Here's my raw notes, I got basically the same picture from 4 different sources that went back to the numbers, so this is just the agregate.
The total amount of carbon in the atmosphere is increasing, to the tune of about 1% every five years, and it's not being scrubbed out again.Carbon in the atmosphere increased by 15 gigatonnes between 1994 and 2002, about 1.5 ppm per year. Total atmospheric carbon load was 765 gigatons.
Atmospheric carbon is increasing at 1.6gt per year, 20-25% of human carbon emissions.
Atmospheric carbon load increased by 1% every 5 years (or so)
Natural transfers of carbon dioxide are ~20 times greater than manmade ones.
The system was at equilibrium before man started throwing carbon into the atmosphere, if 20 units of carbon went up, it could scrub 20 units out again. But the margin of capacity in the cleaning cycle was only about 3%. So when suddenly 21 units of carbon were going into the atmosphere- only 20.8 units were begin scrubbed out, and that .2 stays, every year.
(That's leaving out how trees are one of the main carbon-binders, and how we're actually increasing over all amount of carbon in circulation by digging up and burning fossil fuels which has been in long-term storage.)
That the ATMOSPHERE is changing there can be no question- the real question is-- how much difference does it make?
Re: Character callbacks?
Leaving aside my opinion on climate change,
Do you really mean that, or should they both read 'gigatonnes' or both read 'gigatons'?derik wrote:Carbon in the atmosphere increased by 15 gigatonnes between 1994 and 2002, about 1.5 ppm per year. Total atmospheric carbon load was 765 gigatons.
Server error: user 'Jake' not found
Re: Character callbacks?
Probably the first one is wrong- these are my hand-types rough notes, which are full of spelling errors. (Is gigatonnes actually a word? Does it mean metric tons or something?)Jake wrote:Leaving aside my opinion on climate change,
Do you really mean that, or should they both read 'gigatonnes' or both read 'gigatons'?derik wrote:Carbon in the atmosphere increased by 15 gigatonnes between 1994 and 2002, about 1.5 ppm per year. Total atmospheric carbon load was 765 gigatons.
Re: Character callbacks?
Yeah - a 'tonne' is a metric unit equal to one thousand kilograms; a 'ton' is an Imperial unit which is apparently equal to just over 907 kilograms.derik wrote:(Is gigatonnes actually a word? Does it mean metric tons or something?)
Since a lot of science is done in SI [metric] units (since SI units are a lot friendlier to science than Imperial is) it's entirely plausible that your sources used 'gigatonnes' at some point, though.
(I'd have thought that it wouldn't be a good idea to give a metric unit a similar name to an existing Imperial one, since it would be easily confused... and mass already has the kilogram, after all...)
Server error: user 'Jake' not found
Re: Character callbacks?
That sounds unnecessarily confusing. The Metric System must be stopped, no matter the cost.Jake wrote:Yeah - a 'tonne' is a metric unit equal to one thousand kilograms; a 'ton' is an Imperial unit which is apparently equal to just over 907 kilograms.derik wrote:(Is gigatonnes actually a word? Does it mean metric tons or something?)
I recommend we steal all the Standard Kilograms- Tom can hit the ISK while he's in France. There's only about 80 of them worldwide, surely there's enough Renpy adherents to do one-each.
That will spell the downfall of international weights and measures, and the Metric System's tyrannical grip on the world.
I mean, lets face it... for all its rationalist propoganda- the metricicists have just replaced one set of arbitrary measures with another. Meters instead of feet, centimeters instead of inches. Kilometer, Meter, Centimeter and Millimeter. Four Inches is ten centimeters- not a decimeter. And when is the last time you heard someone give a size in decameters? (A term my spellcheck doesn't even recognize!) completely unused- even as measurements are rounded off to the nearest ten.
And while I'm not entirely certain, I have the sneaking suspicion that the length of a meter may actually CHANGE near a black hole.
Good old English Measures for me- let the British have their precious metric system, no matter how many satellites it costs us!
-
- Regular
- Posts: 113
- Joined: Sun Oct 08, 2006 1:29 am
- Location: BEHIND YOU!!!
- Contact:
Re: Character callbacks?
Corrected for truth.derik wrote:That sounds unnecessarily confusing. The US measurement System must be stopped, no matter the cost.
- PyTom
- Ren'Py Creator
- Posts: 16122
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
I actually think the US system is more elegant, since it's based on powers of two, rather than powers of ten. Give me a gallon measure, and I can make you a quart measure... It's much harder to make deciliters from a liter measure.
(I will admit that linear measure is screwed up. I think nautical miles is the only really elegant unit in that department.)
(I will admit that linear measure is screwed up. I think nautical miles is the only really elegant unit in that department.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Who is online
Users browsing this forum: No registered users