Author Topic: boot script  (Read 14026 times)

Offline Elessar Telrunya

  • Hero Member
  • *****
  • Posts: 2095
    • View Profile
boot script
« on: December 25, 2004, 10:15:13 PM »
can someone post a plain boot script?


-Lord Elessar

Offline CleTus

  • Full Member
  • ***
  • Posts: 234
    • View Profile
    • http://
boot script
« Reply #1 on: December 25, 2004, 10:26:58 PM »
This is simple and should do.. Place OnActivate

Code: [Select]
void main()
{
object oItem = GetItemActivated();

if(GetTag(oItem) == "TAG")
{
object oPC = GetItemActivatedTarget();
BootPC(oPC);
}
}

This way you can copy the if(GetTag(oItem) == "TAG") to add more items if you need.. Just add it under the } under boot, and define the variables again.
« Last Edit: December 25, 2004, 11:16:42 PM by Colonel Hughes »
GIT-R-DONE!

Light travels faster than sound. That is why some people appear bright until you hear them speak.

Offline Elessar Telrunya

  • Hero Member
  • *****
  • Posts: 2095
    • View Profile
boot script
« Reply #2 on: December 26, 2004, 07:43:56 AM »
Quote
This is simple and should do.. Place OnActivate

Code: [Select]
void main()
{
object oItem = GetItemActivated();

if(GetTag(oItem) == "TAG")
{
object oPC = GetItemActivatedTarget();
BootPC(oPC);
}
}

This way you can copy the if(GetTag(oItem) == "TAG") to add more items if you need.. Just add it under the } under boot, and define the variables again.
[snapback]13868[/snapback]

i would have requested it for an onactivate script if i wanted one.

i just need a very simple boot script that is activated by another script.


-Lord Elessar

Offline Elessar Telrunya

  • Hero Member
  • *****
  • Posts: 2095
    • View Profile
boot script
« Reply #3 on: December 26, 2004, 09:12:42 AM »
can someone give me a way to target something for a script in a conversation?


-Lord Elessar

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
boot script
« Reply #4 on: December 26, 2004, 10:13:10 AM »
Quote
can someone give me a way to target something for a script in a conversation?


-Lord Elessar
[snapback]13899[/snapback]
You mean the speaker, or a person that's the target of a item that makes the conv start? Something like a dm wand?

-Mel

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
boot script
« Reply #5 on: December 26, 2004, 12:58:24 PM »
may be anyone can help me with this problem:

In our ante mod I made an item called "Teleporter".
Once activated it starts a conversation where you can choose where you want to teleport yourself or the chosen target.
So far it works fine but there is one problem:
When two or more players activate the item at the same time it seems the teleport script doesn't know which player to teleport and so it happens that another player is teleported.
For example:
Someone activates the teleporter and a dialog window appears for him. I do the same. But while I'm still choosing where to go the other player already made his descission but instead of him I get teleported.
I don't know how to change that.
Is there a way to prevent that from happening?  :huh:
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline BzK

  • Hero Member
  • *****
  • Posts: 602
    • ICQ Messenger - 122117799
    • MSN Messenger - flatleymike@hotmail.com
    • AOL Instant Messenger - LoRdOfTeHDaNcE
    • Yahoo Instant Messenger - bzk04
    • View Profile
    • http://
    • Email
boot script
« Reply #6 on: December 26, 2004, 01:06:47 PM »
Daniel1975:
Sounds to me like you're both getting the same dialog, I don't know if that helps but I've seen it happen :P

And Mel, Elessar is looking to have a conversation pop up so he can choose a person to BAN or whatever (that's a little backwards, would be easier just to use an item on the person then choose what to do with them like DM wands :P)

P.S. What's with "BAN" getting caps when you type it in lowercase?
« Last Edit: December 26, 2004, 01:10:05 PM by BzK »

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
boot script
« Reply #7 on: December 26, 2004, 01:14:42 PM »
Quote
Daniel1975:
Sounds to me like you're both getting the same dialog, I don't know if that helps but I've seen it happen :P
[snapback]13916[/snapback]

hmmm so you mean that everyone who gets a teleporter and activates it must get his own dialog window?
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
boot script
« Reply #8 on: December 26, 2004, 01:57:11 PM »
Quote
Quote
Daniel1975:
Sounds to me like you're both getting the same dialog, I don't know if that helps but I've seen it happen :P
[snapback]13916[/snapback]

hmmm so you mean that everyone who gets a teleporter and activates it must get his own dialog window?
[snapback]13917[/snapback]
No, you're useing the same variables or whatever. How you get the target? You do it whit a localint on the module or area? Or you apply variables on the players themself? Or something else?

I use a weird way to get my targets whit my dmwand. But once the target is targetted the target may even leave, the ban will still apply because everything is stored in strings on the itemactivator.

Best way is to post a small piece of code where you think it goes wrong. Posting thinks of my dmwand is pointless because it's working whit a database and selfmade includes. Just will confuse.

-Mel

Offline Elessar Telrunya

  • Hero Member
  • *****
  • Posts: 2095
    • View Profile
boot script
« Reply #9 on: December 26, 2004, 07:48:31 PM »
Quote
Quote
can someone give me a way to target something for a script in a conversation?


-Lord Elessar
[snapback]13899[/snapback]
You mean the speaker, or a person that's the target of a item that makes the conv start? Something like a dm wand?

-Mel
[snapback]13900[/snapback]

yes bzk should know since i asked him to help me test earlier. I'm looking for a way so that when I click on the choice the conversation closes and a target button pops up like with spells and i click the person i wish to target.



-Lord Elessar

Offline CleTus

  • Full Member
  • ***
  • Posts: 234
    • View Profile
    • http://
boot script
« Reply #10 on: December 26, 2004, 08:20:09 PM »
Quote
Quote
This is simple and should do.. Place OnActivate

Code: [Select]
void main()
{
object oItem = GetItemActivated();

if(GetTag(oItem) == "TAG")
{
object oPC = GetItemActivatedTarget();
BootPC(oPC);
}
}

This way you can copy the if(GetTag(oItem) == "TAG") to add more items if you need.. Just add it under the } under boot, and define the variables again.
[snapback]13868[/snapback]

i would have requested it for an onactivate script if i wanted one.

i just need a very simple boot script that is activated by another script.


-Lord Elessar
[snapback]13897[/snapback]

Excuse me for not knowing exactly what you wanted when you said 'plain boot script'
GIT-R-DONE!

Light travels faster than sound. That is why some people appear bright until you hear them speak.

Offline Elessar Telrunya

  • Hero Member
  • *****
  • Posts: 2095
    • View Profile
boot script
« Reply #11 on: December 26, 2004, 09:03:27 PM »
dun matter i got what i need

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
boot script
« Reply #12 on: December 27, 2004, 12:40:21 AM »
Quote
Quote
Quote
can someone give me a way to target something for a script in a conversation?


-Lord Elessar
[snapback]13899[/snapback]
You mean the speaker, or a person that's the target of a item that makes the conv start? Something like a dm wand?

-Mel
[snapback]13900[/snapback]

yes bzk should know since i asked him to help me test earlier. I'm looking for a way so that when I click on the choice the conversation closes and a target button pops up like with spells and i click the person i wish to target.



-Lord Elessar
[snapback]13942[/snapback]
That's like making a selfmade spell (is possible). I think target and then chose is easyer.

I used a list of special ability's for that on the old arivs, to boot ect. Including a nice cast graphic and so. But they nerfed the special ability's (securty/anti-hack) whit patch 1.64 for pc's. So you'll have to do it in a other way. Not yet have a clear idea (6.43am for me, can't think :P)

-Mel

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
boot script
« Reply #13 on: December 27, 2004, 03:28:39 AM »
Daniel, just do what i did and give everyone an item that teleports them to certain areas (that way they don't have to keep coming back to the same area)...course i don't know if you are a PvP or an Adventure mod
Our greatest glory is not in never falling but in rising everytime we fall.

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
boot script
« Reply #14 on: December 27, 2004, 09:48:13 AM »
Quote
Daniel, just do what i did and give everyone an item that teleports them to certain areas (that way they don't have to keep coming back to the same area)...course i don't know if you are a PvP or an Adventure mod
[snapback]13965[/snapback]
As far I know he use that now, but want's the dialoge way.
Right?

-Mel

Offline Elessar Telrunya

  • Hero Member
  • *****
  • Posts: 2095
    • View Profile
boot script
« Reply #15 on: December 27, 2004, 01:46:15 PM »
ok... i think i have an idea on what im gonna do to do it, but it might be annoying to find the proper functions....



-Lord Elessar

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
boot script
« Reply #16 on: December 27, 2004, 01:59:20 PM »
Quote
ok... i think i have an idea on what im gonna do to do it, but it might be annoying to find the proper functions....



-Lord Elessar
[snapback]14001[/snapback]
I somethimes write a whole script for something where I could use 1 prebuild function for. Learning a lot of nwn function out of your head is useless anyway :P

If you don't know a function, but you think it may already be written. Just ask here.

-Mel

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
boot script
« Reply #17 on: December 27, 2004, 02:31:58 PM »
Quote
Quote
Daniel, just do what i did and give everyone an item that teleports them to certain areas (that way they don't have to keep coming back to the same area)...course i don't know if you are a PvP or an Adventure mod
[snapback]13965[/snapback]
As far I know he use that now, but want's the dialoge way.
Right?

-Mel
[snapback]13991[/snapback]

yes, I do. I don't want to use a single item for every area I want to teleport because then you get a flood of items in your inventory.
I just want a single teleport-item that starts the teleport-conversation with the one who activates it. The script for that item is used in "OnActivateItem" but it only starts the conversation. The teleport-scripts are connected to the conversation.
But this way it doesn't work always as it should...but I told you about the problem already.
I am not at home right now so I can post the teleport-script tomorrow when I am at home again.
I think the error happens because the script doesn't know exactly what player to teleport. There must be a way to make a difference between every player who is activating the teleport-conversation.
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
boot script
« Reply #18 on: December 27, 2004, 04:30:46 PM »
Quote
Quote
Quote
Daniel, just do what i did and give everyone an item that teleports them to certain areas (that way they don't have to keep coming back to the same area)...course i don't know if you are a PvP or an Adventure mod
[snapback]13965[/snapback]
As far I know he use that now, but want's the dialoge way.
Right?

-Mel
[snapback]13991[/snapback]

yes, I do. I don't want to use a single item for every area I want to teleport because then you get a flood of items in your inventory.
I just want a single teleport-item that starts the teleport-conversation with the one who activates it. The script for that item is used in "OnActivateItem" but it only starts the conversation. The teleport-scripts are connected to the conversation.
But this way it doesn't work always as it should...but I told you about the problem already.
I am not at home right now so I can post the teleport-script tomorrow when I am at home again.
I think the error happens because the script doesn't know exactly what player to teleport. There must be a way to make a difference between every player who is activating the teleport-conversation.
[snapback]14010[/snapback]
The thing that matter is the part where you get the target (can be the caller too).
The rest of the script is prolly fine.

-Mel

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
boot script
« Reply #19 on: December 28, 2004, 04:40:25 PM »
All special items in our mod are combined in one script "item_activate" that goes in "OnItemActivate" in module-events.
The part where the behaviour of the teleport item is declared goes like this:

  if (GetTag (oItem) == "Teleporter")
   {
    AssignCommand(oSpieler, ActionStartConversation (oSpieler, "use_teleporter", TRUE));
   }


This starts the conversation where you can choose where you want to teleport the target (the target can be yourself).
Every teleport-script goes like this:


void main()
{
 object oPC = GetItemActivatedTarget();
 object oTarget = GetWaypointByTag("WP_Arena_to_Gateway");
 location lTarget = GetLocation(oTarget);
 int iGender = GetGender(oPC);

 effect eVisual01 = EffectVisualEffect(VFX_IMP_MAGIC_PROTECTION);
 effect eVisual02 = EffectVisualEffect(VFX_DUR_GLOBE_INVULNERABILITY);

  ClearAllActions();
  if (iGender == GENDER_FEMALE)
   {
    PlaySound("vs_chant_necr_lf");
   }
  if (iGender == GENDER_MALE)
   {
    PlaySound("vs_chant_necr_lm");
   }
  ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual01, oPC);

  DelayCommand(1.8, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual02, oPC));
  DelayCommand(3.2, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
}



But when two players are using the teleporter at the same time it happens that one chooses his destination but the other player gets teleported instead of him.
There must be a way ... but I don't know that...  :(
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
boot script
« Reply #20 on: December 28, 2004, 05:03:02 PM »
If I'm right, GetItemActivatedTarget does get the last object that was targetted. Doesn't matters by what. I would get the target when you use the item. Right on that moment. And store the information on the player that is targetting. Then use that information to get the target back when the action is done. Use localstrings or something and a loop to get matches trough the pc's logged on.

-Mel

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
boot script
« Reply #21 on: December 28, 2004, 06:44:09 PM »
Quote
If I'm right, GetItemActivatedTarget does get the last object that was targetted. Doesn't matters by what. I would get the target when you use the item. Right on that moment. And store the information on the player that is targetting. Then use that information to get the target back when the action is done. Use localstrings or something and a loop to get matches trough the pc's logged on.

-Mel
[snapback]14082[/snapback]

hmmm...but wouldn't I need to give every caller another localstring? Or else the problem would be the same or not???
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline CleTus

  • Full Member
  • ***
  • Posts: 234
    • View Profile
    • http://
boot script
« Reply #22 on: December 31, 2004, 04:12:13 AM »
Quote
hmmm...but wouldn't I need to give every caller another localstring? Or else the problem would be the same or not???
[snapback]14102[/snapback]

I had the same problem.. This is what I use, and it works.. Put this on you OnActivate Script if you want to..

Code: [Select]
location lLocation=GetItemActivatedTargetLocation();
        object oOther = GetItemActivatedTarget();
         object oItemUser = GetItemActivator();
        SetLocalLocation(oItemUser,"location",lLocation);
        SetLocalObject(oItemUser,"object",oOther);

For your scripts.. Like teleport one.. Put this instead of GetItemActivatedTarget..

Code: [Select]
object oUser=GetPCSpeaker();
     object oPC = GetLocalObject(oUser,"object");

Apply effects to oPC.. You can change the names to go with your script if you want to use it..
« Last Edit: December 31, 2004, 04:14:13 AM by CleTus »
GIT-R-DONE!

Light travels faster than sound. That is why some people appear bright until you hear them speak.

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
boot script
« Reply #23 on: December 31, 2004, 05:07:01 AM »
Quote
Quote
hmmm...but wouldn't I need to give every caller another localstring? Or else the problem would be the same or not???
[snapback]14102[/snapback]

I had the same problem.. This is what I use, and it works.. Put this on you OnActivate Script if you want to..

Code: [Select]
location lLocation=GetItemActivatedTargetLocation();
        object oOther = GetItemActivatedTarget();
         object oItemUser = GetItemActivator();
        SetLocalLocation(oItemUser,"location",lLocation);
        SetLocalObject(oItemUser,"object",oOther);

For your scripts.. Like teleport one.. Put this instead of GetItemActivatedTarget..

Code: [Select]
object oUser=GetPCSpeaker();
     object oPC = GetLocalObject(oUser,"object");

Apply effects to oPC.. You can change the names to go with your script if you want to use it..
[snapback]14384[/snapback]
I use a other way. But this looks very fine and easy to add in the scripts you have gwydion. I would use it  :)

My way is to store use that localint part only in the scripts that need it. Other words, the onactivteitem event is justthe origenal for me. And I use it in a bit different way because I want a ban to work even if the target left the game. But you don't need that anyway.

-Mel

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
boot script
« Reply #24 on: December 31, 2004, 10:19:26 AM »
Quote
Quote
Quote
hmmm...but wouldn't I need to give every caller another localstring? Or else the problem would be the same or not???
[snapback]14102[/snapback]

I had the same problem.. This is what I use, and it works.. Put this on you OnActivate Script if you want to..

Code: [Select]
location lLocation=GetItemActivatedTargetLocation();
        object oOther = GetItemActivatedTarget();
         object oItemUser = GetItemActivator();
        SetLocalLocation(oItemUser,"location",lLocation);
        SetLocalObject(oItemUser,"object",oOther);

For your scripts.. Like teleport one.. Put this instead of GetItemActivatedTarget..

Code: [Select]
object oUser=GetPCSpeaker();
     object oPC = GetLocalObject(oUser,"object");

Apply effects to oPC.. You can change the names to go with your script if you want to use it..
[snapback]14384[/snapback]
I use a other way. But this looks very fine and easy to add in the scripts you have gwydion. I would use it  :)

My way is to store use that localint part only in the scripts that need it. Other words, the onactivteitem event is justthe origenal for me. And I use it in a bit different way because I want a BAN to work even if the target left the game. But you don't need that anyway.

-Mel
[snapback]14397[/snapback]

thank you all for helping me!  :D

And yet another question:

Problem:

All items with special powers (like stunner etc.) seem to have a short range only so you have to be very close to the target to activate its power on a player. Is there a way to increase the range? (for example like the range of the spell "fireball" ?)
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
boot script
« Reply #25 on: December 31, 2004, 10:38:53 AM »
Quote
Quote
Quote
Quote
hmmm...but wouldn't I need to give every caller another localstring? Or else the problem would be the same or not???
[snapback]14102[/snapback]

I had the same problem.. This is what I use, and it works.. Put this on you OnActivate Script if you want to..

Code: [Select]
location lLocation=GetItemActivatedTargetLocation();
        object oOther = GetItemActivatedTarget();
         object oItemUser = GetItemActivator();
        SetLocalLocation(oItemUser,"location",lLocation);
        SetLocalObject(oItemUser,"object",oOther);

For your scripts.. Like teleport one.. Put this instead of GetItemActivatedTarget..

Code: [Select]
object oUser=GetPCSpeaker();
     object oPC = GetLocalObject(oUser,"object");

Apply effects to oPC.. You can change the names to go with your script if you want to use it..
[snapback]14384[/snapback]
I use a other way. But this looks very fine and easy to add in the scripts you have gwydion. I would use it  :)

My way is to store use that localint part only in the scripts that need it. Other words, the onactivteitem event is justthe origenal for me. And I use it in a bit different way because I want a BAN to work even if the target left the game. But you don't need that anyway.

-Mel
[snapback]14397[/snapback]

thank you all for helping me!  :D

And yet another question:

Problem:

All items with special powers (like stunner etc.) seem to have a short range only so you have to be very close to the target to activate its power on a player. Is there a way to increase the range? (for example like the range of the spell "fireball" ?)
[snapback]14415[/snapback]
Yes, you can do that whit
Property 15=castspell Subtype 513=activate item (long range)
You can edit those in the mod with leto or something. Other way is just importing a long range item from a hotu mod where you can select it from the list in the prperty menu of the item.

Or just import the attached one (version 1.29 or higher needed :P) and edit it to your needs. I zipped it to be able to attach it + it's smaller.

-Mel

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
boot script
« Reply #26 on: December 31, 2004, 11:56:30 AM »
THX!!! This is great!!!  :D
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians