2018-10-01 06:09:07 (edited by DJWolfy 2018-10-23 08:32:20)

yeah, I'm gonna post a little bit of sourcecode that I made here. if anyone can help me. here is y struggle. spawn_mine is not working when in fact it is made already. could you help? thanks in advance.
mine@[]mines(0);
class mine
{
int x;
int y;
mine(int mx,int my)
{
x=mx;
y=my;
}
void spawn_mine(int x, int y)
{
mine m1(x, y);
mines.insert_last(m1);
}
}

2018-10-01 06:10:01

and here is the line of source that is not working.
spawn_mine(me.x,me.y);
thanks again!

2018-10-01 06:27:54

This is happening because spawn_mine is defined inside the mine class. If you want to call it globally you have to keep spawn_mine(); outside the class definition. So you would do like this
mine@[] mines(0);
class mine
{
int x, y;
mine(int mx, int my)
{
x=mx;
y=my;
}
}
void spawn_mine(int x, int y)
{
mine m1(x, y);
mines.insert_last(m1);
}

Paul

2018-10-01 06:56:08

aha! thanks!

2018-10-01 15:16:03

that's the concept of scope, which I am not qualified to explain properly, but I'm sure others here are.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2018-10-03 05:58:32

hi, new problem, on line 82 in zombie.bgt, if(zombiesleft bracketiright bracket.x==minesleft bracketiright bracket.x)
description: index out of bounds. if someone can help that would be great. you can look at the source of the mine.bgt class in post 2, if there's a problem in that, let me know, if not then I will post the zombie.bgt class up here too.
also the reason I put left bracket and right bracket is because the forum doesn't let me put those punctuation marks, do not know why.

2018-10-03 16:13:35

I don't understand what all this bracketiright stuff is in the if statement. I'm guessing either you or the foroum software might have converted it, but if that's not the case, that can't be there. Index out of bounds means that your code is trying to access something in an array outside of what the array currently contains. That's something it cannot do, so throws an error, but I think you probably already knew that. To learn more it would be necessary to see what's writing to that array and when.

Just in case you didn't know, if statements are meant to contain expressions to test so if (var == var2) if (var != var 2) and all your less than, greater than, less or equals, greater or equal, and all that stuff.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2018-10-10 11:35:46 (edited by DJWolfy 2018-10-10 11:37:29)

hi all. so today I got this weird bug, where when I am at the objects x it still won't let me grab him! please help! the sound is sounding like it is coming from right in front of me.

2018-10-10 14:25:37

We can't really help with just that...

2018-10-11 10:03:49

actually I think I know what the problem is, fixing now.

2018-10-23 08:34:20

oh omg omg omg, an unexpected end of file error. putting this here, need help urgently. the menu source for the thing, which has the error: it does has urls but who gives a fuck.
dynamic_menu_pro m;
void setupmenu(bool music=false)
{
m.reset(false);
if(music==true)
{
m.add_music("menumus.ogg");
}
m.enable_first_letter_navigation=true;
m.click_sound="menuclick.ogg";
m.enter_sound="menuenter.ogg";
m.enable_up_and_down=true;
m.wrap=false;
m.enable_home_and_end=true;
}
void mainmenu()
{
setupmenu(true);
m.add_item_tts("play game.","play");
m.add_item_tts("online functions","online");
m.add_item_tts("see level and other information","levelotherstuff");
m.add_item_tts("exit","quit");
int mres=m.run("main menu! please select an option.",true);
if(m.get_item_name(mres)=="play")
{
m.fade_music(20);
speak("3!");
enemlevel=level;
wait(1000);
speak("2!);
wait(1000);
speak("1!);
wait(1000);
speak("fight!);
yourtimer.restart();
enemytimer.restart();
game();
}
if(m.get_item_name(mres)=="online")
{
connect();
}
if(m.get_item_name(mres)=="levelotherstuff")
{
levelcheck();
}
if(m.get_item_name(mres)=="exit")
{
exit();
}
}
void levelcheck()
{
alert("you are level"+level+"at the moment. there are no other stats");
mainmenu();
}
void connect()
{
speak("connecting to server, and obtaining information.");
int maxen=url_get("http://rorygames.jc-hosting.me/enemynumber.txt");
int maxen2=random(1,maxen); enemname=url_get("http://rorygames.jc-hosting.me/enemy"+maxen2+"name.txt");
enemlevel=url_get("http://rorygames.jc-hosting.me/enemy"+maxen2+"level.txt");
speak("you are fighting"+enemname", who is at level"+enemlevel+". good luck!");
wait(3000);
speak("3!");
wait(1000);
speak("2!");
wait(1000);
speak("1!");
wait(1000);
speak("fight!");
yourtimer.restart();
enemytimer.restart();
game();
}

2018-10-23 09:14:47

on which line are you getting the error?

Paul

2018-10-23 15:59:56

Did I ever post my updated matcher script that is better at finding quotes and keeps track of what line it's on? It's the one I use when one of these shows up.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2018-10-26 08:07:14

hi guys! fixed now.
so here is a little bit of source that you should understand
if(punch1==keyleft and punch2==keymiddle and punch3==keyright)
thats for left hook jab and right hook, respectively. anyway
{
bablabla whatever inside them
}
if(whatever the next line that makes a combo could possibly be. if you need more information please ask, if ya don't then... heeeelp!);

2018-10-26 08:07:48

because, the combos are not working!

2018-10-26 12:39:19 (edited by kianoosh 2018-10-26 12:40:57)

Hi. I tried to download that game and give it a look but that uploadcenter annoys. Anyways i'm not hear to talk about the uploadcenter. When I make a comboing system, I get a string, Log the pressed keys in the string in what ever form i like. For instance, If d key is pressed then log "d" or "key_d" in the string. Next, I declare a timer and restart that timer everytime one of the keys that is related to combos is pressed.
So now if that timer elapses more than 1 second the string clears thus resetting the combo. Then in a condition which is being checked in my loop, I check when ever the string is equal to "DSS" or "key_dkey_skey_s" Perform the x combo and clear the string to player be able to perform a combo again quickly without waiting for the timer to elapse and clear the string. Or once i didn't clear the string and made another condition below that condition which would be like this for instance: if string is equal to "DSSDA" or "key_dkey_skey_skey_dkey_a" perform the y combo and then clear the string. This would do this:. When the player would do dss it would perform the x combo and if they would press D A quickly the y combo would be performed right after the x combo, Resulting of a big hit.

---
Co-founder of Sonorous Arts.
Check out Sonorous Arts on github: https://github.com/sonorous-arts/
my Discord: kianoosh.shakeri2#2988

2018-10-27 00:13:32

ok, urm, how do I log things in strings. I am sorry, I am so, so so new to bgt.

2018-10-27 07:46:09

use the bgt logger include.

best regards
never give up on what ever you are doing.

2018-10-27 23:07:55

where do I get that from?