[ian-reeds-games] Re: question about transformation script

  • From: Monkey <murtagh69.monkeys@xxxxxxxxx>
  • To: ian-reeds-games@xxxxxxxxxxxxx
  • Date: Thu, 11 Jun 2015 18:39:04 -0600

I saw that, actually. I like your version better now hahaha.

On 6/11/15, Craig Brett <dmarc-noreply@xxxxxxxxxxxxx> wrote:

Ah, whoops, I could do that too!

I've already gone ahead and implemented it so that you can optionally
pass in a separator now, but it defaults to "|" if none is given.

Good idea though

On 11/06/2015 19:57, Monkey wrote:
You could just copy my function into your script file. *shrug* That's
what I meant by "using it," and it's pretty much yours anyway.



On 6/11/15, Craig Brett <dmarc-noreply@xxxxxxxxxxxxx> wrote:
Much as I appreciate your hard work, I can't just use your function, as
it'll then mean my scripts are dependent on yours. Which is not a good
thing. If we had dependency resolution or something (like NuGet or
chocolatey), we could do something like that. But I just don't think
it'd be useful enough to build that kind of thing in.

I'll probably either extend my current random splitting function to take
in an optional separator, which will mean it'll be more futureproof, or
else only use this function if yours hasn't been loaded (you can check
for the presence of a function in javascript, which is how I do
string.format).

Maybe I should look at using more of the built in scripts and extending
those. I don't really know what's in there or whether they work with
everyone's scripts, but there's probably a few common things like this
that everyone might find useful.

On 11/06/2015 07:40, Monkey wrote:
Computer? Derp, oops. Sorry about that.

And if the slashes are what's decided, I already modified your
randomSelectString for one of my scripts because the "|" would have
looked a bit awkward...as I think we have discussed in the past.
function slashString(original) {
if (original.indexOf("/") == -1)
return original;
var choices = original.split('/');
var randomIndex = Math.round(Math.random() * (choices.length - 1));
var pick = choices[randomIndex];
return pick;
}
Not much of a change, of course. So credit still definitely goes to
you.
Just so we both don't have the same thing with a different function
name... It would be a bit pointless, aha.

On 6/10/15, Craig Brett <dmarc-noreply@xxxxxxxxxxxxx> wrote:
It wouldn't be the AI choosing anything, it'd be the computer. There's
a
subtle difference. I'm not doing any funky business with a range,
though, that sounds like an unnecessary hassle.

Yeah, I could give that a look. I'd probably just extend the existing
transforms_into scripts. If that's what you're thinking. Having them
take random arguments would be easy. I'd probably have it so you could
do:

transforms_into cat/dog/bird

Or maybe

transforms_into cat|dog|bird

Both read alright to me and both mean randomly pick one, slash is more
gramatically correct but computer speak wise, "|" means "or". Any
strong
preference?

On 11/06/2015 06:04, Monkey wrote:
Wait, what do you mean with range? I'm not sure we're on the same
page
here.
My understanding is that you want the AI to choose a random effect
from a list. That's simple enough to create.

On 6/10/15, Kyle Davis <kyles.supernova@xxxxxxxxx> wrote:
i don't know how to achieve this so far what i learned is that you
will
need to sepperate each effects and then have each effects hashed as
integers for instence the first effect in the line would be 1 and
the
next would be 2 and so on and then take the integer values and make
it
into a range like 1r2 or 1r3 and etc then put it through the shared
calculate flag to be calculated at which it would randomly pick any
number in the range and then send it to shared apply effects flag
and
have flags to apply this effect to either a unit and or tile but i
could
be completely wrong about it, it seems to me that it should go.

On 6/10/2015 2:45 PM, Monkey wrote:
A random effects script is very easy to do, I think. *shrug*

On 6/10/15, Kyle Davis <kyles.supernova@xxxxxxxxx> wrote:
if that is so i guess i would try maybe having transformations on
different 0 duration effects a course this would require that tb
has
the
capability of having random effects flags, i am remembering that
it
was
mentioned a few months ago and maybe having it added on in later
versions.

On 6/10/2015 2:22 PM, Monkey wrote:
I'm pretty sure that's possible, although I'm not sure if he's
going
to want to add that.

On 6/10/15, Kyle Davis <kyles.supernova@xxxxxxxxx> wrote:
i wonder is it possible to have random unit type transformations
for
instence i have a curse that could turn a unit into a random
creature
lets say i have cat, dog, and bird as the argument and when i
have
it
cast on a unit the game engine will randomly selects one of the
unit
type i have placed in it and then turn that unit into the
randomly
selected unit type











--
-Mew
__________
http://www.savethefrogs.com/

Other related posts: