Menu

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.

Show posts Menu

Messages - Wyz

#41
Hmm I checked and this seems to be a problem of recent AGS versions. There is another struct that has the same function but those should not clash.  Hmm I guess I'm going to write a bug report on this. Which AGS version are you using?
#42
Congrats Guys! I genuinely hope this will become the platformer of 2016! (nod)
I'll check it out!
#43
I guess doing checks in rep_exec is inevitable but you can organise them using a struct:
Code: ags

enum TimerEventType
{
    eEvtGunBlast1,
    eEvtGunBlast2,
    eEvtExplosion,
    // ...
}

struct TimerEvent
{
    int delay;
    TimerEventType type;
};

#define MAX_EVENTS 100
TimerEvent events[MAX_EVENTS];
int event_count;

int last_event;
int time_elapsed;


And a couple of functions like this:
Code: ags

void OnEvent(TimerEventType event)
{
    if (event == eEvtGunBlast1)
    {
        // Do something
    }
    else if (event == eEvtGunBlast2)
    {
        // Do something else
    }
    // ...
}

void CheckEvents()
{
    if (last_event == event_count - 1) // Last event already happened
        return;
    
    if (time_elapsed >= events[last_event].delay) // Next event should happen
    {
        OnEvent(events[last_event].type);
        last_event++;
        time_elapsed = 0; // Reset timer
    }
    else
        time_elapsed++; // Update timer
}

void AddEvent(int delay, TimerEventType type)
{
    if (event_count == MAX_EVENTS) return; // Error here, increase the maximum
    events[event_count].delay = delay;
    events[event_count].type = type;
    event_count++;
}


At another place you would like to call CheckEvents in a rep_exec function and add events something like this:
Code: ags

void SetupEvents()
{
    AddEvent(30, eEvtGunBlast1);
    AddEvent(10, eEvtExplosion);
    AddEvent(120, eEvtGunBlast2);
    AddEvent(10, eEvtExplosion);
}


A bit long but if you have many complicated events it might work for you. Hope it helps :)
#44
General Discussion / Re: I give up
Thu 04/02/2016 01:39:39
CW, please know that the load that currently rests on your shoulders is not there for one person to carry. We all know this but because of circumstances it has been. You took on the job, pulled it forward and I'm so very glad you did because the minute the cart stops it becomes dead-weight. The minute a project stops making progress--the ever so tiniest bit of progress is enough--it becomes exceptionally hard to restart it. You have prevented this from happening in the beginning; you had some help along the way sure but you kept it going. I know how frustrating it can be if you can't seem to move as quickly or in the direction you want but just keeping moving it forward how slowly it seems is so very important and we all owe you big time for that.

Now I wish I could help you out; try to take some strain but I don't know how. I'm also pulling slow moving carts myself. :( But hey, you can take it even slower if you want see because it does not matter how fast you pull it as long as it keeps moving. Personally I take consolation from this thought because the load does not feel as heavy and still because there is movement it will get there at some point.

When CJ left the project he knew what he left; I'm sure his planning was filled with features that could only ever be implemented in a neat way with complete engine rewrites; without breaking compatibility a humongous task and also a bit depressing to see that much of a work load. For an outsider new to the code-base and also unknown to whatever vision the original author had this task is inconceivable. Yet you gave it a shot and got it to move again which is impressive. The fact that you spent time (I wouldn't say wasted) on features that did not work out as planned is normal; this is how you get the job done because if you theorize about things for months you will be left with well not very much. The fact that CJ got as far as he did is for the same reasons and I can only imagine he learned a lot form it in the process making him a better programmer.

I feel you and I respect you; here is something I've been willing to tell for a while:
As author of a project you have your own vision, something you wish it to be. Sure this can be influenced by other people but yet there is only one person that truly understands this vision and that is the author. Now when a project is passed on to the next generation this becomes a thing. Everyone wants the project to stay true to this vision yet no one really knows what it is so everyone presses his own version on. Filling the shoes of the previous author can feel like a burden; you never know if you're doing it right. Instead have your own vision, make it what you want it to be. Then it becomes more enjoyably and it feels like the sky is the limit. :)
#45
Beginners' Technical Questions / Re: eCDEject
Thu 04/02/2016 00:23:57
You are nearly there: eCDEject is actually a value you have to use with the CDAudio function. Something like this:
Code: ags
CDAudio(eCDEject, 0);


This kind of value is called an enumeration and is used throughout AGS and can be seen as a setting for function you are using. They all start with a lower case 'e'.

I hope this helps you with whatever sinister plot you are planning. ;) This is not going to affect me however; I don't have a CD-player in my computer.  :-D
#46
The Rumpus Room / Re: This Day In AGS History
Wed 23/12/2015 00:07:35
I did a forum search from around that time and not really that much happened. Discussions about the future of AGS, a couple of game releases and the usual; the Awards were still in the nomination stadium so I have no clue. Maybe a random spambot wave? 559 is A LOT more than the forums usually draw as far as I can tell. :)
#47
Hmm I see; well that is not really a problem then on windows systems. It might be a good idea to switch to int32_t at some point actually if it must be 32-bit; support is about there these days. I'll keep this in mind for my plugins in the future. :)
#48
This is how I've done it in the past:
Code: ags

#define RETURN_AGS_FLOAT(x) return *((int32 *) &(x))
#define AGS_FLOAT(x) (*((float *) &(x)))

// Somewhere else:
int32 AGSFastSin(int32 x)
{
    RETURN_ARGS_FLOAT(FastSin(AGS_FLOAT(x)));
}


There are however a few caveats. Note that int32 is defined in the plugin header as long; in AGS script all primitives are passed as longs. This assumes that a float takes up 32 bits on a 32-bit system; this will cause problems on 64-bit system probably so this is something to think about. It is hard to advise something here since it will depend on the target platform.
Btw, it might be a better idea to use static casts in de macros for C++, or not use macros at all ;).
#49
I didn't know you were growing a beard. Good for you! I mean the TV performance, ok and also the beard.
Very lame they the cut to nerd-glasses-push a few times (wrong) but hey you were on national television so kudos! ;-D Looks like you did a good job.
And yes, someone please make subtitles! I wish I could understand it. :P
#50
Ok, that was my fault: I forgot the semicolon after the struct closes. Whoops (roll).

Btw, static in C or C++ outside of a class means something else which is an interesting story but not very relevant, it will work without. I can tell you if you want to learn more about C/C++ but otherwise never mind that. :)
Now for AGS the static makes that you can call the function on struct itself instead of an instance so
Code: ags
Mystruct.Function1();
instead of
Code: ags
MyStruct foo;
foo.Function1();
which is exactly what we want.

The $AUTOCOMPLETESTATICONLY$ directive tells the autocompleter to hide the function when using an instance instead of the struct itself; that is just nice to do to prevent confusion. The $AUTOCOMPLETEIGNORE$ directive hides it completely which is what we want for our dummy. It will only hide it btw, it is still there. You can also use this to create undocumented functions etc.

Lines before functions starting with three slashes create autocompleter hints: these will be shown when you type the function names in the editor; really nice to create self documented plugins
#51
It's actually not that different from how you would do it in Modules so your guesses are right.
You would provide a plugin header something like this:
Code: ags

struct MyPlugin {
    /// Autocomplete text for Function 1
    import static void Function1();            // $AUTOCOMPLETESTATICONLY$
    /// Autocomplete text for Function 2
    import static int Function2(int a, int b); // $AUTOCOMPLETESTATICONLY$
    int dummy;                                 // $AUTOCOMPLETEIGNORE$
};


Then you would register them like this:
Code: C++

engine->RegisterScriptFunction("MyPlugin::Function1^0", (void *) Function1);
engine->RegisterScriptFunction("MyPlugin::Function2^2", (void *) Function2);


Oh and don't forget that dummy if your struct is otherwise empty or your are in for some hair pulling when the game keeps crashing. ;)

Hope that helps you. :)
#52
Well, looks like it's made it! Congrats theo and the rest of the crew! :-D
#53
The Rumpus Room / Re: The Points Game
Thu 15/10/2015 16:44:33
abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz
#54
The Rumpus Room / Re: The Points Game
Thu 15/10/2015 16:02:39
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
#55
The Rumpus Room / Re: The Points Game
Thu 15/10/2015 15:58:11
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
#56
The Rumpus Room / Re: The Points Game
Thu 15/10/2015 13:20:15
abcdefghijklmnopqrstuvwxyz
#57
The Rumpus Room / Re: The Points Game
Wed 14/10/2015 21:32:37
What you see is what you get, xyzzy.
#58
The Rumpus Room / Re: The Points Game
Mon 12/10/2015 00:38:04
Bananas
#59
The Rumpus Room / Re: The Points Game
Mon 05/10/2015 14:05:55
Yaaaay! ;-D
That took some serious pondering especially since you also took solution-messages into account which threw me off at first. I couldn't have done it without the helpful post by you guys; Batman saved the day. ;)

Now back to work! (nod)
#60
The Rumpus Room / Re: The Points Game
Mon 05/10/2015 12:36:25
Solution: The number of times the last character of the previous sentence occurs in the current one
SMF spam blocked by CleanTalk