05 Mar 11, 06:24PM
The script requests/brainstorming thread!
|
06 Mar 11, 12:29AM
I finished it, but I'd really like the on-off switch. . .how would you go about putting a switch in the code?
06 Mar 11, 12:38AM
Do a check on an alias.
so: if (= $on/offswitch 1) [] [] That should get you on your way :)
06 Mar 11, 12:43AM
thanks much, I'll look into it.
I don't think cubescript uses booleans, so you would do this using something like this:
[SELECT ALL] Code: bind <KEY> [ if (= $talk 1) [ talk = 0 ] [ talk = 1 ] ] there is also a way to save variables to saved.cfg, so it will remember your toggle after closing AC, but i don't know it. EDIT: wow, i should really concentrate on one thing at a time.
06 Mar 11, 01:09AM
so how would I install this, does it go directly into the code, or is it just in autoexe?
techincally, you could put your whole script into the autoexec, that is just not a smart thing to do as it will quickly get messy. You should put it into your code.
06 Mar 11, 01:47AM
kk, thanks. I'll do that, and if I screw it up, i'll come back here :)
06 Mar 11, 03:55AM
Thanks, V-Man.
@Orynge, sorry, my mind gets away from me sometimes. ^^'
14 Apr 11, 09:00AM
I'd like to see a script that efficiently calculates decimal/fractional/irrational exponents; for that matter, I'd also like to see a script that efficiently calculates the nth root of a given number.
I say "efficiently" because I have a few behemoths that lumber around in my CPU for a few seconds, then spit out a semi-accurate result. Here they are, if it helps: [SELECT ALL] Code: // ffract: estimates the fraction equivalent of a given floating-point number Example: [SELECT ALL] Code: ffract 3.141593 Using powf to find 3^3.141593, the engine has to use this result in nthroot: [SELECT ALL] Code: nthroot 115267 3 Then part of the formula requires the engine to calculate this: [SELECT ALL] Code: pow 3 115266 Maybe AC could include Bignum... My brain feels like big num now.
14 Apr 11, 01:34PM
Use cases, please?
:D
14 Apr 11, 07:29PM
Case: Generating a random integer with normalized distribution (as opposed to the default uniform distribution).
Most algorithms that produce this require fractional/decimal/irrational exponents. I've found partial satisfaction in a script that looks like it's producing normalized distribution, but now reaching "true" normalization feels like a challenge I can't back down from. XD
14 Apr 11, 07:39PM
Okay, okay, I got it. *cough*
:D "Looks like" sounds good enough anyway, doesn't it?
14 Apr 11, 09:02PM
Yeh...
Like I said, it's now a challenge I can't back down from. I made a script to test my attempts at distribution. It takes a row of cubes in a map and treats it like a number-line, raising a cube on each "number" every time it comes up in a run of random numbers. My latest and best attempt looks like this: Given an attractor of 32 (and it sort of dips down right there :S).
15 Apr 11, 02:24AM
(06 Mar 11, 12:54AM)Lantry Wrote: ... [SELECT ALL] Code: bind <KEY> [ talk = (- 1 $talk) ]
So when the talk alias reaches -1231312414 it resets?
VenteX Wrote: WIN. personally I prefer manual labor so I hit / then delete to talk :D can't unlearn it. (05 Mar 11, 02:29AM)ChaoticToSayTheLeast Wrote: Killzones. Land in an area and die. Make spike/lava/tar pits that WORK. Fall into a hole and die. Stuff like that. Requires 1105. [SELECT ALL] Code: x 4 Loop it for practicality, bind it for testing. Also, if you create a die alias for each axis, you can define areas/volumes that kill the player.
15 Apr 11, 09:42PM
15 Apr 11, 10:47PM
15 Apr 11, 11:32PM
Oh, instead of setting talk to 0 j00 subtact 1 and set it to zero. AHUAHUHAUHSUAS
16 Apr 11, 12:03AM
V-Man... I'm not sure if this is any more efficient than yours, but...
[SELECT ALL] Code: nthroot = [ result (powf 2 (divf (log2 $arg2) $arg1)) ] Could it be that you're already doing this? I can't tell. (15 Apr 11, 11:32PM)Gibstick Wrote: Oh, instead of setting talk to 0 j00 subtact 1 and set it to zero. AHUAHUHAUHSUAS You must've misunderstood the original equation; it's 1 minus talk, not talk minus 1 "Coming up next on VenteX's CubeScript MindF***s: swapping the numeric contents of two aliases without creating an extra one!"
Didn't see that, oops.
Oh and $arg1 counts as an alias, but is it cheating if we use cmdbuf? (16 Apr 11, 12:03AM)Yarukinasu Wrote: V-Man... I'm not sure if this is any more efficient than yours, but... :/ Well, I'm trying to get "nthroot" so that I can make a reliable "powf" script. Using your method, they'd loop forever and you'd have to pull the plug on your computer just to get it to stop. XD [SELECT ALL] Code: powf = (stuff using nthroot) To phrase it differently... That's great! So efficient! Can you think of an efficient script for "powf"? @Gibstick: The engine doesn't treat the args like aliases per se... You can nest simultaneous scripts that all use $arg1, for example, and one doesn't necessarily affect the content of another script's $arg1. Usually. Muahahah. Also, cmdbuf is much like this. To really get around having to use an alias, I'd use (keybind) on an open key... If I can find one. ;-) (16 Apr 11, 01:45AM)VenteX Wrote: "Coming up next on VenteX's CubeScript MindF***s: swapping the numeric contents of two aliases without creating an extra one!" [SELECT ALL] Code: a 2 Didn't bother testing it. Edit: Holy fuck, 2:28 AM and I got it right. New usertitle.
Missing "=" ?
* V-Man considers making this: [SELECT ALL] Code: alias / [divf $arg1 $arg2] (16 Apr 11, 07:22AM)Mael Wrote: This will not work if a and b are both negative numbers, but you're on the right track. [SELECT ALL] Code: a 2 Fixed :) * VenteX wants to copulate more minds. Maybe he should get started on his long-planned CubeScript based map gen- you know what, I'll let that wait.
17 Apr 11, 01:49AM
+f and -f!!!1
one sec- are you sure you mean copulate?
http://dictionary.reference.com/browse/copulate 0.o * Lantry shudders |
« Next Oldest | Next Newest »
|