Home Risen Risen2 Risen3 Forum English Russian

Registrieren Hilfe Kalender Heutige Beiträge
Seite 2 von 11 « Erste 1234569 ... Letzte »
Ergebnis 21 bis 40 von 217
  1. #21 Zitieren
    research Avatar von NicoDE
    Registriert seit
    Dec 2004
    Beiträge
    7.409
    Hint: Do not use the following methods:
    Code:
    void bCMatrix2::SetMatrix( GEFloat const [ bEElement_Count ] )
    void bCMatrix2::SetMatrix( GEFloat const [ bERow_Count ][ bEColumn_Count ] )
    and the constructors that use it:
    Code:
    bCMatrix2::bCMatrix2( GEFloat const [ bEElement_Count ] )
    bCMatrix2::bCMatrix2( GEFloat const [ bERow_Count ][ bEColumn_Count ] )
    It seems that they have been implemented like this:
    Code:
    g_MemCpy( this, a_pfElements, sizeof(a_pfElements) )
    But sizeof(a_pfElements) is 4 (array arguments are implicit const-pointers). Therefore only the first element is copied.

    Code:
    GEFloat const pfElements[ bCMatrix2::bEElement_Count ] = { 1.1f, 1.2f, 2.1f, 2.2f };
    bCMatrix2 matMatrix( pfElements );
    g_MessageBox( 0, bCString::GetFormattedString( "%1.1f; %1.1f; %1.1f; %1.1f",
        matMatrix.GetElement( bCMatrix2::bEElement_11 ),
        matMatrix.GetElement( bCMatrix2::bEElement_12 ),
        matMatrix.GetElement( bCMatrix2::bEElement_21 ),
        matMatrix.GetElement( bCMatrix2::bEElement_22 ) ),
        "bCMatrix2::SetMatrix( GEFloat const [ bEElement_Count ] )",
        0 );
    This will result in a message box with "1.1; -1.$; 0.0; 0.0".
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE ist offline Geändert von NicoDE (31.01.2011 um 14:35 Uhr)

  2. #22 Zitieren
    Drachentöter Avatar von KillaRiku
    Registriert seit
    Jun 2010
    Ort
    Ort
    Beiträge
    4.934
    Sorry when I'm asking. But is the SDK an inofficial Modkit?
    Because I can't speak english very well :L
    If yes, you made me very happy
    KillaRiku ist offline

  3. #23 Zitieren
    Abenteurer
    Registriert seit
    Aug 2009
    Ort
    NRW
    Beiträge
    81
    Not shure if I understood it correctly (who besides Nico does? ) but the SDK basiclly lets you use all the programing code the Risen developers wrote. This means you could use their code in you own c++ program. It is not something like a normal Editor where you can place items and edit what you see in Risen. There is nothing like this neither from the officals nor from anybody else.

    Übersetzung :
    Das SDK lässt dich auf allen von den Risen Entwicklern geschriebenen Code zugreifen, d.h. man kann ein eigenes Programm schreiben das diesen Code verwendet. Es ist keine normaler Editor ala Sandbox(Crysis) mit welchem man Objekte platzieren kann. Ein solches Programm gibt es weder von ofizieller noch von Modder Seite. Um das SDK sinnvoll benutzen zu können muss man mindestens programmieren können besser noch C++ beherrschen. Wenn du nach einem normalem Editor suchst kannst du dir mal meinen "Lrent Viewer" Thread angucken, mit diesem kann man einige Sachen in Risen verändern aber auch nur sehr wenige.
    Galrath434 ist offline

  4. #24 Zitieren
    research Avatar von NicoDE
    Registriert seit
    Dec 2004
    Beiträge
    7.409
    Zitat Zitat von KillaRiku Beitrag anzeigen
    But is the SDK an inofficial Modkit?
    Short answer: No.

    ---

    The Risen SDK is a (huge) reverse engineering project that allows you to use (currently some basic) classes of the Engine/Game in the context of a running instance of Risen. Developing a Script module is the current way to get your code loaded by the game. Implementing a custom console command is the current way to manually trigger your code. An example is included (%RisenSDK%\source\Scripts\Script_Library).

    Due to my limited spare time, I did not yet completed the classes that would be required to create/initialize your own instance of gCGameApp. I doubt that the SDK will result in user-friendly editing tools before the successor (Risen II) hits the market.
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE ist offline Geändert von NicoDE (14.02.2011 um 14:36 Uhr)

  5. #25 Zitieren
    research Avatar von NicoDE
    Registriert seit
    Dec 2004
    Beiträge
    7.409
    I added a Script Modification example that "overrides" an original function of the Script_Game.dll.

    Source: source/Scripts/Script_Mod_Fixes/
    Binary: [BUG] Fight against Aric quest bug
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE ist offline

  6. #26 Zitieren
    Ehrengarde Avatar von Baltram
    Registriert seit
    Jun 2006
    Beiträge
    2.264
    Thanks, this looks very interesting (and it's good & important to have some examples!)

    It seems like your 'AddScriptPatch' function could override existing script functions but also register completely new ones. Is that true? I think this could be very useful for realizing more complex quests in the future.

    And why has this variable to be static?
    Zitat Zitat von Script_Mod_Fixes.cpp
    Code:
    static gSScriptInit s_ScriptInit;
    Baltram ist offline

  7. #27 Zitieren
    research Avatar von NicoDE
    Registriert seit
    Dec 2004
    Beiträge
    7.409
    Adding script functions is possible since the release of the SDK. Console commands are script functions with a naming convention. The structure has to be static because the pointer is returned and the object must be valid while the Game is using it.
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE ist offline

  8. #28 Zitieren
    Ehrengarde Avatar von Baltram
    Registriert seit
    Jun 2006
    Beiträge
    2.264
    Zitat Zitat von NicoDE Beitrag anzeigen
    Adding script functions is possible since the release of the SDK.
    Yeah. But now it seems as if people (like me) could register their functions just by adding one line to the code you provided, no need to understand how gSScriptInit instances have to be used (although it didn't look too complicated in your console command example).

    ----------------------------------------------

    Something practical:

    Some days ago I had the idea to implement ladders (cause I like them) as interacts or (if that's too complicated) as NPCs without AI & animations. The player would "speak" to them, starting an info which engages a black screen and then teleports the player to an appropriate position above the ladder.

    I skipped through Functions.txt but only found 'EntityMoveTo' which is not used in any of the original infos (therefore I don't know about it's arguments/usage in infos).

    So I thought it could be an option to create a custom script function for moving entities around. Unfortunately I did't find any appropriate member function in eCEntity I could make use of...

    ...[lange Rede kurzer Sinn]:

    Do you know any possibility to move 'GELPVoid a_pSelfEntity' to a set of coordinates using the SDK?


    EDIT:
    Nevermind.
    I just stumbled upon the class named 'eCGeometryEntity', so I'm going to try to cast a_pSelfEntity to this type and then call 'SetLocalMatrix'.

    EDIT2:
    I added my own script function and I can call it out of infos without problems (for example for displaying messageboxes).

    But as soon as I write something like that:
    Code:
    eCEntity * entity = reinterpret_cast<eCEntity *>(a_pSelfEntity);
    entity->GetName();
    ...the program crashes.

    Do you know what I'm getting wrong?

    EDIT3:
    Maybe a_pSelfEntity is only a proxy?
    Code:
    eCGeometryEntity * player = reinterpret_cast<eCEntityProxy *>(a_pSelfEntity)->GetGeometryEntity(); // This makes the program crash.
    eCGeometryEntity * player2 = a_pSPU->GetSelfEntity(); // This works.
    I wonder whether a_pSPU->GetSelfEntity() returns always the entity that was specified in ' Self="xxx" ' in the info.

    EDIT4:
    Solved.
    (see below)
    Baltram ist offline Geändert von Baltram (20.03.2011 um 17:27 Uhr)

  9. #29 Zitieren
    Ranger
    Registriert seit
    Aug 2008
    Beiträge
    174
    Zitat Zitat von Baltram Beitrag anzeigen
    The player would "speak" to them, starting an info which engages a black screen and then teleports the player to an appropriate position above the ladder.
    Can't you just teleport the player using the command in the .xinf similar to the following:
    Code:
    	<Command
    		ClassName="gCInfoCommandTeleportNPC"
    		NPC="PC_Hero"
    		Target="Story_Monastery"
    	>
    	</Command>
    PowerGamer ist offline

  10. #30 Zitieren
    Ehrengarde Avatar von Baltram
    Registriert seit
    Jun 2006
    Beiträge
    2.264
    Zitat Zitat von PowerGamer Beitrag anzeigen
    Can't you just teleport the player using the command in the .xinf similar to the following:
    Code:
    	<Command
    		ClassName="gCInfoCommandTeleportNPC"
    		NPC="PC_Hero"
    		Target="Story_Monastery"
    	>
    	</Command>
    Oh... thank you!
    I must have missed that when looking for such script functions...

    Anyway, regarding the ladder thing, it would be more comfortable to have a script function that could teleport a NPC to any set of coordinates (relative to [0,0,0] or to another entity).

    I think I can materialize such a function by now. a_pSPU->getSelfEntity() does it's job well and eCGeometryEntity::SetLocalMatrix() will do the rest (I hope).

    And - I should have remarked this earlier - a_pSelfEntity and a_pOtherEntity seem to be always a NULL pointer. No surprise the game crashed...

    ----------------------------------

    Edit:

    -One can move instances of eCGeometryEntity
    -One can get eCGeometryEntity pointers via eCEntityProxy
    -One can create an instance of eCEntityProxy out of a bCPropertyID object
    -One can construct a bCPropertyID by a bCGuid
    -The GUID of any object is stored in a LRENT file

    I hope I did't get anything wrong so far...

    Doesn't this mean one can already create dynamic game events and trigger them out of infos?
    I mean things like placing/removing rocks that block entrances, (re)moving the ship in the harbour, replacing huts in the swamp camp by smoking ruins, etc.
    This would be so awesome...

    @NicoDE
    Your SDK is GREAT! I hadn't realised this before...
    Baltram ist offline Geändert von Baltram (20.03.2011 um 17:50 Uhr)

  11. #31 Zitieren
    research Avatar von NicoDE
    Registriert seit
    Dec 2004
    Beiträge
    7.409
    Zitat Zitat von Baltram Beitrag anzeigen
    Yeah. But now it seems as if people (like me) could register their functions just by adding one line to the code you provided, no need to understand how gSScriptInit instances have to be used (although it didn't look too complicated in your console command example).
    It was always a one-liner

    Yes, I did not properly document the script interface for the public (besides some postings on the Russian message board).
    But now you can read the "documentation" in the SDK: doc/ida/gCScriptAdmin-LoadScriptDLL.html

    The new trick/hack in AddScriptPatch is the way to cleanly reverse the registration of a function in the ScriptAdmin and to allow the re-assignment of the function pointer. One might have "solved" it by "properly" naming the Script module (to be the first module found) - but I hate such "solutions" (because the Windows Explorer can cause the result of the FindFirst API to be in reverse order...).

    Zitat Zitat von Baltram Beitrag anzeigen
    And - I should have remarked this earlier - a_pSelfEntity and a_pOtherEntity seem to be always a NULL pointer. No surprise the game crashed...
    Every script function (from Piranha Bytes) uses the same prolog to initialize/get Self and Other (even if they are not used at all).
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE ist offline Geändert von NicoDE (20.03.2011 um 22:07 Uhr)

  12. #32 Zitieren
    Ehrengarde Avatar von Baltram
    Registriert seit
    Jun 2006
    Beiträge
    2.264
    Zitat Zitat von NicoDE Beitrag anzeigen
    Every script function (from Piranha Bytes) uses the same prolog to initialize/get Self and Other (even if they are not used at all).
    But what's the sense in passing Self and Other (and often only NULL pointers) as arguments when they can be obtained via the script processing unit anyway?

    And what's the deal with the type 'Entity', is it the same as eCEntity or maybe eCEntityProxy?
    Baltram ist offline

  13. #33 Zitieren
    research Avatar von NicoDE
    Registriert seit
    Dec 2004
    Beiträge
    7.409
    Zitat Zitat von Baltram Beitrag anzeigen
    But what's the sense in passing Self and Other (and often only NULL pointers) as arguments when they can be obtained via the script processing unit anyway?
    Maybe if a script function calls a script function (without updating the SPU structure)?
    You should ask PB
    I’m far away from the point of understanding and/or restoring the whole script base.

    Zitat Zitat von Baltram Beitrag anzeigen
    And what's the deal with the type 'Entity', is it the same as eCEntity or maybe eCEntityProxy?
    The Script.dll contains wrapper classes for Engine/Game objects that can/should/could be accessed by script functions.
    Entity is one of them: source/Script/gs_entity.h.

    ps: If "scripters" would start working with it, this wrapper classes would be the next thing to do for the SDK...
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE ist offline Geändert von NicoDE (20.03.2011 um 22:36 Uhr)

  14. #34 Zitieren
    Ehrengarde Avatar von Baltram
    Registriert seit
    Jun 2006
    Beiträge
    2.264
    Zitat Zitat von NicoDE Beitrag anzeigen
    Entity is one of them: source/Script/gs_entity.h.
    Wow, I think there are quite a few VERY interesting methods introduced by this wrapper (as you probabely have remarked, I always tend to estimate parts of your SDK in terms of their usability concerning quest design ).

    Couldn't it be that, if there had been an impressive example for complex quests, the SDK would have got a lot more attention from the community?

    Might be that I'll try to create some (but not in the next few days).
    Baltram ist offline Geändert von NicoDE (21.03.2011 um 00:20 Uhr)

  15. #35 Zitieren
    research Avatar von NicoDE
    Registriert seit
    Dec 2004
    Beiträge
    7.409
    Zitat Zitat von Baltram Beitrag anzeigen
    Couldn't it be that, if there had been an impressive example for complex quests, the SDK would have got a lot more attention from the community?
    I think that the community is waiting for Risen 2

    I added the Script class World to give you more access to the Session/World/Player/Game.
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE ist offline Geändert von NicoDE (21.03.2011 um 00:43 Uhr)

  16. #36 Zitieren
    Ehrengarde Avatar von Baltram
    Registriert seit
    Jun 2006
    Beiträge
    2.264
    Zitat Zitat von NicoDE Beitrag anzeigen
    I think that most of the community is waiting for Risen 2
    I think that most of the community would be happy to have something to bridge the gap until the release (don't believe it's coming this year)
    Zitat Zitat von NicoDE Beitrag anzeigen
    I added the Script class World to give you more access to the Session/World/Player/Game.
    That's quite cool, could be used for some kind of cheating penalty or automated save game loading at difficult bossfights.
    Baltram ist offline

  17. #37 Zitieren
    Ranger
    Registriert seit
    Aug 2008
    Beiträge
    174
    Zitat Zitat von NicoDE Beitrag anzeigen
    ps: If "scripters" would start working with it, this wrapper classes would be the next thing to do for the SDK...
    Any chance you can start with wrappers for the PSSkills and gCSkills_PS classes as those would be required to implement a workaround for experience cut during level up bug (the one I described in my last PM, wonder if you ever got that PM)?
    PowerGamer ist offline

  18. #38 Zitieren
    research Avatar von NicoDE
    Registriert seit
    Dec 2004
    Beiträge
    7.409
    Zitat Zitat von PowerGamer Beitrag anzeigen
    wonder if you ever got that PM?
    I got the message, but I tend to wait with a reply until I have something to say

    Adding PropertySet support for the scripts will be a lot of work. My spare time is currently very limited, but I do it after adding/completing the Effect classes.
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE ist offline

  19. #39 Zitieren
    research Avatar von NicoDE
    Registriert seit
    Dec 2004
    Beiträge
    7.409
    Script wrappers Effect and EffectSystem are committed, have fun
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    struct SConArgs
    {
        enum EReason {
            EReason_Help,
            EReason_AutoComplete,
            EReason_Execute
        }                             m_enuReason;
        bTObjArray< bCUnicodeString > m_arrParams;
        bCUnicodeString               m_strResult;
    };
    
    GEInt GE_STDCALL CON_shockwave( gCScriptProcessingUnit *, GELPVoid, GELPVoid, GEInt a_iArgs )
    {
        if( SConArgs::EReason_Execute == reinterpret_cast< SConArgs * >( a_iArgs )->m_enuReason )
        {
            EffectSystem::StartEffect( "eff_titan_showckwave_01", world.GetPlayer() );
            return 1;
        }
        return 0;
    }
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE ist offline

  20. #40 Zitieren
    research Avatar von NicoDE
    Registriert seit
    Dec 2004
    Beiträge
    7.409
    Zitat Zitat von PowerGamer Beitrag anzeigen
    Any chance you can start with wrappers for the PSSkills and gCSkills_PS classes as those would be required to implement a workaround for experience cut during level up bug [...]?
    I added the missing classes to re-implement GiveXP.

    Due to missing operators/imports, the access to PSNpc and PSSkills is currently ugly.
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    Entity Player = Entity::GetPlayer();
    PSNpc & PlayerNpc = *reinterpret_cast< PSNpc * >( &Player );
    PSSkills & PlayerSkills = *reinterpret_cast< PSSkills * >( &Player );
    gui2.PrintGameLogF( gELogMessageType_Grey, "DisplayName: %s", Player.GetDisplayName() );
    gui2.PrintGameLogF( gELogMessageType_Gold, "CurrentMovementAni: %s", PlayerNpc.GetCurrentMovementAni() );
    gui2.PrintGameLogF( gELogMessageType_Lime, "Level: %d", PlayerSkills.GetLevel() );
    But it should be sufficient to get it working.

    Good luck.
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE ist offline Geändert von NicoDE (22.03.2011 um 14:22 Uhr)

Seite 2 von 11 « Erste 1234569 ... Letzte »

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •