World of Gothic Archiv > NWN-Hilfe
Scripte kombinieren?? Geht das?
Seite 1 von 1  1 
10.09.2002, 15:54 #1
VieleVonEins
Beiträge: 21
Scripte kombinieren?? Geht das?
Ich hab folgends Problem und bräuchte die hilfe von einem wohl erfahrenerem Scripter als ich es bin.

Ich benutze für mein Mod HC rules, was ja bedeutet das ich bei den Modulumfassenden Scripten, die dafür vorgegeben Scripte benutzen muss.

Nun möchte ich aber ein vorhandenes "Werewolf steckt die Opfer mit Lykanthrophiescript" ebenfalls benutzen. Beide Scripte sollen bei den Modulscripten eingestellt werden.

Wäre es möglich die jeweiligen Scripte zu kombinieren, so dass die Effekte von Beiden im Spiel eintreten?????????

Also hier das erste Hc Script für Onheartbeat:

//Hardcore Heartbeat
//Archaegeo 2002 Jun 24

// Heartbeat Optimization of Player State by Brian Kelly (spilth)
// http://www.spilth.org/
// Inspired by Mitchell M. Evans (gonecamping@cox.net)

// This script goes in OnHeartBeat in the Module Properties Events
// It checks players to see if their PlayerState is other than Alive
// and takes steps as noted below to affect them.

#include "hc_inc"
#include "hc_inc_wandering"
#include "hc_inc_on_hrtbt"
#include "hc_text_hrtbeat"
#include "hc_inc_timecheck"
#include "hc_inc_htf"

void main()
{
if(!preEvent()) return;
int iCurrentHour = GetTimeHour();
object oPlayer = GetFirstPC();
if(SecondsSinceBegin() > GetLocalInt(oMod,"NEXTHTFCHECK"))
SignalEvent(oMod,EventUserDefined(HTFCHKEVENTNUM));
while(GetIsObjectValid(oPlayer))
{
string sCDK=GetPCPublicCDKey(oPlayer);
if(GetLocalInt(oMod,"RESTSYSTEM"))
{
int iLastHour = GetLocalInt(oPlayer,"LastHour");
if (iLastHour != iCurrentHour)
{
ExecuteScript("hc_fb_play_rest", oPlayer);
SetLocalInt(oPlayer,"LastHour",iCurrentHour);
}
}
if(!GetIsDM(oPlayer))SetPersistentInt(oMod,"LastHP"+GetName(oPlayer)+sCDK,
GetCurrentHitPoints(oPlayer));
// Thanks to RogC for the base for the Torch code, modified by Archaegeo for HCR
// And modified for grenade support of oil flasks
if(GetLocalInt(oMod,"BURNTORCH"))
{
if ( !GetIsDM(oPlayer) )
{
object oTorch = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPlayer);
string sTag=GetTag(oTorch);
if (sTag == "NW_IT_TORCH001" ||
sTag == "hc_torch" ||
sTag == "hc_lantern")
{
int nC;
if ( (nC=(GetLocalInt(oTorch,"BURNCOUNT")+1)) >=
GetLocalInt(oMod,"BURNTORCH")*(FloatToInt(HoursToSeconds(1)/6.0)))
{
if(sTag=="NW_IT_TORCH001" ||
sTag=="hc_torch")
{
DestroyObject(oTorch);
SendMessageToPC(oPlayer,TORCHOUT);
}
else
{
AssignCommand(oPlayer, ActionUnequipItem(oTorch));
SendMessageToPC(oPlayer,LANTERNOUT);
}
}
else
SetLocalInt(oTorch,"BURNCOUNT", nC);
}
}
}
if(GetLocalInt(oMod,"PKTRACKER"))
{
if(GetPersistentInt(oMod,"PKCOUNT"+sCDK)>etLocalInt(oMod,"PKTRACKER"))
{
SendMessageToAllDMs(sCDK+DMBOOTPK);
WriteTimestampedLogEntry("** Booted: "+sCDK+" for excessive PK");
BootPC(oPlayer);
postEvent();
return;
}
}
if(GetLocalInt(oMod,"WANDERSYSTEM") && GetLocalInt(oPlayer,"RESTING"))
{
wander_check(oPlayer);
}
oPlayer=GetNextPC();
}
postEvent();



Dann habe ich hier noch das Werewolf script:

//Werewolf Heartbeat, goes in OnHeartBeat of Module
//werewolfstuff
void main()
{
object oPC = GetFirstPC();
//Make sure the PC we're looking at is valid, and keep cycling until the last PC
while (GetIsObjectValid(oPC))
{
//AssignCommand(oPC,ActionSpeakString("Werewolf Heartbeat."));
if((GetIsNight() == TRUE) && (GetLocalInt(oPC, "AFF_WEREWOLF") == 1) && (GetLocalInt(oPC, "ONE_CHANGE") != 1))
{
//Set up variables
object oLWolf = GetObjectByTag("lwolf");
location lWolfSleep = GetLocation(oLWolf);
//effect eMorph = EffectPolymorph(POLYMORPH_TYPE_WEREWOLF);
//Get the location of the PC we're looking at
location lTransform = GetLocation(oPC);
int iWolfDays = GetLocalInt(oPC,"WOLF_DAYS");
SetLocalInt(oPC,"iChangeNow",0);
if(iWolfDays != 29)
{
if(iWolfDays == 3)
{
SetLocalInt(oPC,"WOLF_PERM",1);
}
if(iWolfDays < 3)
{
SetLocalInt(oPC,"iChangeNow",1);
}
iWolfDays++;
}
SetLocalInt(oPC,"WOLF_DAYS",iWolfDays);
if(iWolfDays == 29)
{
SetLocalInt(oPC,"WOLF_DAYS",0);
}
//make sure it is night, and the player is actually a werewolf
if((GetLocalInt(oPC, "HAS_WEREWOLF_EFFECT") != 1))
{
//make sure we only check once per night
SetLocalInt(oPC,"ONE_CHANGE",1);
int iFirstChange = GetLocalInt(oPC,"FIRST_CHANGE");
//only allow PC to resist change AFTER first change
int iChangeNow=GetLocalInt(oPC,"iChangeNow");
if((!(iFirstChange)) && (iChangeNow))
{
int iWereWolfWillResist = WillSave(oPC,25);
if (!(iWereWolfWillResist))
{
SendMessageToPC(oPC,"You could not resist the change.");
ExecuteScript("wwamrbrk",oPC);
//Apply werewolf transformation...
//ApplyEffectToObject(DURATION_TYPE_PERMANENT, eMorph, oPlayer);
object oWWolf = CreateObject(OBJECT_TYPE_CREATURE,"pcwerewolf",lTransform);
AssignCommand(oPC,JumpToLocation(lWolfSleep));
SetLocalObject(oPC,"MY_WOLF",oWWolf);
SetLocalInt(oPC, "HAS_WEREWOLF_EFFECT", 1);
SetLocalInt(oPC, "INVOLUNTARY",1);
}
}
if((iChangeNow) && (iFirstChange))
{
//AssignCommand(oPC,ActionSpeakString("First Change now."));
ExecuteScript("wwamrbrk",oPC);
object oWWolf =CreateObject(OBJECT_TYPE_CREATURE,"pcwerewolf",lTransform);
AssignCommand(oPC,JumpToLocation(lWolfSleep));
SetLocalObject(oPC,"MY_WOLF",oWWolf);
SetLocalInt(oPC, "HAS_WEREWOLF_EFFECT", 1);
SetLocalInt(oPC,"FIRST_CHANGE",0);
SetLocalInt(oPC,"INVOLUNTARY",1);
}
}
}
if(((GetIsDawn() == TRUE) || (GetIsDay() == TRUE)) &&
(GetLocalInt(oPC, "HAS_WEREWOLF_EFFECT") == 1) && (GetLocalInt(oPC, "wolfdead") ==0))
{
object oWerewolf = GetLocalObject(oPC,"MY_WOLF");
location lWerewolf = GetLocation(oWerewolf);
AssignCommand(oPC,JumpToLocation(lWerewolf));
DestroyObject(oWerewolf);
SetLocalInt(oPC, "HAS_WEREWOLF_EFFECT", 0);
SetLocalInt(oPC,"ONE_CHANGE",0);
SetLocalInt(oPC,"INVOLUNTARY",0);
SetLocalInt(oPC,"WOLF_TOOL_CHARGE",0);
/*int eWolf=EFFECT_TYPE_DAMAGE_REDUCTION;
effect eWereWolf=GetFirstEffect(oPC);
while(GetIsEffectValid(eWereWolf))
{
int eDamRed=GetEffectType(eWereWolf);
if(eWolf==eDamRed)
{
RemoveEffect(oPC,eWereWolf);
}
effect eWereWolf=GetNextEffect(oPC);
}*/
//see if pc realized what happend and if so create tool on pc
int iAbility = GetAbilityModifier(ABILITY_WISDOM,oPC);
int iRoll = d20(1);
//make sure pc doesn't already have tool
int iTool = GetLocalInt(oPC,"WWTOOL");
if(((iRoll+iAbility) >= 15) && !(iTool))
{
SendMessageToPC(oPC,"You realize you are infected and may attempt to control your form.");
CreateItemOnObject("ControlShapeTool",oPC);
SetLocalInt(oPC,"WWTOOL",1);
}
}
if(((GetIsDawn() == TRUE) || (GetIsDay() == TRUE)) &&
(GetLocalInt(oPC, "HAS_WEREWOLF_EFFECT") == 1) && (GetLocalInt(oPC, "wolfdead") ==1) &&
(GetLocalInt(oPC,"ONE_CHANGE") !=0))
{
SetLocalInt(oPC,"INVOLUNTARY",0);
SetLocalInt(oPC, "HAS_WEREWOLF_EFFECT", 0);
SetLocalInt(oPC, "wolfdead", 0);
SetLocalInt(oPC,"ONE_CHANGE",0);
}
int iWait=GetLocalInt(oPC,"iWait");
int iReady=GetCalendarDay();
if(((GetIsDawn() == TRUE) || (GetIsDay() == TRUE)) && (GetLocalInt(oPC, "AFF_WEREWOLF") == 1)&&(iReady==iWait))
{
SetLocalInt(oPC,"WOLF_TOOL_CHARGE",0);



ODER gibt es eine möglicheit...mehrere Scripte in eine Kategorie (z.b.: OnHeartbeat) einzubetten???

Bitte hilf mir mal eine(r)....
18.09.2002, 14:03 #2
Rhaegar
Beiträge: 296

Hm, kommt vielleicht etwas spät die Antwort, aber trotzdem:

Wenn du zwei Skripte der Form
void main()
{...Skript 1...}
und
void main()
{...script 2...} hast mach einfach

void main()
{..script 1...
...script 2...} draus.

Musst allerdings darauf achten, dass keine variablenbezeichnungen in beiden skripten vorkommen.
Seite 1 von 1  1