Jump to content

Home

Some Scripting Questions to Make you cry.


Recommended Posts

Hey all!

 

Well first things first I am NOT expecting an answer to everyone of these questions that would just be stupid of me.. Now that thats out of the way I also know theres a script shack but I belive this might be a little long and might be more useful to modders here where it might be more organized. Now onto where the questions came from: You can blame Fair Strides 2 :lol: (Im kidding don't blame him) for suggesting I look at the nwlexicon. Well I looked at it and I got interested so I started checking out the nwscript.nss and it gave me these questions. Now theres alot but im going to start asking some of them now. :)

 

If im right this function will adjust the hit points of followers such as the ones mentioned in this thread right?

Show spoiler
(hidden content - requires Javascript to show)
// 590: adjusts a followers hit points, can specify the absolute value to set to

// SWMG_AdjustFollowerHitPoints

int SWMG_AdjustFollowerHitPoints(object oFollower, int nHP, int nAbsolute=0

 

Same thread as linked above, this could set the followers hit points right?

Show spoiler
(hidden content - requires Javascript to show)
// 604: SWMG_SetFollowerHitPoints

void SWMG_SetFollowerHitPoints(object oFollower, int nHP);

Same thread as linked above this function should check if you have one of thoose followers by tag right?

Show spoiler
(hidden content - requires Javascript to show)
// 599: a bunch of Is functions for your pleasure

// SWMG_IsFollower

int SWMG_IsFollower(object oid=OBJECT_SELF);

 

You could use this script to check if you were playing as HK-47 and such right?

Show spoiler
(hidden content - requires Javascript to show)
// 600: SWMG_IsPlayer

int SWMG_IsPlayer(object oid=OBJECT_SELF);

 

Could you use this script to do something such as: if there are less than 5 enimes left.. do XX (I know it would have to modified quite a bit)

Show spoiler
(hidden content - requires Javascript to show)
// 612: SWMG_GetEnemyCount

int SWMG_GetEnemyCount();

 

This would make the player unkillable correct?

Show spoiler
(hidden content - requires Javascript to show)
// 648: SWMG_SetPlayerInvincibility

void SWMG_SetPlayerInvincibility(float fInvincibility);

 

This would check if the player is invincible right? (I know you would have to add return true return false ect...)

Show spoiler
(hidden content - requires Javascript to show)
// 642: SWMG_GetPlayerInvincibility

 

Easy one :) This should COMPLETLY clear the journal right?

[HIDDEN]// 672: DeleteJournalWorldAllEntries

// Nuke's 'em all, user entered or otherwise.

void DeleteJournalWorldAllEntries();

 

And this should only delete one entry? (Could this be modified to delete most recent entry?)

Show spoiler
(hidden content - requires Javascript to show)
// 674: DeleteJournalWorldEntryStrref

// Deletes the world notice pertaining to the string ref

void DeleteJournalWorldEntryStrref( int strref );

 

Will this work on non-force users too? and if soo where would I attatch it?

Show spoiler
(hidden content - requires Javascript to show)
// 676: EffectTemporaryForcePoints

//

effect EffectPsychicStatic();

 

Is it really possible to add pics along with journal entries?

Show spoiler
(hidden content - requires Javascript to show)
// 678: SetJournalQuestEntryPicture

// Sets the picture for the quest entry on this object (creature)

void SetJournalQuestEntryPicture(string szPlotID, object oObject, int nPictureIndex, int bAllPartyMemebers=TRUE, int bAllPlayers=FALSE);

 

This is how the make Bastilla unselectable on Korriban right?

Show spoiler
(hidden content - requires Javascript to show)

// 708: SetNPCSelectability

void SetNPCSelectability(int nNPC, int nSelectability);

 

What even is this?

Show spoiler
(hidden content - requires Javascript to show)
// 735: Get the Category of tTalent.

int GetCategoryFromTalent(talent tTalent);

 

You could use this to force solo mode within a conversation correct? or to force them out of solo mode?

Show spoiler
(hidden content - requires Javascript to show)
// 753: SetSoloMode

// Activates/Deactivates solo mode for the player's party.

void SetSoloMode( int bActivate )

 

This should force fake combat during dialog correct?

Show spoiler
(hidden content - requires Javascript to show)
//RWT-OEI 01/16/04

// 791: A function to put the character into a true combat state but the reason set to

// not real combat. This should help us control animations in cutscenes with a bit

// more precision. -- Not totally sure this is doing anything just yet. Seems

// the combat condition gets cleared shortly after anyway.

// If nEnable is 1, it enables fake combat mode. If 0, it disables it.

// WARNING: Whenever using this function to enable fake combat mode, you should

// have a matching call to it to disable it. (pass 0 for nEnable).

void SetFakeCombatState( object oObject, int nEnable );

 

You could modify this to make you jump SUPER high while racing correct?

Show spoiler
(hidden content - requires Javascript to show)
// FAK - OEI 2/11/04

// 804: SWMG_SetJumpSpeed -- the sets the 'jump speed' for the swoop

// bike races. Gravity will act upon this velocity.

void SWMG_SetJumpSpeed(float fSpeed);

 

You could put this on a trigger and it should stop them from proceeding untill stealthed or unstealthed correct? (you would have to add the stop part?)

Show spoiler
(hidden content - requires Javascript to show)
// 810

// DJS-OEI 3/8/2004

// Determines if the given creature is in Stealth mode or not.

// 0 = Creature is not stealthed.

// 1 = Creature is stealthed.

// This function will return 0 for any non-creature.

int IsStealthed( object oCreature );

 

You could use this to make it so like X placeable will heal you every X seconds?(Would need to be modified)

Show spoiler
(hidden content - requires Javascript to show)
// 813

// RWT-OEI 03/19/04

// Stores a Heal Target for the Healer AI script. Should probably

// not be used outside of the Healer AI script.

void SetHealTarget( object oidHealer, object oidTarget );

 

I know in stoffe's tutorial it says not possible for first PC but wouldent something like this work? (With a puppet recruit script of course)

Show spoiler
(hidden content - requires Javascript to show)
// 836

// RWT-OEI 07/17/04

// This function adds a Puppet to the Puppet Table by

// template.

// Returns 1 if successful, 0 if there was an error

// This does not spawn the puppet or anything. It just

// adds it to the party table and makes it available for

// use down the line. Exactly like AddAvailableNPCByTemplate

int AddAvailablePUPByTemplate( int nPUP, string sTemplate );

 

You could then use this script to add that^ puppet to the first PC right?

Show spoiler
(hidden content - requires Javascript to show)
// 840

// RWT-OEI 07/18/04

// This adds an existing puppet object to the party. The

// puppet object must already exist via SpawnAvailablePUP

// and must already be available via AddAvailablePUP*

// functions.

int AddPartyPuppet(int nPUP, object oidCreature)

 

Well thats all for now again I do NOT expect an answer to all of these I also understand some of these may be leftover scripts that do nothing. :)

 

Thanks-Supreme Kotor

Link to comment
Share on other sites

The first six, with the prefix SWMG, relate specifically to "Star Wars Mini Games" I think, ie swoop racing, so unless you want them for that purpose I don't think they'll work. However I have never used them so don't hold me to it.

 

The delete all journal entries one should work, but again I haven't tried it.

 

The delete a specific entry looks for a string reference in the tlk file, so I don't think it would work with the newest entry without a lot of hacking, if possible at all. To do this simply advance the quest and set the end value to true, so it will go in completed quests.

 

Setnpcselectability you have correct.

 

I expect the one after that is left over from neverwinter, as I've never seen it used in game.

 

SetSoloMode and SetFakeCombatState should work, but I can't say I've ever seen them used before.

 

Not sure about SetJumpSpeed but I would reckon it will change the speed (and therefore the distance) you can jump rather than the height.

 

ISStealthed will return true or false, you would have to add this to a conditional script and separately tell the game what you want to happen in each case.

 

Not sure how you would set it to happen every x seconds as I dont think there's a yield function in the api, correct me if I'm wrong, but if you can work that out then yes sethealtarget should work.

 

If stoffe says it wont work it wont work :D Seriously though there's no reason why it shouldn't work but kotor tends not to agree on these things. If at some point you need to define which npc it follows try using -1 as this is the pc in most other cases.

 

Hope I was of some help.

Link to comment
Share on other sites

If stoffe says it wont work it wont work :D Seriously though there's no reason why it shouldn't work but kotor tends not to agree on these things. If at some point you need to define which npc it follows try using -1 as this is the pc in most other cases.

 

Hope I was of some help.

 

You definitly were help thanks :D. but the puppet thing is definitly my biggest question im not doubting Stoffe but the way he added puppets in his tutorial was also diffrent then thoose two scripts. :) I will try to test out getting a puppet for the first pc as soon as I can.

 

Thanks-Supreme Kotor

Link to comment
Share on other sites

You definitly were help thanks :D. but the puppet thing is definitly my biggest question im not doubting Stoffe but the way he added puppets in his tutorial was also diffrent then thoose two scripts. :) I will try to test out getting a puppet for the first pc as soon as I can.

 

Thanks-Supreme Kotor

 

So, how'd you like the lexicon? :nut: + :comp9: = :ugh:

 

I myself, if you checked my custom functions tut, have used a SWMG function to get a target's name, so they can be used outside of games, but one must question should they be.

 

The sixth one: the argument is a float(i.e: 10.0f), so I would assume that it makes the player invincible for that many seconds...

 

If you want indefinite invincibility, I'd use the SetMinOneHP function...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...