Aller au contenu

Photo

New non-custom weapon equipped in Human Noble Intro


  • Veuillez vous connecter pour répondre
13 réponses à ce sujet

#1
Jsmith0730

Jsmith0730
  • Members
  • 346 messages
This actually might be better here than in general.

Like the topic says, I want my PC to begin the game with a standard Longbow in his primary weapon slot and a single dagger in the secondary. For now I've been toying with just the longbow but can't get it to work.

Following weriKK's blog on adding custom items to a characters inventory, I then changed the UT_AddItemToInventory line to EquipItem(oHero, UT_AddItemToInventory(R"gen_im_wep_rng_lbw_lbw.uti")); 

I also tried this by created a duplicate longbow and added it to the MyCustomContent folder but nothing happened. 
I keep getting an error on line 18: if ( WR_GetPlotFlag( PLT_MY_CUSTOM_PLOT, MY_ITEM_CHECK_FLAG ) == TRUE )
        return;

Also tried the second script listed on: http://social.biowar...cter_generation but removed all the EquipItems except for one and just changed the .uti to the longbow but still no dice. 

Any tips?
 

Modifié par Jsmith0730, 18 décembre 2009 - 06:01 .


#2
Lord Thing

Lord Thing
  • Members
  • 257 messages
have you made sure to move the exported scripts from /*module-name*/module/override/toolsetexport/ to /*module-name*/core/override/toolsetexport/?

The scripts won't run in the OC otherwise. (stuff in the module folder only runs if the addin is run from "Other Campaigns" as far as I can tell)

#3
Jsmith0730

Jsmith0730
  • Members
  • 346 messages
Yeah they're all there. Now I've gotten the script to compile without errors, but still no bow. Hmm.

I'm sure it's some ridiculously small oversight, too...

case EVENT_TYPE_MODULE_LOAD:        
{            
            object oPlayer = GetHero();
            EquipItem(oPlayer, UT_AddItemToInventory(R"gen_im_wep_rng_lbw_lbw.uti"));

even if I remove that object line and the EquipItem command it still doesn't even put anything into my inventory. o_O

Modifié par Jsmith0730, 18 décembre 2009 - 06:21 .


#4
Jsmith0730

Jsmith0730
  • Members
  • 346 messages
Well now this is just weird. I tried out another mod someone else made for me awhile ago that adds a new weapon into the game and that isn't showing up in my inventory either.



Did something change with 1.02?

#5
FictionalBreger

FictionalBreger
  • Members
  • 211 messages
No, it's just you can't get any items via scripts at the beginning of the game.
And if it doesn't work with characters that have progressed far, then you have to do a save, deactivate the mods you want to work, open your save (Force load, don't reactivate them), save again, and THEN activate the mods again, and you'll receive the items in question.

What I just wrote has to be done for all mods that add items via scripts only, for when you start a new character, the script is run before your character is truly created. Aka, in the Character Creator part, I think. That's what I've heard/interpreted it as. I could be wrong though.
I've been forced to do the Save/Deactivate/Load/Save/Reactivate routine every time to get custom items added by script to work.
There's probably a way to avoid this, but I don't know how.

#6
Jsmith0730

Jsmith0730
  • Members
  • 346 messages
Ah-ha, alright. Yes I'm trying to do this for a character at the beginning of the game.



So now it's off to look into the CharGen part. >.<!!

#7
FictionalBreger

FictionalBreger
  • Members
  • 211 messages
Well, now that I think of it, there was a mod on DA Nexus, Obsidians Nobler Noble. If you can open that one, or send a pm to him, you might get the info you're searching for.
If you do, well, share it with the community! :)

#8
Jsmith0730

Jsmith0730
  • Members
  • 346 messages
Yeah that's kinda where I got the idea to do this. I want to start with diff. weapons without all the other stuff added in.

#9
FictionalBreger

FictionalBreger
  • Members
  • 211 messages
I'm sure he would be kind enough to answer your questions. Or just rip up his scripts, and see what he did. There must be something in there.

#10
Jsmith0730

Jsmith0730
  • Members
  • 346 messages
So I extracted the .NSS & .NCS files from the .ERF but it says I can't view them? o_O

Modifié par Jsmith0730, 19 décembre 2009 - 03:00 .


#11
Jsmith0730

Jsmith0730
  • Members
  • 346 messages
Okay nix that idea. I kinda figured out a way to work around it, but have another little (but simpler) problem: I'm trying to change Alistair's weapons from sword/shield to a Greatsword.

CreateItemOnObject(R"gen_im_wep_mel_gsw_gsw.uti",GetObjectByTag("gen00fl_alistair"));

Now, do I need to delete the old items from his .utc? And is there a command like ohero I would use to make sure the weapon is equipped on him? 

Currently browsing the wiki ATM.

Modifié par Jsmith0730, 19 décembre 2009 - 06:02 .


#12
georage

georage
  • Members
  • 247 messages
Here's how it should work (untested)

Go to the core creature folder with NPCs in it and remove and add whatever inventory you want him to have.

That's it!

There is no GetAlistair function, but you can make one .... or just look for him using GetObjectByTag

Modifié par georage, 19 décembre 2009 - 06:37 .


#13
Jsmith0730

Jsmith0730
  • Members
  • 346 messages
Ahh okay, so there's no need to create a special script in the case of an NPC?

#14
Jsmith0730

Jsmith0730
  • Members
  • 346 messages
Hmm, well Alistair is still showing up with a sword & shield instead of a 2Her...



I changed his weapons in his inventory and I also created duplicates of Alistair & a greatsword for my custom content folder, just to be safe.