Hello back everyone ,i'm still here with a problem .
I have working dazips and all is fine .EXCEPT :
I was wondering if anyone could help me make the items I make appear on newly made characters?
My items just spawn in the inventory of already existing characters .
So when i start a new game ,i just have nothing in it .There is an odd method who say that you have to deactivate your module ,start a new game,save ,activate your module and then go back to your saved game ,and then it works .yeah ,but it's creepy to do this everytime .
So someone spoke about getting this in a script :
"I've used EVENT_TYPE_CHARGEN_END (in addition to EVENT_TYPE_MODULE_LOAD, so that the script occurs both when character generation ends and when the game is loaded) and it's worked well for me."
Where do i type this EVENT_TYPE_CHARGEN_END ?
Here is my script :
#include "utility_h"#include "plt_my_custom_plot"#include "events_h"
void main(){ // If our plot flag is set to TRUE, that means we have already // given the items to the player, there is no need to continue // running this script. if ( WR_GetPlotFlag( PLT_MY_CUSTOM_PLOT, MY_ITEM_CHECK_FLAG ) == TRUE ) return;
event ev = GetCurrentEvent(); int nEventType = GetEventType(ev);
// We will watch for every event type and if the one we need // appears we will handle it as a special case. We will ignore the rest // of the events switch ( nEventType ) { // This event happenes every time the module loads // This usually happenes when creating a new game // or loading a savegame case EVENT_TYPE_CHARGEN_END: case EVENT_TYPE_MODULE_LOAD: {
// The UT_AddItemToInventory function adds various resources to a // creature's inventory. Here we add one weapon and one shield. UT_AddItemToInventory(R"my_custom_sword.uti", 1); UT_AddItemToInventory(R"my-custom-great-sword.uti", 1); UT_AddItemToInventory(R"my_custom_waraxe.uti", 1); UT_AddItemToInventory(R"my_custom_dagger.uti", 1); UT_AddItemToInventory(R"my_custom_armor.uti", 1); UT_AddItemToInventory(R"my_custom_gloves.uti", 1); UT_AddItemToInventory(R"my_custom_boots.uti", 1); UT_AddItemToInventory(R"my_custom_sword.uti", 1); UT_AddItemToInventory(R"my_custom_helm.uti", 1); UT_AddItemToInventory(R"my_custom_ring.uti", 1); UT_AddItemToInventory(R"my_custom_shield.uti", 1);
// Set our plot flag to TRUE, so the next time this script tries // to run it will not add extra items to the player's inventory WR_SetPlotFlag( PLT_MY_CUSTOM_PLOT, MY_ITEM_CHECK_FLAG, TRUE );
// We have dealt with the event we were waiting for. // At this point we can stop looking for other events break; } default: break; }}
You will notice i already have putted in EVENT_TYPE_CHARGEN_END ,but i does nothing .
In addition i putted include events h ,because a saw a script with this and the event type chargen end included ,thought maybe it was connected or what ..
SOOooooo any ideas ?
Thanks in advance !!!
Making items spawn to new game character's inventory
Débuté par
folglaive
, juin 09 2010 04:21
#1
Posté 09 juin 2010 - 04:21
#2
Posté 09 juin 2010 - 06:40
all the days someone opens a thread that was discussed in the past.
the scripts that were released in the early tutorials are "bugged" and won't fire due to character creation and the not available inventory. you have to fire the script through prcscr. details can be found at the wiki.
the scripts that were released in the early tutorials are "bugged" and won't fire due to character creation and the not available inventory. you have to fire the script through prcscr. details can be found at the wiki.





Retour en haut






