Noobish questions, mostly about scripting

Forum Archive - from http://theuniversal.net
Locked
User avatar
matias
World Owner
World Owner
Posts: 46
Joined: Wed Apr 24, 2013 7:37 pm

Post by matias »

may be you can script in the town window something to change the town name that would be easier
User avatar
zaroba
World Owner
World Owner
Posts: 7257
Joined: Fri Oct 10, 2003 11:06 pm
Location: Hereford, PA
Contact:

Post by zaroba »

There is the command to change the 'Details' button text for items.
But how does one set the text that is displayed when the button is clicked on?
User avatar
Mit
Staff
Staff
Posts: 3551
Joined: Sun Sep 21, 2003 10:14 pm
Location: Unknown

Post by Mit »

Are you referring to "*Itemdetailstext" ?
If you set that, clicking the button will trigger a "ItemDetails" server script event, so you'd implement an OSD or otherwise such as

Code: Select all

Event( "ItemDetails", "Monkeys" )
{
    *msg %PLAYER% Monkeys need no further explanation surely.
}
that help?
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

this didn't work for the one item i tried it with. the code worked when i used useitem instead of details.
User avatar
zaroba
World Owner
World Owner
Posts: 7257
Joined: Fri Oct 10, 2003 11:06 pm
Location: Hereford, PA
Contact:

Post by zaroba »

Worked for me, thanks mit :)
(although I only tried it with fuel on pandora)
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

the 3 or 4 things i've tried this with have no response.
User avatar
zaroba
World Owner
World Owner
Posts: 7257
Joined: Fri Oct 10, 2003 11:06 pm
Location: Hereford, PA
Contact:

Post by zaroba »

Mit, have the var limits etc changed?


I could have sworn we had $gServerTimeVars but they are being treated like temp vars for me. Happening with both 65.8 and 65.9a servers

Could have sworn we had more then 8 $gPlayertimeVars as well. Wasn't the limit upped to 16?

$gBuildingVars. not $gBuildingTimeVars, regular $gBuildingVars. I'm showing 2 with values over 500000000. Thought these were limited to 32k like playervars, or do all vars have higher limits now? Don't want to try and make use of this if it is a bug, but if it isn't a bug, then awesome :)


I'm also having some issues with playervars.
Login script has this line, $gPlayerTimeVar1=$gPlayerTimeVar1+1
Sometimes the value will go above 1, but more often then not it resets to 1
It works fine on Pandora, but not zoric. Pandora's one is a copy/paste of the file that zoric uses. the only difference is that Pandora is still running 65.8 but zoric is using 65.9a
User avatar
flametard
Posts: 1245
Joined: Sun Apr 01, 2007 2:05 am
Location: Join NR! faction name: 'NR new recruits' password: 'Truth'
Contact:

Post by flametard »

is there a way for the script to determine if a player has the most kudos on the planet? I want to make it so the person on xebec with the most kudos is called the king or queen when they log in.
User avatar
zaroba
World Owner
World Owner
Posts: 7257
Joined: Fri Oct 10, 2003 11:06 pm
Location: Hereford, PA
Contact:

Post by zaroba »

if there isn't already a way, one method I can think of is to use 2 servervars.

1 to record the current top kudos, 1 to record the id # of the player holding it.
When a player logs in, have the join script check their kudos against the servervar storing the current top kudos. If they have more, then set the 2nd var to their ID and announce them as beign the king.

It's not super accurate, but it should work.
User avatar
Mit
Staff
Staff
Posts: 3551
Joined: Sun Sep 21, 2003 10:14 pm
Location: Unknown

Post by Mit »

You can also do this by triggering an event for all 'active' players using *eventallalive (which triggers a custom event for each active player in turn) and storing the highest kudos so far in a servervar as zar describes.
Be aware though that triggering a script for all the active players could take a long time to excecute if your script is complicated and/or you've got a lot of players active on your world, so you'll need to use it carefully.
User avatar
flametard
Posts: 1245
Joined: Sun Apr 01, 2007 2:05 am
Location: Join NR! faction name: 'NR new recruits' password: 'Truth'
Contact:

Post by flametard »

Zar, I hate to ask you to hold my hand and guide me through this script, but seeing as I've never messed with this kinda stuff before, could you write up that into a script for me? Itll help the gameplay on xebec by giving players a goal or a target. And o could use the help figuring out those commands so I can incorporate the into my script
ultramarine
Posts: 84
Joined: Sun Jan 15, 2012 5:56 pm

Post by ultramarine »

i didn't see this thread started when i requested gp for xebec, but i guess it falls under the same sort of though pattern,

do you guys mind considering gp for xebec and see if that does anything to draw players, also if it has not happened the world building limit needs to be upped to accommodate more players.

2 - 4 a month for 100000s or 25000 to 50000s each was the proposed goal for gp on xebec,
User avatar
zaroba
World Owner
World Owner
Posts: 7257
Joined: Fri Oct 10, 2003 11:06 pm
Location: Hereford, PA
Contact:

Post by zaroba »

flametard wrote:Zar, I hate to ask you to hold my hand and guide me through this script, but seeing as I've never messed with this kinda stuff before, could you write up that into a script for me?
I kinda have one made already, from years ago so it could do with some modernization. It doesn't go by kudos though, it's just whoever kills the king becomes the king. So its like playing tag but in reverse. Think I had made it for one of those Free For All Combat worlds I used to run.

pvar 10 holds the status of king
pvar 11 stores players deaths
the &king command can be used to see who is king

Code: Select all

Event( "PlayerLogin" 0 )
	{ 
	If ($playervar10=1)
		{
		sleep(100)
		*say The King of Combat %player% has joined!
		*say %player% has been killed $playervar11 times!
		*say %player% has killed somebody $gplayerkudos times!
		*msg %player% you can type &king to advertise your position
		}
	else
		{
		sleep(100)
		*msg %player% You are not holding the crown.
		*msg %player% go and find the crown holder and claim it.
		}
	}

Event("&command", "king") 
	{ 
	If ($playervar10=0)
		{
		*msg %player% You are not holding the crown.
		*msg %player% go and find the crown holder and claim it.
		*msg %killer% you currently have $gplayerkudos kills.
		}
	Else If ($playervar10=1)
		{
		*say The King of Combat, %player%, is here!
		*say %player% has been killed $playervar11 times!
		*say %player% has killed somebody $gplayerkudos times!
		}
	Else
		{
		*msg %player% error in king command.
		}
	}

event( "playerdeath", 0 )
	{
	If ($playervar10=0)
		{
		$playervar11=$playervar11+1
		*msg %killer% unfortunatly, %player% was not holding the crown.
		*msg %player% you have been killed $playervar11 times so far.
		}
	Else If ($playervar10=1)
		{
		$playervar10=0
		$playervar11=$playervar11+1
		*say The King of Combat, %player%, has been killed!
		*say %killer% is the new king!
		*msg %killer% you can type &king to advertise your position
		*setplayervar %killer% 10 1
		}
	Else
		{
		*msg %player% error in player death.
		}
	}
Locked