orco83

20/07/2005 12:07:16

Hola a todos, tengo un par de dudas, a ver si me las contestais:
-¿Cómo hago que un personaje se siente en la silla? (pq se que mirandola y no sde sienta).
-¿Como hago que se tenga que comer y dormir?
-¿como hago para dormir igual que en vuestro server?

Eso es todo de momento, muchas gracias...

20/07/2005 21:53:20

Script para sentarse enuna silla
-------------------------------------

[code:1:60b168c395]
//
// NWSit
//
// Script to make the PC using the object sit on it.
//
// (c) Shir'le E. Illios, 2002 (shirle@drowwanderer.com)
//
////////////////////////////////////////////////////////

void main()
{

// Get the character using the object.
object oPlayer = GetLastUsedBy();

// Make certain that the character is a PC.
if( GetIsPC( oPlayer ) )
{

// Get the object being sat on.
object oChair = OBJECT_SELF;

// If the object is valid and nobody else is currently sitting on it.
if( GetIsObjectValid( oChair ) &&
!GetIsObjectValid( GetSittingCreature( oChair ) ) )
{
// Let the player sit on the object.
AssignCommand( oPlayer, ActionSit( oChair ) );
}

} // End if

} // End main
[/code:1:60b168c395]

Nombre del script: sentarse

Donde colocarlo: en las propiedades de la silla, en quiones, en OnUsed

Ademas la silla tendra que ser utilizable y de trama si no se quiere que se rompa.

20/07/2005 21:58:29

Comer y beber son un sistema completo, o sea que va colocado en varios sitios los scripts y ademas se usan objetos, por lo tanto, dificil de poner aqui.

El sistema de sueño tambien es un sistema completo aunque mas sencillo y normalment solo se usa el evento de modulo OnPlayerRest, esta en Editar-> Propiedades del modulo -> pestaña de sucesos

El sistema de mi modulo, tambien imbulle el sistema de oficios, intentare ponerte aqui solo lo que refiere al efecto de dormir y que tenga en cuenta cada cuanto tiempo duermes.

20/07/2005 22:02:01

Sistema de sueño
---------------------

[code:1:b4d8c7257c]
//::///////////////////////////////////////////////
//:: Basic Resting Script v1.1
//:: boz_onrest_v11.nss
//:: Copyright (c) 2002 Brotherhood of Zock
//:://////////////////////////////////////////////
/*
This script allows the players to rest after a specified amount of hours
has passed and no hostile creatures are nearby.

Notes:
It only affects Player Characters. Familiars, summoned creatures and probably henchmen WILL rest!

Installation:
Place this script in the module onRest event.

Modifications:
Modified August 10, 2002
Option to set the level at which the rest-restrictions will be applied to the players added (Main-Function: Script Settings).
*/
//:://////////////////////////////////////////////
//:: Created By: Timo "Lord Gsox" Bischoff (NWN Nick: Kihon)
//:: Created On: August 04, 2002
//:://////////////////////////////////////////////

//::///////////////////////////////////////////////
//:: GetHourTimeZero
//:: Copyright (c) 2002 BrotherhoodofZock
//:://////////////////////////////////////////////
/*
modified July 30, 2002
iHourTimeZero calculation modified. iYear-1 replaced by iYear.
In NWN the Year-count starts with 0 (though year 0 doesn't make much sense).
Think of year 0 as the first year (Year 1).
*/
//:://////////////////////////////////////////////
//:: Created By: Timo "Lord Gsox" Bischoff (NWN Nick: Kihon)
//:: Created On: July 07, 2002
//:://////////////////////////////////////////////

// Counting the actual date from Year0 Month0 Day0 Hour0 in hours
int GetHourTimeZero(int iYear = 99999, int iMonth = 99, int iDay = 99, int iHour = 99)
{
// Check if a specific Date/Time is forwarded to the function.
// If no or invalid values are forwarded to the function, the current Date/Time will be used
if (iYear > 30000)
iYear = GetCalendarYear();
if (iMonth > 12)
iMonth = GetCalendarMonth();
if (iDay > 28)
iDay = GetCalendarDay();
if (iHour > 23)
iHour = GetTimeHour();

//Calculate and return the "HourTimeZero"-TimeIndex
int iHourTimeZero = (iYear)*12*28*24 + (iMonth-1)*28*24 + (iDay-1)*24 + iHour;
return iHourTimeZero;
}

//::///////////////////////////////////////////////
//:: Main Function
//:: Copyright (c) 2002 Brotherhood of Zock
//:://////////////////////////////////////////////
/*
The Main Function of the resting script.

Modified August 10, 2002
iLevelAffected variable added. The Rest-restrictions will NOT be applied to players
that don't have the level (HitDice) specified in the iLevelAffected variable.
*/
//:://////////////////////////////////////////////
//:: Created By: Timo "Lord Gsox" Bischoff (NWN Nick: Kihon)
//:: Created On: August 04, 2002
//:://////////////////////////////////////////////
// The main function placed in the onRest event
void main()
{
//ExecuteScript("x2_mod_def_rest", GetLastPCRested());
//Declaracion de variables ara los efectos sonoros y visuales de dormir
effect eBlind = EffectBlindness();
effect eSnore = EffectVisualEffect(VFX_IMP_SLEEP);
// Script Settings (Variable Declaration)
int iLevelAffected = 1; // The min. PC Level at which the Rest-restrictions will be applied (1-20; default=2)
int iRestDelay = 6; // The ammount of hours a player must wait between Rests (Default = 8 hours)
int iHostileRange = 10; // The radius around the players that must be free of hostiles in order to rest.
// iHostileRange = 0: Hostile Check disabled
// iHostileRange = x; Radius of Hostile Check (x meters)
// This can be abused as some sort of "monster radar".

// Variable Declarations
object oPC = GetLastPCRested(); // This Script only affects Player Characters. Familiars, summoned creatures and probably henchmen WILL rest!
object oHench = GetHenchman(oPC);
int iPuntosHambre = GetLocalInt(oPC, "Hungry");
int iPuntosSed = GetLocalInt(oPC, "Thirsty");

if (GetHitDice (oPC) >= iLevelAffected) // Check if the rest-restrictions will be applied to the player
{
// ---------- Rest Event started ----------
if (GetLastRestEventType() == REST_EVENTTYPE_REST_STARTED)
{
// Check if since the last rest more than <iRestDelay> hours have passed.
if (GetHourTimeZero() < GetLocalInt (oPC, "i_TI_LastRest") + iRestDelay) // i_TI_LastRest is 0 when the player enters the module
{ // Resting IS NOT allowed
AssignCommand (oPC, ClearAllActions()); // Prevent Resting
SendMessageToPC (oPC, "Debes esperar " + IntToString (iRestDelay - (GetHourTimeZero() - GetLocalInt (oPC, "i_TI_LastRest"))) + " hora(s) antes de dormir otra vez.");
}
else // Resting IS possible
{
object oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY);
if (iHostileRange == 0 || (iHostileRange != 0 && GetDistanceToObject(oCreature) <= IntToFloat(iHostileRange)))
{ // If Hostile Check disabled or no Hostiles within Hostile Radius: Initiate Resting

//******************************************************************************
//* Generador de Encuantros por Sorpresa al Dormir
//******************************************************************************
//GESAD_Lanzador (oPC);
//******************************************************************************

//Aplicando efectos visuales y sonoros de dormir
object oRestbedroll = CreateObject (OBJECT_TYPE_PLACEABLE, "plc_bedrolls", GetLocation (oPC), FALSE); // Place a static bedroll under the player
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSnore, oPC, 10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBlind, oPC, 20.0);
DelayCommand(10.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSnore, oPC, 10.0));
SetLocalObject (oPC, "o_PL_Bedrollrest", oRestbedroll); // Temporary "global" variable. Gets deleted after deletion of the bedroll.
}
else
{ // Resting IS NOT allowed
AssignCommand (oPC, ClearAllActions()); // Prevent Resting
SendMessageToPC (oPC, "No puedes descansar, hay enemigos cerca.");
}
}
}

// ---------- Rest Event finished or aborted ----------
if ((GetLastRestEventType() == REST_EVENTTYPE_REST_FINISHED || GetLastRestEventType() == REST_EVENTTYPE_REST_CANCELLED) && GetIsObjectValid(GetLocalObject (oPC, "o_PL_Bedrollrest")))
{ // If a bedroll was placed under the player: Delete it
DestroyObject (GetLocalObject (oPC, "o_PL_Bedrollrest"), 0.0f);
DeleteLocalObject (oPC, "o_PL_Bedrollrest");
//Guardando el PJ
ExportSingleCharacter(oPC);
//SendMessageToPC(oPC, "Personaje guardado.");
}
// ---------- Si el descanso a concluido sin problemas ----------
if (GetLastRestEventType() == REST_EVENTTYPE_REST_FINISHED)
{
SetLocalInt (oPC, "i_TI_LastRest", GetHourTimeZero()); // Guardar la hora en que ha concluido el descanso
}
}
else
{
// ---------- Rest Event started ----------
if (GetLastRestEventType() == REST_EVENTTYPE_REST_STARTED)
{
object oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY);
if (iHostileRange == 0 || (iHostileRange != 0 && GetDistanceToObject(oCreature) <= IntToFloat(iHostileRange)))
{
// If Hostile Check disabled or no Hostiles within Hostile Radius: Initiate Resting

//******************************************************************************
//* Generador de Encuantros por Sorpresa al Dormir
//******************************************************************************
//GESAD_Lanzador (oPC);
//******************************************************************************

//Aplicando efectos visuales y sonoros de dormir
object oRestbedroll = CreateObject (OBJECT_TYPE_PLACEABLE, "plc_bedrolls", GetLocation (oPC), FALSE); // Place a static bedroll under the player
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSnore, oPC, 10.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBlind, oPC, 20.0);
DelayCommand(10.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSnore, oPC, 10.0));
SetLocalObject (oPC, "o_PL_Bedrollrest", oRestbedroll); // Temporary "global" variable. Gets deleted after deletion of the bedroll.
}
else
{ // Resting IS NOT allowed
AssignCommand (oPC, ClearAllActions()); // Prevent Resting
SendMessageToPC (oPC, "No puedes descansar, hay enemigos cerca.");
}
}
// ---------- Rest Event finished or aborted ----------
if ((GetLastRestEventType() == REST_EVENTTYPE_REST_FINISHED || GetLastRestEventType() == REST_EVENTTYPE_REST_CANCELLED) && GetIsObjectValid(GetLocalObject (oPC, "o_PL_Bedrollrest")))
{ // If a bedroll was placed under the player: Delete it
DestroyObject (GetLocalObject (oPC, "o_PL_Bedrollrest"), 0.0f);
DeleteLocalObject (oPC, "o_PL_Bedrollrest");
//Guardando el PJ
ExportSingleCharacter(oPC);
//SendMessageToPC(oPC, "Personaje guardado.");
}
// ---------- Si el descanso a concluido sin problemas ----------
if (GetLastRestEventType() == REST_EVENTTYPE_REST_FINISHED)
{
SetLocalInt (oPC, "i_TI_LastRest", GetHourTimeZero()); // Guardar la hora en que ha concluido el descanso
}
}
}
[/code:1:b4d8c7257c]


Nombre del script: al_descansar

Uso: Colocarlo en OnPlayerRest en los sucesos de las propiedades del modulo.

20/07/2005 22:04:26

Tambien el modulo dispone de un sistema de comida y bebida pero no se si se adpatara a lo que quieres, lo que pasa es que actualmente esta desactivado y por tanto no sabes como va.

Maese Fys

21/07/2005 10:25:05

Desactivado?? 8O 8O , porque?? :D :D

21/07/2005 16:35:20

Porque no lo quisieron los jugadores, se hico una encuesta y no lo quisieron, ni lo probaron, decian que habian probado muchos sistemas de esos y que no aportaban nada.

yne

21/07/2005 18:41:34

Hombre aporta que en pleno apogeo de tu lucha te sientas irremediablemente hambriento o sediento y necesites beber porque de lo contrario empiezas a perder vida(por poner un ejemplo) hasta el riesgo de morir de inanición. Aporta jodienda y realismo... porque antes de ir a una buena lucha será mejor que comas algo y bebas también o de lo contrario te encontrarás que no puedes sacar fuerza de ningún sitio.
Sería ideal que un grupo de aventureros hiciese un alto en el camino... que unos durmiesen, otros vigilasen y otros comiesen mientras vigilan y rezan porque no haya nadie acechando en las sombras... y a raiz de esto... creo que aunque existe un script por el servidor no está activo, que en caso de que descanses en un lugar que no sea seguro sufras el riesgo de ser atacado ¿se podría poner? quizás esto daría un poco más de realismo a todo...
Con la comida/bebida se podrían poner límites altos o como he visto en algún servidor que para poder descansar debías comer algo antes si no te decía que estabas demasiado hambriento para conciliar el sueño.

Statico

21/07/2005 19:30:22

Cierto Yne ^^ da rol a los que lo sepan aprovexar, porke siempre estan los k llevan un piñon de comida y agua en la mochila y cuando les dice el log k tienen ambre comen y beben sin rolear... pero los verdaderos roleros lo rolearian como ir a la taberna, volver a su casa (si la tienen) o si estan de aventuras, encender un fuego sentarse mientras otros vigilan, coner beber etc...

Y lo del script de los atakes mientras duermes tb muy ideal :D si recordais en el HotU cuando descnsabas en una zona con enemigos, era muy probable que te despertaras a mitad (sin aber podido recuperar nada o casi nada) porque un enemigo te habia visto y se acercaba, tambien es una buena idea, ya que en gurpos mientras unos descansan los otros vigilan, como debe ser un verdadero grupo de aventureros no:

-Vamos a lagartos, cogemos el barco desde Calim y vamos

Porque... ir asta alli desde Calim conlleva atravesar media costa de la espada, y sin descansar ni beber ni comer, como explicas que luego rindan tanto?

En fin, esa es mi opinion ^^