SphereCommunity
Got a couple of questions - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Got a couple of questions (/Thread-Got-a-couple-of-questions)

Pages: 1 2


Got a couple of questions - Leonidas - 05-31-2013 06:45 AM

I forgot where the starting point for a new character is located, I tried changing sphere_map_points but it didn't do a thing.

Also, I want to put an event on every new character, i figured it was in the serv triggers but i got no luck doing that, but i probably did it wrong.

Thanks for any help


RE: Got a couple of questions - RanXerox - 05-31-2013 06:54 AM

I use the f_onchar_create function in the sphere_serv_triggers.scp file for that sort of thing.


RE: Got a couple of questions - Leonidas - 05-31-2013 07:16 AM

Yeah thats what I just tried a little harder this time and got it Tongue Thanks man


RE: Got a couple of questions - larmc20 - 06-06-2013 03:43 AM

I am having a problem to start a dialog when some player create a new char!!

I don't know how to add the FUNCTION f_onchar_create.

well... I have this:
PHP Code:
// This function is called before server is going to save.
// ARGN1 --> save is forced (writable)
// ARGN2 --> save stage (for backgroud save goes 1 to 6146 [sector count + 2])
// RETURN
//      0 --> normal action (save)
//      1 --> denyes save
[FUNCTION f_onserver_save

AND THE DIALOG I WANNA START ON CREATE CHAR.

PHP Code:
[DIALOG d_cadastros]
99,51
NOCLOSE
NOMOVE
NODISPOSE
page 0
resizepic 93 52 9200 354 388
gumppic 197 70 100
text 235 84 0 0
text 218 125 0 1
gumppic 90 27 52
htmlgump 175 184 200 100 2 1 1
gumppic 102 296 2430
textentry 120 301 308 20 0 1 3
textentry 117 332 308 20 0 2 4
textentry 120 362 304 20 0 3 5
button 235 411 247 248 1 0 0

[DIALOG d_cadastros text]
Bem-Vindo
Conamidia Shard
Boa tarde
Seja bem vindo ao Conamídia ShardAqui você encontrará aventuras e diversão com outros jogadoresRespeite os jogadores assim como o servidorO intuito do servidor e proporcionar diversão a todosCaso encontre algum bugfavor contatar os responsáveis pelos servidor.

Nome Completo
E
-mail
RG

[DIALOG d_cadastros button]
ON=0
WRITEFILE cadastros
.scp Conta=<src.account>
wRITEFILE cadastros.scp NAME=<ARGTXT[1]>
WRITEFILE Cadastros.scp EMAIL=<ARGTXT[2]>
WRITEFILE Cadastros.scp RG=<ARGTXT[3]>
[
EOF

What have I got to do to make it work? I tried to add the function on the script but it didnt work.


RE: Got a couple of questions - darksun84 - 06-06-2013 04:08 AM

f_onchar_create should be already present in the same file of f_onserver_save !


PHP Code:
// This function is called after client have created a new char.
// SRC   --> char being created
// ARGN1 --> flags
// ARGN2 --> profession chosen
// ARGN3 --> race (1=human, 2=elf, 3=gargoyle)
// ARGS  --> account name
// ARGO  --> the client creating the character
[FUNCTION f_onchar_create]
timerf 2,src.dialog d_cadastros 
If i remember well, a delay of 1-3 seconds is needed before calling a dialog function in f_onchar_create, otherwise the gump will not appears.Actually i think it "appears" after the character creation is completed, but "disappears" when the character shows up (but i am not sure of that)


RE: Got a couple of questions - larmc20 - 06-06-2013 07:20 AM

thanks man. But Actually It is not working.

If I type on admin acc .f_onchar_create it works. But when i create a New player it does not work...

I dont know


RE: Got a couple of questions - RanXerox - 06-06-2013 08:31 AM

That function runs before the character is technically in-game... Perhaps try @Login if you want to launch a dialog.


RE: Got a couple of questions - darksun84 - 06-06-2013 08:42 AM

(06-06-2013 07:20 AM)larmc20 Wrote:  thanks man. But Actually It is not working.

If I type on admin acc .f_onchar_create it works. But when i create a New player it does not work...

I dont know

ahh actually there is no default object in f_on_char_create (just src for the character), so you'll have to use src.timerf !


RE: Got a couple of questions - larmc20 - 06-06-2013 12:22 PM

Yes Mate. With SRC.TIMERF 3, src.dialog.... Worked...
Thanksss


RE: Got a couple of questions - dagger4k - 06-06-2013 05:00 PM

For adding events to all players you can add it through the sphere.ini

Code:
// Events related to all NPCs
//EventsPet=your_event

// Events related to all players
EventsPlayer=e_player


You just have to make sure you have your e_player or e_event somewhere in your scripts. I have noticed that it doesn't show up under show events in game but it is still present on the player.

As for opening a new dialogue what you can to is add a @login function to the e_player event.