Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The DLL Project
#39
I finally have enough class definitions so that I can work on other useful things if I need a change from this stupid copy and pasting (which is essential on the other hand)...

Not sure how long it used to take me to register a new SuperWeapon Type in assembly, anyway, now it's gonna take you 5 minutes.
You can add a custom SuperWeapon type using but two callback functions, one for parsing the Type name loaded from the INI, the other for parsing the value when the weapon is launched:

Code:
#define SWTYPE_TEST 99

int SWTypeParse(const char* pSWType)
{
    if(_strcmpi(pSWType,"Test")==0)
        return SWTYPE_TEST;
    else return -1;
}

bool SWLaunched(SuperClass* pThis,CellStruct* pMapCoords)
{
    SuperWeaponTypeClass* pType=pThis->get_Type();
    if(pType->get_Type()==SWTYPE_TEST)
    {
        CellClass* pCell=MapClass::GetCellAt(pMapCoords);

        CoordStruct Crd;
        pCell->GetCoords(&Crd);

        new AnimClass(AnimTypeClass::Find("ELECTRO"),Crd);

        return true;
    }
    return false;
}

This is a simple SuperWeapon that can be used using the type "Test" and it will play the ELECTRO anim where you fire it.
The two functions are callback functions, this is the way they can be "activated" in DLLMain or whatever you use:
Code:
SuperWeaponTypeClassCallback::Callback_ParseSWType = SWTypeParse;
SuperClassCallback::Callback_SuperWeaponLaunched = SWLaunched;

I won't explain it deeply now, if you know callback functions, you'll see how this works, if not, just let someone explain or wait for some documentation, hehe.
Work goes on now. x)
[Image: jsfml.png]
Reply


Messages In This Thread
The DLL Project - by pd - 26.12.2007, 20:37:16
RE: The DLL Project - by TheMan - 26.12.2007, 22:34:40
RE: The DLL Project - by pd - 26.12.2007, 22:53:56
RE: The DLL Project - by Marshall - 28.12.2007, 10:39:11
RE: The DLL Project - by Renegade - 27.12.2007, 21:37:39
RE: The DLL Project - by MCV - 28.12.2007, 20:47:59
RE: The DLL Project - by gordon-creAtive - 28.12.2007, 23:11:24
RE: The DLL Project - by pd - 29.12.2007, 21:48:17
RE: The DLL Project - by TheMan - 29.12.2007, 22:26:11
RE: The DLL Project - by Electro - 29.12.2007, 22:27:42
RE: The DLL Project - by Marshall - 29.12.2007, 22:57:40
RE: The DLL Project - by pd - 29.12.2007, 23:06:56
Rather offtopic but... - by gordon-creAtive - 29.12.2007, 23:38:39
RE: The DLL Project - by TX1138 - 30.12.2007, 00:54:11
RE: The DLL Project - by Guest - 30.12.2007, 02:29:35
RE: The DLL Project - by Blade - 30.12.2007, 18:25:46
RE: The DLL Project - by MCV - 30.12.2007, 19:10:44
RE: The DLL Project - by pd - 30.12.2007, 19:52:00
RE: The DLL Project - by gordon-creAtive - 31.12.2007, 15:26:51
RE: The DLL Project - by pd - 07.01.2008, 12:31:49
RE: The DLL Project - by Blade - 07.01.2008, 14:49:55
RE: The DLL Project - by gordon-creAtive - 07.01.2008, 17:27:50
RE: The DLL Project - by pd - 07.01.2008, 19:22:08
RE: The DLL Project - by gordon-creAtive - 07.01.2008, 20:21:46
RE: The DLL Project - by pd - 07.01.2008, 22:22:46
RE: The DLL Project - by Marshall - 07.01.2008, 22:40:33
RE: The DLL Project - by Bachsau - 10.01.2008, 23:54:22
RE: The DLL Project - by Guest - 11.01.2008, 10:59:41
RE: The DLL Project - by DCoder - 11.01.2008, 11:08:00
RE: The DLL Project - by pd - 16.01.2008, 16:03:16
RE: The DLL Project - by pd - 18.01.2008, 11:31:34
RE: The DLL Project - by MCV - 18.01.2008, 17:36:08
RE: The DLL Project - by DCoder - 18.01.2008, 20:12:09
RE: The DLL Project - by pd - 18.01.2008, 20:40:52
RE: The DLL Project - by DCoder - 19.01.2008, 10:00:31
RE: The DLL Project - by pd - 19.01.2008, 12:50:39
RE: The DLL Project - by pd - 11.02.2008, 02:58:43
RE: The DLL Project - by Marshall - 11.02.2008, 10:52:08
RE: The DLL Project - by pd - 12.02.2008, 11:32:14
RE: The DLL Project - by Black Shadow 750 - 12.02.2008, 11:48:08
RE: The DLL Project - by TheMan^ - 19.02.2008, 17:38:29
RE: The DLL Project - by gordon-creAtive - 20.02.2008, 18:47:22
RE: The DLL Project - by DCoder - 20.02.2008, 20:09:38
RE: The DLL Project - by Guest - 27.02.2008, 23:00:59
RE: The DLL Project - by gordon-creAtive - 28.02.2008, 20:29:45
RE: The DLL Project - by pd - 28.02.2008, 21:52:14
RE: The DLL Project - by Blade - 29.02.2008, 00:34:45
RE: The DLL Project - by pd - 29.02.2008, 00:41:54
RE: The DLL Project - by Bobingabout - 29.02.2008, 11:16:07
RE: The DLL Project - by Guest - 23.03.2008, 18:09:34
RE: The DLL Project - by pd - 06.04.2008, 12:52:28
RE: The DLL Project - by Marshall - 06.04.2008, 13:16:05
RE: The DLL Project - by gordon-creAtive - 06.04.2008, 14:45:59
RE: The DLL Project - by pd - 06.04.2008, 19:49:39
RE: The DLL Project - by DCoder - 06.04.2008, 21:04:14
RE: The DLL Project - by pd - 08.04.2008, 08:30:22
RE: The DLL Project - by pd - 10.04.2008, 22:46:34
RE: The DLL Project - by Marshall - 10.04.2008, 23:35:03
RE: The DLL Project - by Bobingabout - 11.04.2008, 10:09:57
RE: The DLL Project - by pd - 11.04.2008, 10:54:10
RE: The DLL Project - by Marshall - 11.04.2008, 18:49:35
RE: The DLL Project - by pd - 11.04.2008, 19:41:23
RE: The DLL Project - by pd - 28.04.2008, 14:00:02
RE: The DLL Project - by Guest - 18.05.2008, 20:56:51
RE: The DLL Project - by pd - 18.05.2008, 20:59:24
RE: The DLL Project - by Dupl3xxx - 20.05.2008, 16:37:47
RE: The DLL Project - by gordon-creAtive - 26.06.2008, 15:38:57
RE: The DLL Project - by pd - 27.06.2008, 00:18:57
RE: The DLL Project - by MRMIdAS - 27.06.2008, 04:20:48
RE: The DLL Project - by gordon-creAtive - 27.06.2008, 00:25:20
RE: The DLL Project - by gordon-creAtive - 27.06.2008, 09:34:04
RE: The DLL Project - by gravity20m - 06.02.2009, 00:55:51
RE: The DLL Project - by MRMIdAS - 06.02.2009, 01:32:25
RE: The DLL Project - by Guest - 06.02.2009, 13:22:36
RE: The DLL Project - by new guy - 30.06.2009, 02:47:31
RE: The DLL Project - by MRMIdAS - 30.06.2009, 03:49:53
RE: The DLL Project - by hogo - 01.07.2009, 12:07:21
RE: The DLL Project - by Nikademis Von Hisson - 27.08.2009, 12:49:14
RE: The DLL Project - by Lt Albrecht - 28.08.2009, 19:32:07



Users browsing this thread: 1 Guest(s)