Hint: Do not use the following methods:and the constructors that use it:Code:void bCMatrix2::SetMatrix( GEFloat const [ bEElement_Count ] ) void bCMatrix2::SetMatrix( GEFloat const [ bERow_Count ][ bEColumn_Count ] )It seems that they have been implemented like this:Code:bCMatrix2::bCMatrix2( GEFloat const [ bEElement_Count ] ) bCMatrix2::bCMatrix2( GEFloat const [ bERow_Count ][ bEColumn_Count ] )But sizeof(a_pfElements) is 4 (array arguments are implicit const-pointers). Therefore only the first element is copied.Code:g_MemCpy( this, a_pfElements, sizeof(a_pfElements) )
This will result in a message box with "1.1; -1.$; 0.0; 0.0".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 );
Ergebnis 21 bis 40 von 217
-
"Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- ConnorGeändert von NicoDE (31.01.2011 um 14:35 Uhr)
-
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
-
- 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.
-
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." -- ConnorGeändert von NicoDE (14.02.2011 um 14:36 Uhr)
-
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
-
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 von Script_Mod_Fixes.cpp
-
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
-
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();
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.
EDIT4:
Solved.
(see below)Geändert von Baltram (20.03.2011 um 17:27 Uhr)
-
- Registriert seit
- Aug 2008
- Beiträge
- 174
-
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...Geändert von Baltram (20.03.2011 um 17:50 Uhr)
-
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...).
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." -- ConnorGeändert von NicoDE (20.03.2011 um 22:07 Uhr)
-
-
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.
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." -- ConnorGeändert von NicoDE (20.03.2011 um 22:36 Uhr)
-
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).Geändert von NicoDE (21.03.2011 um 00:20 Uhr)
-
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." -- ConnorGeändert von NicoDE (21.03.2011 um 00:43 Uhr)
-
-
- Registriert seit
- Aug 2008
- Beiträge
- 174
-
"Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
-
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
-
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)But it should be sufficient to get it working.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() );
Good luck."Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- ConnorGeändert von NicoDE (22.03.2011 um 14:22 Uhr)