Author Topic: 420's Duel Management System  (Read 11370 times)

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
420's Duel Management System
« on: October 06, 2004, 09:27:39 PM »
OK, it's complicated and probably has all sorts of problems, but here is the duel management system I use, altered for anyone to include in their mod.

First, you must have "tag based scripts" enabled.  If your mod was created after HotU then this should be enabled by default. If your mod is older then make sure you put the script "x2_mod_def_load" into the OnModuleLoad event trigger in the module properties.

All of the following scripts have been packed into one .erf file and can be imported into a NWN module:

onmodentduel - Include the lines of this code into your moduels OnClientEnter event trigger.
NOTE: see "OPTIONS" in the script for info on how to give people your duel managing item automatically when they join the server.

exitmod - This script goes in your modules OnClientLeave event trigger

endduel - This script must be named "endduel", doesn't need to be attached to an event

duelitem - This script must have the same name as the tag of the item used to manage duels. (Item must have a Unique Power or Activate Item property to work)
NOTE: See "OPTIONS" in the script to add dueling arenas to the list, the duel managing system will not work unless you enter at least 1 area into the list

exitarea - Put this script in the OnExit event trigger of any areas where dueling is allowed. (The duel will end if one of the duelers leaves the area)

ondeath - Replace the OnDeath module event trigger with this script because Bioware sucks. (also it's needed for the duel managing system)
NOTE: See the "NOTE" for duelitem, you must enter all areas where dueling is allowed.


Good luck,
420
« Last Edit: October 07, 2004, 12:41:14 PM by 420 »

Offline Summit

  • Newbie
  • *
  • Posts: 24
    • MSN Messenger - Slickmeade@hotmail.com
    • Yahoo Instant Messenger - Slickmeade@yahoo.com
    • View Profile
    • http://www.summit.nwnkodclan.com
    • Email
420's Duel Management System
« Reply #1 on: October 06, 2004, 10:53:31 PM »
Ok, but where is the erf package?

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
420's Duel Management System
« Reply #2 on: October 07, 2004, 12:52:45 AM »
Quote
Ok, but where is the erf package?
[snapback]8345[/snapback]

DAMMIT! It says I attach it then it doesn't show up!!

Xen, fix it!!!!

-420

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
420's Duel Management System
« Reply #3 on: October 07, 2004, 07:12:19 AM »
would there be a way to script it to work in only certain areas
*has a OnRespawn script that's SUPPOSE to transport you to a temple*
Our greatest glory is not in never falling but in rising everytime we fall.

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
420's Duel Management System
« Reply #4 on: October 07, 2004, 12:43:57 PM »
Quote
would there be a way to script it to work in only certain areas
*has a OnRespawn script that's SUPPOSE to transport you to a temple*
[snapback]8359[/snapback]

OK, I posted the file as a .zip (thanks for the tip Khadgar).

Yes, the duel manager only works in the areas that you specify in the "duelitem" and "ondeath" scripts. You'll probably want to alter your "OnRespawn" script so that players don't go to the temple if they died in an arena.

EDIT: Correction, if you add the area tags to the OnDeath script your shouldn't have to alter the OnRespawn, my bad. The OnDeath script makes it so that you auto resurrect 1 round (6 seconds) after you die in an arena area, so the OnRespawn never fires.

-420
« Last Edit: October 07, 2004, 01:15:08 PM by 420 »

Offline Summit

  • Newbie
  • *
  • Posts: 24
    • MSN Messenger - Slickmeade@hotmail.com
    • Yahoo Instant Messenger - Slickmeade@yahoo.com
    • View Profile
    • http://www.summit.nwnkodclan.com
    • Email
420's Duel Management System
« Reply #5 on: October 07, 2004, 12:53:41 PM »
Thank's Mate for the Script and the Help, I really appreciate it. Say, if you ever play Lineage II, Stop by, my ini file is in Lineage Thread. :D

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
420's Duel Management System
« Reply #6 on: October 07, 2004, 11:36:30 PM »
um...how would you combine the two scripts?
Our greatest glory is not in never falling but in rising everytime we fall.

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
420's Duel Management System
« Reply #7 on: October 09, 2004, 02:08:47 PM »
Quote
um...how would you combine the two scripts?
[snapback]8471[/snapback]

Hmm try this, I just pasted your code to the end and changed all the "oPC" to "oTarget".

-420

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
420's Duel Management System
« Reply #8 on: October 09, 2004, 05:41:20 PM »
here's the scripts that are currently in either the Module or Area:
Our greatest glory is not in never falling but in rising everytime we fall.

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
420's Duel Management System
« Reply #9 on: October 10, 2004, 01:45:34 PM »
Quote
here's the scripts that are currently in either the Module or Area:
[snapback]8598[/snapback]

Alright I combined the OnClientEnter script and the OnAreaExit scripts with the Duel Management System scripts.

I also included a 420s Notes.txt file with some details.

You will still need to import the other Duel Management System erf from the original post into your mod.

-420
« Last Edit: October 10, 2004, 11:28:03 PM by 420 »

Offline Pang

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
420's Duel Management System
« Reply #10 on: November 06, 2004, 01:13:35 PM »
Uhm is it me or are all those dowload files broken?
If you don't wanne have a nice site go to Forum

Did you know, that when it snows, my eyes become light and the light that you shine can't be seen.

Look at my eyes meeeeeeeeeeen (He miro :D)

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
420's Duel Management System
« Reply #11 on: November 06, 2004, 01:29:50 PM »
Quote
Uhm is it me or are all those dowload files broken?
[snapback]9506[/snapback]

All files uploaded to LM before it went down are no longer available.

I'll repost these files soon.

-420

Offline Pazuul

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://
420's Duel Management System
« Reply #12 on: November 27, 2004, 05:51:49 PM »
could somewone make a duell manager script that also works on basic nwn and not only on hotu?

cuz on normal nwn the toosel almost doesn't recognize any of the code...
Pazuul - Leader of Minions

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
420's Duel Management System
« Reply #13 on: November 27, 2004, 05:57:32 PM »
Quote
could somewone make a duell manager script that also works on basic nwn and not only on hotu?

cuz on normal nwn the toosel almost doesn't recognize any of the code...
[snapback]11567[/snapback]
Eeh? 420's duel manager works fine on a non hotu / non sou mod. It isn't 'the' perfect duel manager but it's very nice and works.

-Mel

Offline Pazuul

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://
420's Duel Management System
« Reply #14 on: November 27, 2004, 06:18:30 PM »
i get an error at abouth evry line using this script...
and it worked fine on my other pc with hotu
Pazuul - Leader of Minions

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
420's Duel Management System
« Reply #15 on: November 27, 2004, 06:23:49 PM »
Quote
i get an error at abouth evry line using this script...
and it worked fine on my other pc with hotu
[snapback]11573[/snapback]
Now I saw this script running on a server whitout hotu/sou. Maybe it's the version of the toolset you use. Is it 1.62/1.64 or something like 1.29? But still I don't think it won't run.

-Mel
« Last Edit: November 27, 2004, 06:24:38 PM by Tea-cup »

Offline Pazuul

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://
420's Duel Management System
« Reply #16 on: November 27, 2004, 06:24:55 PM »
Quote
Quote
i get an error at abouth evry line using this script...
and it worked fine on my other pc with hotu
[snapback]11573[/snapback]
Now I saw this script running on a server whitout hotu/sou. Maybe it's the version of the toolset you use. Is it 1.62/1.64 or something like 1.29? But still I don't think it won't run.

-Mel
[snapback]11575[/snapback]

lol thx for telling me that...
lets update nwn...

edit: lolz v.1.11!!
« Last Edit: November 27, 2004, 06:26:10 PM by Pazuul »
Pazuul - Leader of Minions

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
420's Duel Management System
« Reply #17 on: November 27, 2004, 06:30:25 PM »
Quote
Quote
Quote
i get an error at abouth evry line using this script...
and it worked fine on my other pc with hotu
[snapback]11573[/snapback]
Now I saw this script running on a server whitout hotu/sou. Maybe it's the version of the toolset you use. Is it 1.62/1.64 or something like 1.29? But still I don't think it won't run.

-Mel
[snapback]11575[/snapback]

lol thx for telling me that...
lets update nwn...

edit: lolz v.1.11!!
[snapback]11576[/snapback]
If it works afther a update, give me a sign. I like to know if that fix it.

-Mel

Offline Pazuul

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://
420's Duel Management System
« Reply #18 on: November 27, 2004, 07:07:58 PM »
i'll let ya know someting, i'm fully remaking my module now
Pazuul - Leader of Minions

Offline Pazuul

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://
420's Duel Management System
« Reply #19 on: November 27, 2004, 08:08:22 PM »
ok it works now thx a lot mel!!

next problem :P  :

the script name is manager and the duell manager system works.

but i also have a boot and kill item for admins that has to be in the onactivateitem part.

but the kill and boot items both act like the duel manager now...

this is the script:




void bootkill()
{
object oCaller = GetItemActivator();
object oTarget = GetItemActivatedTarget();
object oItem = GetItemActivated();
string sTag = GetTag(oItem);

if (sTag == "bootcodem1")//YOU CAN CHANCE THIS TAGG OF A ANOTER.
{

DelayCommand(0.5,BootPC(oTarget));

}
if (sTag == "killcodem1")//YOU CAN CHANCE THIS TAGG OF A ANOTER.
{

effect eDeath= EffectDeath(TRUE);

DelayCommand(0.5,ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget));

}

}

void main()

duel manager script...
Pazuul - Leader of Minions

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
420's Duel Management System
« Reply #20 on: November 28, 2004, 09:23:48 AM »
Quote
ok it works now thx a lot mel!!

next problem :P  :

the script name is manager and the duell manager system works.

but i also have a boot and kill item for admins that has to be in the onactivateitem part.

but the kill and boot items both act like the duel manager now...

this is the script:




void bootkill()
{
object oCaller = GetItemActivator();
object oTarget = GetItemActivatedTarget();
object oItem = GetItemActivated();
string sTag = GetTag(oItem);

if (sTag == "bootcodem1")//YOU CAN CHANCE THIS TAGG OF A ANOTER.
{

DelayCommand(0.5,BootPC(oTarget));

}
if (sTag == "killcodem1")//YOU CAN CHANCE THIS TAGG OF A ANOTER.
{

effect eDeath= EffectDeath(TRUE);

DelayCommand(0.5,ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget));

}

}

void main()

duel manager script...
[snapback]11583[/snapback]
First, you're sure the tag of the item to boot whit is 'bootcodem1' and to kill whit is 'killcodem1'? Second, you run the duel manager in void main(). This is the place the script starts and ends. If you didn't add somthing in void main() to say to run the duel manager when the tag is 'manager' or to run boot when the tag is 'bootcodem1' it will alwyas run the duel manager.

I would do it like this, add this in the onactivate event of the module:
Code: [Select]
void main()
{
    ExecuteScript(GetTag(GetItemActivated()), GetItemActivator());
}
Then name the duel manager script exactly the same as the tag it has. Same for the kill/boot items. It should know what script to run then.

-Mel

Offline Pazuul

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://
420's Duel Management System
« Reply #21 on: November 28, 2004, 10:13:26 AM »
y the tags were correct but i raplaced the onactive script by the thing to get the tag and script name... now it works
Pazuul - Leader of Minions

Offline Fury

  • Newbie
  • *
  • Posts: 28
    • MSN Messenger - Asgardloki@hotmail.com
    • View Profile
    • http://www.piv.pivpiv.dk
    • Email
420's Duel Management System
« Reply #22 on: December 19, 2004, 07:09:45 AM »
cant DL the file doesnt work :S