Home   Forums   Search   Login   Register   Member List  
     
Forums  > Writers/Builders  > Public Writers/Builders Forum  > onenter experience  
 
Display using:  
Previous Thread :: Next Thread 
 Author Thread: onenter experience
Applecorn is not online. Last active: 3/24/2008 6:25:15 AM Applecorn
Joined: 23 Sep 2004
Total Posts: 58
Send PM
 
onenter experience
Posted: 06 Oct 2004 05:13 AM
Hello I’m new here. I just want to say I love the scripts you use in your mod. I have been looking for an exp onenter script like the one you have. I was wandering could point me in the right direction to creating my own. I have looked for something similar on the vault, but have not had much luck.
pdwalker is not online. Last active: 4/28/2020 8:46:52 PM pdwalker
Top 25 Poster
Forum Moderator
Joined: 08 Jan 2004
Total Posts: 5692
Send PM
 
Re: onenter experience
Posted: 06 Oct 2004 12:15 PM
I cannot give you the specific script because it contains many things that are specific to vives that would not make any sense.

Essentially, there is one script for each area.

Each script works like this
- provides the descriptive text with the SendMessageToPC command
- using a persistent variable (this part depends on your persistence system) for this unique area, check to see if this character has been giving the exploration xp or not.
- If not, then give it using the GiveXPToCreature function

It's that simple.

- Paul

Purpose in life: finding better ways of allowing players to kill themselves. Repeatedly.
--
"...Cause he mixes it with love
And makes the world taste good."
--
<@James42> Lawful good isn't in your vocabulary, it's on your menu.
Akril is not online. Last active: 11/19/2005 2:07:31 PM Akril
Top 25 Poster
Joined: 17 Jan 2004
Total Posts: 1363
Send PM
 
Re: onenter experience
Posted: 06 Oct 2004 12:25 PM
Yeah see. Simple

*walks off looking incredibly confused at the techno speak*

Never argue with an idiot.
They drag you down to their level
and then beat you with experience.

Akril

Quinellieth. 20th Circle of the Order of the Ring
Applecorn is not online. Last active: 3/24/2008 6:25:15 AM Applecorn
Joined: 23 Sep 2004
Total Posts: 58
Send PM
 
Re: onenter experience
Posted: 06 Oct 2004 02:30 PM
Something like this?

//B W-Husey October 2004
//Give xp to entering PC (once only)

Void main()
{
object oPC = GetEnteringObject();

if (GetIsPC(oPC) == TRUE) // you might have to use
GetObjectType instead here - you are checking the
entering object is a PC - not really that necessary
but saves some run time.
{
if (GetLocalInt(oPC,"nXPSet"==FALSE) //make sure PC
hasn't already got this XP
{
SetLocalInt(oPC,"nXPSet",TRUE); //set so PC can't get
this XP again
GiveXPToCreature(oPC,100); //give 100 xp to the PC
}
}
}
Arathon is not online. Last active: 7/24/2013 7:30:18 AM Arathon
vives.dyndns.org
Top 25 Poster
Forum Moderator
Joined: 09 Feb 2003
Total Posts: 1885
Send PM
 
Re: onenter experience
Posted: 06 Oct 2004 03:19 PM
#include "vv_include"

void main()
{
string sAreaDescription = "This well trodden road has been worn down by the multitudes of Travelling merchants and traders travelling from the busy Port Royale and further shores to the bustling Trading Post near Buckshire.";

string sRewardTag = "XP_Enter_Northern_Highway";
string sRewardDescription = "";
int iXPReward = 80;

/***************************************************************************/

vv_PCEntersArea(sAreaDescription, sRewardTag, iXPReward, sRewardDescription);
}


This is an example of the script we place in the onenter tabs of areas. In our instance though this obviously references other custom scripts we have tying in with our database (which Quietus made for us in-house).

Hopefully this might be of some use. I could post all the other scripts it references, including the vv_include...... but that one in particular is rather large :/

- Ara

Vives Screenshots!



Quietus is not online. Last active: 10/30/2007 8:39:57 PM Quietus
Top 25 Poster
Forum Moderator
Joined: 29 Jun 2003
Total Posts: 803
Send PM
 
Re: onenter experience
Posted: 06 Oct 2004 03:59 PM
Something like this?

//B W-Husey October 2004
//Give xp to entering PC (once only)

Void main()
{
object oPC = GetEnteringObject();

if (GetIsPC(oPC) == TRUE) // you might have to use
GetObjectType instead here - you are checking the
entering object is a PC - not really that necessary
but saves some run time.
{
if (GetLocalInt(oPC,"nXPSet"==FALSE) //make sure PC
hasn't already got this XP
{
SetLocalInt(oPC,"nXPSet",TRUE); //set so PC can't get
this XP again
GiveXPToCreature(oPC,100); //give 100 xp to the PC
}
}
}



Yes, except the flag for tracking if you've already given the XP isn't persistent -- meaning once you reset your server, the PC will get the XP all over again.

-Q
pdwalker is not online. Last active: 4/28/2020 8:46:52 PM pdwalker
Top 25 Poster
Forum Moderator
Joined: 08 Jan 2004
Total Posts: 5692
Send PM
 
Re: onenter experience
Posted: 06 Oct 2004 04:02 PM
The vv_include file contains the definition of vv_PCEntersArea which handles the bookkeeping and everything else that we do.

The heart of the script basically does what you have just written. We also check for
!GetIsDM(oPC) && !(GetIsDMPossessed(oPC) to exclude the DM's from getting exploration XP.

Also, remember that your nXPSet has to be unique to each area.

(thats why we have the vv_PCEntersArea function and call it with the unique area tag that is used for storing the local variable into the database - it makes the on enter scripts simpler and cleaner as you can see from the above example.)

- Paul

PS: Q did a heck of a job setting those all up.

Purpose in life: finding better ways of allowing players to kill themselves. Repeatedly.
--
"...Cause he mixes it with love
And makes the world taste good."
--
<@James42> Lawful good isn't in your vocabulary, it's on your menu.
Akril is not online. Last active: 11/19/2005 2:07:31 PM Akril
Top 25 Poster
Joined: 17 Jan 2004
Total Posts: 1363
Send PM
 
Re: onenter experience
Posted: 07 Oct 2004 05:05 AM
Yes, except the flag for tracking if you've already given the XP isn't persistent -- meaning once you reset your server, the PC will get the XP all over again. Q

Sounds like a well written script if you ask me :D

Just for clarity I was referring to the ability to gain the XP everytime. I have no idea about scripting and just reading that lot made my head spin!

Never argue with an idiot.
They drag you down to their level
and then beat you with experience.

Akril

Quinellieth. 20th Circle of the Order of the Ring
Previous Thread :: Next Thread 
Page 1 of 1
 
Forums  > Writers/Builders  > Public Writers/Builders Forum  > onenter experience