lfnetwork.com mark read register faq members calendar

Thread: Need some help with a script
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 06-27-2013, 06:02 PM   #1
duster
Rookie
 
duster's Avatar
 
Join Date: Sep 2012
Location: High in the sky...
Posts: 217
Current Game: Alice,Broforce and Quake 3
Need some help with a script

I've been working on an armband that will let me meditate and unmeditate whenever i use it.So far the player goes into the meditation position but also gets back to normal.Can someone tell me what i need to change in my script?

Code:
void main()
{
ActionPlayAnimation( ANIMATION_LOOPING_MEDITATE, 1.0, -1.0);
}
I also tryed a scipt from another mod as a template for this one but it didn't work out.
Show spoiler

Any help would be apreciated.


duster is offline   you may: quote & reply,
Old 06-27-2013, 08:25 PM   #2
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,465
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Quote:
Originally Posted by duster View Post
I've been working on an armband that will let me meditate and unmeditate whenever i use it.So far the player goes into the meditation position but also gets back to normal.Can someone tell me what i need to change in my script?

Code:
void main()
{
ActionPlayAnimation( ANIMATION_LOOPING_MEDITATE, 1.0, -1.0);
}
I also tryed a scipt from another mod as a template for this one but it didn't work out.
Show spoiler

Any help would be apreciated.
looping animation should not stop until you ClearAllEffects.

I am away from my office atm, but I would try compiling it with only the -1.0 duration and not including the 1.0, which as a parameter I cannot recall what it is.

This should be simple to fix. Look at my Sith Stalker script which appears early in my Script Shack thread.


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 06-27-2013, 10:13 PM   #3
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by Qui-Gon Glenn View Post
I am away from my office atm, but I would try compiling it with only the -1.0 duration and not including the 1.0, which as a parameter I cannot recall what it is.
1.0 just sets the speed the animation is played at.

If -1.0 is not working for the duration, just try setting it to something very long like 999999.0.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 06-28-2013, 06:08 AM   #4
duster
Rookie
 
duster's Avatar
 
Join Date: Sep 2012
Location: High in the sky...
Posts: 217
Current Game: Alice,Broforce and Quake 3
Thank you both for the reply!
Quote:
Originally Posted by Fallen Guardian View Post
If -1.0 is not working for the duration, just try setting it to something very long like 999999.0.
That did the trick!
Thank's alot dude!

Now all i need to know if it's possible by pressing the armband again the player can get back to normal position.

Quote:
Originally Posted by Qui-Gon Glenn View Post
This should be simple to fix. Look at my Sith Stalker script which appears early in my Script Shack thread.
Something like this?↓
Code:
DelayCommand(1.5, RemoveEffect(oSelf, eCurrent));



Last edited by duster; 06-28-2013 at 06:24 AM.
duster is offline   you may: quote & reply,
Old 06-28-2013, 11:06 AM   #5
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Since an animation is an action and is assigned as such, it'd probably be better to call ClearAllActions, but since I can't remember exactly I'll throw in ClearAllEffects as well.

Code:
void main()
{

DelayCommand(1.5, AssignCommand(GetFirstPC(), ClearAllActions()));
DelayCommand(1.5, AssignCommand(GetFirstPC(), ClearAllEffects()));
}
Of course you can adjust 1.5 to whatever delay you want and it might be prudent to change GetFirstPC to something that would call the object that last activated the armband, if you plan to have more than just the PC be able to meditate on whim.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 06-28-2013, 12:07 PM   #6
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 584
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by Fallen Guardian View Post
Since an animation is an action and is assigned as such, it'd probably be better to call ClearAllActions, but since I can't remember exactly I'll throw in ClearAllEffects as well.

Code:
void main()
{

DelayCommand(1.5, AssignCommand(GetFirstPC(), ClearAllActions()));
DelayCommand(1.5, AssignCommand(GetFirstPC(), ClearAllEffects()));
}
Of course you can adjust 1.5 to whatever delay you want and it might be prudent to change GetFirstPC to something that would call the object that last activated the armband, if you plan to have more than just the PC be able to meditate on whim.
I believe there's a function in k_inc_force.nss that's called "GetSpellTargetObject();"

The devs used it as the master target-selector for any and all lines in the vanilla spells.2da...


All of my mods are available on Deadlystream.

Always remember modders: "Quality= Effort*Time"

KSE 3.3.4 is LIVE!!! Check it out here.

Check out WalkSwitch, the Walkmesh-changing tool!
Fair Strides 2 is offline   you may: quote & reply,
Old 06-28-2013, 12:09 PM   #7
duster
Rookie
 
duster's Avatar
 
Join Date: Sep 2012
Location: High in the sky...
Posts: 217
Current Game: Alice,Broforce and Quake 3
Quote:
Originally Posted by Fallen Guardian View Post
Since an animation is an action and is assigned as such, it'd probably be better to call ClearAllActions, but since I can't remember exactly I'll throw in ClearAllEffects as well.

Code:
void main()
{

DelayCommand(1.5, AssignCommand(GetFirstPC(), ClearAllActions()));
DelayCommand(1.5, AssignCommand(GetFirstPC(), ClearAllEffects()));
}
Of course you can adjust 1.5 to whatever delay you want and it might be prudent to change GetFirstPC to something that would call the object that last activated the armband, if you plan to have more than just the PC be able to meditate on whim.
Surprisingly neither didn't make any difference.I compiled it into a script wich i also added into the rows of spells.2da and add it as another activate item property to the band.Were you refering on putting this script for another one that will "unmaditate" the player?


duster is offline   you may: quote & reply,
Old 06-28-2013, 12:51 PM   #8
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,465
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Quote:
Originally Posted by duster View Post
Surprisingly neither didn't make any difference.I compiled it into a script wich i also added into the rows of spells.2da and add it as another activate item property to the band.Were you refering on putting this script for another one that will "unmaditate" the player?
Yes the latter script is for "unmaditating" lol. I think FG is correct that ClearAllActions is all that is needed.


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 06-28-2013, 02:35 PM   #9
duster
Rookie
 
duster's Avatar
 
Join Date: Sep 2012
Location: High in the sky...
Posts: 217
Current Game: Alice,Broforce and Quake 3
Quote:
Originally Posted by Qui-Gon Glenn View Post
Yes the latter script is for "unmaditating" lol. I think FG is correct that ClearAllActions is all that is needed.
You missunderstood me.I wanted to know if Fallen Guardian ment that i should make another band with the other script(wich works perfectly).I wish to know if there is a way not to make it.Meaning to have one band do both actions just by being pressed a second time.



Last edited by duster; 06-28-2013 at 02:57 PM.
duster is offline   you may: quote & reply,
Old 06-28-2013, 03:16 PM   #10
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 584
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by duster View Post
You missunderstood me.I wanted to know if Fallen Guardian ment that i should make another band with the other script(wich works perfectly).I wish to know if there is a way not to make it.Meaning to have one band do both actions just by being pressed a second time.
Oh! In that case:


You'll need to make a global boolean(Pretty easy, but don;t have the time to explain it now) and check it each time the band is used. For example:
Code:
void main()
{
    if(GetGlobalBoolean("Armband_is_on") == 1)
    {
        <Deactivate meditating>
        SetGlobalBoolean("Armband_is_on", 0);
        return; // Makes it so we don't do the part below, otherwise you'd never leave
    }
    if(GetGlobalBoolean("Armband_is_on") == 0)
    {
       <Activate meditating>
       SetGlobalBoolean("Armband_is_on", 1);
    }
}


All of my mods are available on Deadlystream.

Always remember modders: "Quality= Effort*Time"

KSE 3.3.4 is LIVE!!! Check it out here.

Check out WalkSwitch, the Walkmesh-changing tool!
Fair Strides 2 is offline   you may: quote & reply,
Old 07-01-2013, 01:07 PM   #11
duster
Rookie
 
duster's Avatar
 
Join Date: Sep 2012
Location: High in the sky...
Posts: 217
Current Game: Alice,Broforce and Quake 3
Damn!First i wasn't able to go to the site and then my Windows broke down.Never the less everything is fixed now.
Quote:
Originally Posted by Fair Strides 2 View Post
Oh! In that case:


You'll need to make a global boolean(Pretty easy, but don;t have the time to explain it now) and check it each time the band is used. For example:
Code:
void main()
{
    if(GetGlobalBoolean("Armband_is_on") == 1)
    {
        <Deactivate meditating>
        SetGlobalBoolean("Armband_is_on", 0);
        return; // Makes it so we don't do the part below, otherwise you'd never leave
    }
    if(GetGlobalBoolean("Armband_is_on") == 0)
    {
       <Activate meditating>
       SetGlobalBoolean("Armband_is_on", 1);
    }
}
*sign*Unfortunetly it didn't change anything.Thank's for the help though.


duster is offline   you may: quote & reply,
Old 07-01-2013, 01:54 PM   #12
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
It might be better to set a delay command to make your guy stand back up on the same script you make him meditate, rather than using local or global booleans. I'm pretty sure the animation played when you use the armband would make you stop meditating anyway.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 07-01-2013, 02:59 PM   #13
duster
Rookie
 
duster's Avatar
 
Join Date: Sep 2012
Location: High in the sky...
Posts: 217
Current Game: Alice,Broforce and Quake 3
Quote:
Originally Posted by Fallen Guardian View Post
It might be better to set a delay command to make your guy stand back up on the same script you make him meditate, rather than using local or global booleans.
I guess that's best.
Quote:
Originally Posted by Fallen Guardian View Post
I'm pretty sure the animation played when you use the armband would make you stop meditating anyway.
Nah it just gets to meditation again. XD


Thank's alot guys!You helped me alot!


duster is offline   you may: quote & reply,
Old 07-01-2013, 03:42 PM   #14
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by duster View Post
Nah it just gets to meditation again. XD
I actually meant that if you used the booleans so the armband would switch between making you meditate and making you stop, using the armband to make you stop would probably make you stop because of the activate animation played by the armband being used, moreso then the actions called within the script.

Quote:
Originally Posted by duster View Post
Thank's alot guys!You helped me alot!
Glad we could help.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Need some help with a script

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:45 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.