Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - RetroX

961
Tips, Tutorials, Examples / choose(), mean(), median()
« on: October 08, 2008, 05:57:05 PM »
Well, I've looked at a C++ tutorial, and decided to finish up the math functions.

WARNING: I have not tested this, although I am pretty sure it will work.

First, go to fnames.txt and add the following to the bottom of the file:
int choose(int arg1, int arg2, ...)
int mean(int arg1, int arg2, ...)
int median(int arg1, int arg2, ...)


Now, go to GMmathnc.h in ENIGMAsystem/SHELL/Universal_System and add this to the bottom of the file:
// May not be necessary; just in case ENIGMA doesn't include them already
#include <stdarg.h>

int choose(int num1, int num2, ...)
 {
 va_list choices;
 int i;
 int j=0;
 int array[];
 va_start(choices,num1);
 for (i=arg1;i!=-1;i=va_arg(choices,int))
  {
  array[j]=i;
  j+=1;
  }
 va_end(ap);
 return array[random(j)];
 }

int mean(int num1, int num2, ...)
 {
 va_list choices;
 int i;
 int j=0;
 int total=0;
 va_start(choices,num1);
 for (i=arg1;i!=-1;i=va_arg(choices,int))
  {
  total+=i;
  j+=1;
  }
 va_end(ap);
 return total/j;
 }

int median(int num1, int num2, ...)
 {
 va_list choices;
 int i;
 int j=0;
 int array[];
 va_start(choices,num1);
 for (i=arg1;i!=-1;i=va_arg(choices,int))
  {
  array[j]=i;
  j+=1;
  }
 va_end(ap);
 return array[(int)((j-1)/2)];
 }

PLEASE NOTE:
 - The above functions only work with integers (no decimals/fractions).
 - While they may not work in the setup I have provided, I am very positive that the scripts will work, and Josh may feel free to implement these into R4.

962
General ENIGMA / R3.5
« on: October 07, 2008, 06:27:18 PM »
I know Josh had a few troubles, and school's back, but I want sounds, colligma, possibly surfaces, and some form of sprite_set_alpha_from_sprite() so I can make some awesome games.  If someone knows of a way to do that in R3 with C++, please point it out, or else make R3.5.  Joshy is in need, help him out. ;)

963
Announcements / Re: Colligma 2.0
« on: October 05, 2008, 12:16:13 PM »
Does this mean I can has preciseness?

964
General ENIGMA / Re: This.
« on: October 05, 2008, 12:15:35 PM »
SourceForge is so unoriginal, a2h is trying to be unique.

965
Off-Topic / Re: Where do I find the floor Function...
« on: September 21, 2008, 02:20:39 PM »
I am a box filled with secrets.

966
General ENIGMA / Re: How is development going?
« on: September 21, 2008, 02:19:37 PM »
Patience, young padawan.

967
Off-Topic / Re: Where do I find the floor Function...
« on: September 14, 2008, 03:30:52 PM »
It's in math.h.

968
Off-Topic / Re: Where do I find the floor Function...
« on: September 14, 2008, 11:17:10 AM »
Here's an EDL equivelent...
Code: [Select]
var real, str, decpos, newstr;
real=argument0;
str=string(real);
decpos=string_pos('.',str);
newstr='';
for (i=1;i<decpos;i+=1;)
 {
 newstr+=string_char_at(i,str);
 }
return real(newstr);

969
General ENIGMA / Source Generator?
« on: September 13, 2008, 04:09:01 PM »
Curious... but would it be possible to have an option to output the C++ source generated so we can modify it if we want before compiling it?  I was curious, and it probably wouldn't be hard considering ENIGMA generates the source anyways before compiling.

970
Announcements / Re: Enigma R3 Released
« on: September 13, 2008, 04:04:48 PM »
Just curious... how will it work for MAC/Linux?  Neither supports EXE or anything like it, and don't they require installing?

Even if it was EXE, there isn't WINE for MACs.

971
Tips, Tutorials, Examples / Re: move_contact_solid();
« on: September 13, 2008, 04:02:09 PM »
I don't know C, so I put it in there in case.  It doesn't mess it up if it does.

972
Website Bugs / Re: Category Titles
« on: September 13, 2008, 04:00:11 PM »
If you don't delete the BG image or specifically put "background-image: none;" in the CSS, it tends to show.

973
General ENIGMA / Re: A Different Event/Sprite/Sound System
« on: September 13, 2008, 03:58:23 PM »
I'd like a different renderer.  My platformer on the EDC was originally full gradients, but it got colorlimitized.

974
Tips, Tutorials, Examples / Re: A Few Alternate Functions
« on: September 05, 2008, 06:14:43 PM »
Just shut the hell up, serprex. >_>

975
Tips, Tutorials, Examples / Re: motion_add();
« on: September 05, 2008, 06:13:18 PM »
I assemble code.  I don't "save space" like you do.