Page 1 of 1

2 questions about GE 1.4

PostPosted: Tue Jul 06, 2010 6:53 am
by DST
Question 1: I'm getting an error using sprintf: " Eic sprintf created an empty string. "
This happens on other games i load, not just the one i'm working on, on actor variable strings (made with the variables tab). These same games work properly on version 1.3.9.

Question 2: how do you use the joystick axis function? the buttons make sense, but there's no documentation about the axis.


Thanks

Re: 2 questions about GE 1.4

PostPosted: Tue Jul 06, 2010 7:29 am
by Bee-Ant
I use ubuntu 9.10

I got that message too...
The only way to avoid it is close the GE then reload the project from File history.
(oh Dee, I think we talk about the same project :P)

Thanks for fixing the copy-paste problem. But,the script generator (maybe) when we click Add on function isn't fixed yet.

Haven't found more bugs. I'll give report again later.

Re: 2 questions about GE 1.4

PostPosted: Tue Jul 06, 2010 8:48 am
by Hblade
SOLVED THIS ISSUE :D (I think)

Open terminal - type -" sudo bash "- Then drag'n'drop gameEditor to terminal, and press enter :D THis should run GE as administrator which is important in the new GE for some reason :O

Re: 2 questions about GE 1.4

PostPosted: Tue Jul 06, 2010 3:19 pm
by Bee-Ant
Still the same.
I can't run the drag and dropped GE into terminal.
So,I run GE through this way :
1. Go to GE directory
2. Right click->Open in terminal
3. Type: sudo bash
4. Type: ./gameEditorLinux
5. So far, I can run the GE
6. I went to Global code
7. Click Variable/function
8. Chose DestroyActor
9. Click Add
10. Autoclose
And here's the message screenshot after it autoclosed...

Re: 2 questions about GE 1.4

PostPosted: Tue Jul 06, 2010 3:44 pm
by makslane
DST wrote:Question 1: I'm getting an error using sprintf: " Eic sprintf created an empty string. "
This happens on other games i load, not just the one i'm working on, on actor variable strings (made with the variables tab). These same games work properly on version 1.3.9.


I will see this issue

Question 2: how do you use the joystick axis function? the buttons make sense, but there's no documentation about the axis.


There no support for joystick (no event buttons). The joystick can be used to simulate the accelerometer:

http://game-editor.com/docs/script_refe ... elerometer

Re: 2 questions about GE 1.4

PostPosted: Tue Jul 06, 2010 5:38 pm
by DST
makslane wrote:
There no support for joystick (no event buttons). The joystick can be used to simulate the accelerometer:

http://game-editor.com/docs/script_refe ... elerometer


By "no support" do you mean "WORKS GREAT!?" Here's sample script so everyone can get started using joysticks!!!!

Code: Select all
Vector v = getAccelerometer();
char j0= GetJoystick1Button(0);
char j1= GetJoystick1Button(1);
char j2= GetJoystick1Button(2);
char j3= GetJoystick1Button(3);

xvelocity = v.x*5; //where *5 is your desired speed
yvelocity = v.y*5;

if(j0){
yvelocity=-12;
             }
if(j1){
CreateActor("bullet", etc. etc      }


each button must be made into it's own char x=get line. Works fabulous on my controller, which is one of these:

41FQH0FSW2L.jpg

An inexpensive Tremon usb controller, but very durable.


In regards to my other question, I did what bee-ant suggested and simply restarted GE. The eic sprintf problem has not bothered me since. The new ge runs very fast, and is exceptionally stable on XP. 2 days now, and not a single crash on any game.

:D :D :D :D Muy Bueno!!!!!!

Re: 2 questions about GE 1.4

PostPosted: Tue Jul 06, 2010 10:07 pm
by Hblade
The problem with PC controllers is, they all have different number positions
Mine is:
Code: Select all
    4
1      3
    2

Where the buttons are, while yours are different :O

Re: 2 questions about GE 1.4

PostPosted: Tue Jul 06, 2010 10:53 pm
by Hblade
What about the analog buttons? The up down left right :o This is for the joysticks, but is there a way to enable the analog only :o

Re: 2 questions about GE 1.4

PostPosted: Wed Jul 07, 2010 12:21 am
by DST
Hblade wrote:The problem with PC controllers is, they all have different number positions


You can easily make a key config for the player, in the start menu of your game. Dillodude posted an example of that years back on the forum, and i've used it in a couple of my games too.

Hblade wrote: is there a way to enable the analog only


Don't know, i don't like analog sticks anyway so i can't help you there.

Re: 2 questions about GE 1.4

PostPosted: Wed Jul 07, 2010 12:25 am
by Hblade
Sorry, I meant the Dpad, the vector method uses the analog sticks, which uh, with your method anyone iwth a joystick would be able to slowly move if they barely move the stick :o

Re: 2 questions about GE 1.4

PostPosted: Thu Jul 08, 2010 3:22 am
by makslane
DST wrote:Question 1: I'm getting an error using sprintf: " Eic sprintf created an empty string. "
This happens on other games i load, not just the one i'm working on, on actor variable strings (made with the variables tab). These same games work properly on version 1.3.9


Fixed. Please, download again.

Re: 2 questions about GE 1.4

PostPosted: Thu Jul 08, 2010 3:50 am
by DST
Hblade wrote:Sorry, I meant the Dpad, the vector method uses the analog sticks, which uh, with your method anyone iwth a joystick would be able to slowly move if they barely move the stick :o


Found an easy fix for that: To use the d-pad (also known as a pov hat) while preventing bumping the analog sticks and/or poor calibration leaving ghost control, you just have to get rid of low values:

Code: Select all
if(v.x>.3){
xvelocity=v.x*speed;
}


This is actually a good idea to do anyway, due to the way the accellerometer works - positive screen coords + 0 values tend to make the player want to move to 0, 0 on his own.