[ASK] What Functions do you use most?

You must understand the Game Editor concepts, before post here.

[ASK] What Functions do you use most?

Postby Bee-Ant » Mon Jan 26, 2015 7:44 pm

The title says it all.

I'm wondering what event and functions do people use most in GE. Please list them all.



EDIT:
Event in this case are:
- Collision
- Create Actor
- Draw Actor
- Keydown
- etc

Function in this case are:
- Physical Response
- MoveActor
- Create Actor
- Play Sound
- etc
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: [ASK] What Functions do you use most?

Postby schnellboot » Mon Jan 26, 2015 7:54 pm

definately Draw Actor and Script Editor haha
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: [ASK] What Functions do you use most?

Postby lcl » Mon Jan 26, 2015 8:03 pm

Here's my list :)

Events:
  • Activation Event (through code, not the colored lines created via right-clicking)
  • Collision
  • Create Actor
  • Draw Actor
  • Key Down
  • Key Up
  • Mouse Button Up
  • Mouse Button Down

Actions (as in the list that pops up after selecting an event):
  • Script Editor (I don't use any other ones, all those can be done in script editor with more flexibility, so why bother?)

Functions (as in built-in script editor functions in GE):
  • ActorCount
  • ChangeAnimation
  • ChangeAnimationDirection
  • CreateActor
  • DestroyActor
  • EventDisable
  • EventEnable
  • ExitGame
  • GetKeyState
  • SendActivationEvent
  • VisibilityState
  • And of course all the basic C functions like math functions, file i/o, drawing functions, etc. I'm too lazy to name all those :P

EDIT: How about you, Bee-Ant?
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: [ASK] What Functions do you use most?

Postby Jagmaster » Mon Jan 26, 2015 8:34 pm

I haven't used GE in a long time. I doubt these are supported in c, but I'm getting pretty addicted to lists in c#, they're pretty handy for things like databases and inventory systems.

As for GE functions, I can't count the amount of times I had to put a physical response function on my actors. That was one of the reasons I was looking forward to box2d integration many moons ago.

Other than that, my list would be pretty much identical to Bee-Ant's, schnellboot's and lcl's.

I think there was one other custom function, like getActor2 or something like that that I used a lot.

also fprintf, since that was the only decent way to edit a string lol.
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score

Re: [ASK] What Functions do you use most?

Postby Bee-Ant » Tue Jan 27, 2015 6:18 am

Thanks for the list everyone :D

schnellboot wrote:definately Draw Actor and Script Editor haha

Can't live without it too :P

Jagmaster wrote:but I'm getting pretty addicted to lists in c#, they're pretty handy for things like databases and inventory systems

Javascript has that too. It's quite fun to play with indeed.

lcl wrote:How about you, Bee-Ant?

I used to use the following Event(s):
- Animation Finish
- Collision
- Collision Finish
- Create Actor
- Draw Actor
- Key Down
- Key Up
- Timer

The following Action(s):
- Script Editor

The following Function(s):
- Change Animation
- Change ZDepth
- Create Actor
- Create Timer
- Destroy Actor
- Destroy Timer
- Exit Game
- Load Game
- Physical Response
- Play Music
- Play Sound
- Visibility State
- fread
- fwrite
- getclone
- max
- min
- rand
- strcat
- strcmp
- strcpy
- strlen

The followings Variable(s):
- x
- y
- xvelocity
- yvelocity
- angle
- directional_velocity
- r
- g
- g
- transp
- animpos
- animindex
- width
- height
- cloneindex
- musicvol
:mrgreen:
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: [ASK] What Functions do you use most?

Postby MrJolteon » Tue Jan 27, 2015 8:40 am

if
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: [ASK] What Functions do you use most?

Postby tvz » Thu Jan 29, 2015 3:59 pm

MrJolteon wrote:if
same for me

Events:
- Animation Finish
- Collision
- Create Actor
- Draw Actor
- Key Down
- Key Up
- Timer

Functions:
- Change Animation
- Create Actor
- Create Timer
- Destroy Actor
- Destroy Timer
- Exit Game
- Load Game
- Physical Response
- Play Music
- Play Sound
- Visibility State
- getclone

Variables:
- r
- g
- b
- x
- y
- xvelocity
- yvelocity
- angle
- directional_velocity
- height
- width
- cloneindex
- musicvol
- animpos
- transp

and my favourite line of code is

Code: Select all
animpos=cloneindex; //XD
I have not left.
User avatar
tvz
 
Posts: 98
Joined: Sun Mar 10, 2013 7:13 am
Location: Your PC screen
Score: 3 Give a positive score

Re: [ASK] What Functions do you use most?

Postby Bee-Ant » Thu Jan 29, 2015 6:57 pm

MrJolteon wrote:if

I think it's a conditional check instead of function?

@tvz: Ha... use that code too. Usually for menu button ;)
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: [ASK] What Functions do you use most?

Postby lcl » Thu Jan 29, 2015 7:33 pm

Bee-Ant wrote:
MrJolteon wrote:if

I think it's a conditional check instead of function?

Yes, Bee-Ant is right, if is not a function. In C, if is a keyword for conditional statement.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: [ASK] What Functions do you use most?

Postby Zivouhr » Wed Jun 03, 2015 1:13 am

Nice lists of functions. I use a lot of those also. My favorite is the script editor since it lets you copy/paste codes.

Question I've had is about the key down functions.

While there's an automated way to click on actor/keydown event (select the keys)/script editor or event applied, is there a way to manually create a key down event within a script itself?
For example, I'm guessing you can't add a key down event in let's say, a create actor script editor to create manual code for a keydown:

In other words, is there ever a way to script the drop down choices for a key down event within a script editor of create actor?
KEY DOWN:
"Press the key or key sequence" Keys: Right, right, right, left
Execute when: Keys are pressed in order
Repeat: Enable
Script Editor

It's a weird question but sometimes I'm in a script editor window, and wish I could figure out how to access the key down options, but have never seen an example of it in a script, so imagine it might not be possible, since Makslane programmed the Key Down Function as a drop down choice in Add/Events.
Just like we probably can't script a "Draw Actor" separately outside of the add/draw actor event.
I don't recall what I was going to use this for other than more control options, so it's not a big deal. I just need to learn more about C and its logic for more complex commands.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score

Re: [ASK] What Functions do you use most?

Postby koala » Wed Jun 03, 2015 6:19 am

I was wondering the same thing. Good question.
Phascolarctos cinereus
YouTube: Marko Radivojevic
Google+: Marko Radivojevic
User avatar
koala
 
Posts: 301
Joined: Thu Mar 26, 2015 7:03 pm
Location: Serbia
Score: 30 Give a positive score

Re: [ASK] What Functions do you use most?

Postby Zivouhr » Thu Jun 04, 2015 12:51 am

Thanks Koala. I remember I wanted to apply those features in a player/drawactor/script editor event, especially the repeat enabled or disabled option most of all.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score

Re: [ASK] What Functions do you use most?

Postby bat78 » Thu Aug 06, 2015 11:39 pm

Short answer - it's possible.
Is it hard - no

You can use the function getLastKey that returns the corresponding decimal number (known as key code) of the last pressed key.
Game-Editor defines several macros in order to provide textual representation of these key codes.
KEY_a
KEY_LEFT

etc
There is another function that converts key code into a context string. To assure yourself, you can use something like that:
Code: Select all
sprintf(text, "Last pressed key: [%s]", getKeyText(getLastKey()));

And the last but not the least, a function to return the condition of all the keys. It returns a statically allocated array with the condition of each key (whether it is pressed or not).
Code: Select all
char *key = GetKeyState();

if(key[KEY_a]) {...}
//or if(key['a']) {...}


Now you can use these functions to compose functions such as:
Code: Select all
int keyDown (int keyCode, int repeat); // Returns 1 if the key specified by keyCode is pressed, set repeat to 1 if you want it to return 1 if it is held.
int keyList (int keyCodes [], int repeat); // Returns 1 if at least one of the keys specified by keyCode is pressed, set repeat to 1 if you want it to return 1 if it is held
int keySequence (int sequence []); // Returns 1 if all the keys specified by sequence are pressed
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: [ASK] What Functions do you use most?

Postby Zivouhr » Thu Oct 08, 2015 8:44 pm

Thanks for the information Bat. I'll take a look into it.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest