Mirage Source http://web.miragesource.net/forums/ |
|
Need help with one small thing. http://web.miragesource.net/forums/viewtopic.php?f=201&t=1838 |
Page 1 of 1 |
Author: | Examines [ Mon May 21, 2007 8:51 pm ] |
Post subject: | Need help with one small thing. |
Ok, I wanted to know if theres a code for starting off with an item. Like you register, pick a special class, and you start off with a item already in your inventory. Also, I was planning to have something diffrent for every class, so each class has something diffrent. It would be nice if someone helped me with that. Thanks~ -Examines- |
Author: | Matt [ Mon May 21, 2007 9:15 pm ] |
Post subject: | |
Sure, find server side where it creates the character, and add a call giveitem(blah) line and you should be good to go. I suggest you check the class first of course, so you can give the correct item for each class. ^_^ |
Author: | William [ Mon May 21, 2007 9:16 pm ] |
Post subject: | |
Open the server, search for Sub JoinGame. Then add something like: Code: If GetPlayerClass(Index) = 1 then
Call GiveItem() elseif GetPlayerClass(Index) = 2 then Call GiveItem() end if You also need to write a number to a ini file so the player cant get the item each time he/she login. |
Author: | Tony [ Mon May 21, 2007 9:20 pm ] |
Post subject: | |
its addchar sub serverside I believe. |
Author: | William [ Mon May 21, 2007 9:21 pm ] |
Post subject: | |
Kuja wrote: its addchar sub serverside I believe.
ohh yeah thats better than joingame |
Author: | Tony [ Mon May 21, 2007 10:36 pm ] |
Post subject: | |
William wrote: Kuja wrote: its addchar sub serverside I believe. ohh yeah thats better than joingame Yeah, by alot. It sets everything in the sub and calls saveplayer i think. So before call saveplayer just do some simple ifs and call giveitem or w/e |
Author: | Ramsey [ Mon May 21, 2007 10:42 pm ] |
Post subject: | |
You could add a variable to the player that would check if it was his first login. If so, you could like set items, quests, etc. |
Author: | Rian [ Mon May 21, 2007 11:34 pm ] |
Post subject: | |
You don't need to add any extra variables. The AddChar Sub handles everything to do with what your character's stats for the first time he logs into the game. |
Author: | Tony [ Tue May 22, 2007 12:37 am ] |
Post subject: | |
Sonire wrote: You don't need to add any extra variables. The AddChar Sub handles everything to do with what your character's stats for the first time he logs into the game.
Exactly. It sets for an example the class #3 and saves it. Otherwise if its not in that sub (.class=blahblah) then I'm guessing it'll be saved as its default value which is 0 I think o.o and your character will start with class 0. Get it or am I confusing you? |
Author: | Dark Echo [ Tue May 22, 2007 3:25 am ] |
Post subject: | |
If you want to do it the hard way, the way i'd more than likely do it (i like to keep things all neat and tidy), you could also add an extra variable onto class and call it StartingItem, and in the addchar sub, call giveitem startingitem.. But yeah, doing it this way will would require A LOT more work.. Which isnt really needed.. |
Author: | Matt [ Tue May 22, 2007 3:32 am ] |
Post subject: | |
Actually, it wouldn't be much more work, and would be the method to do it for an engine. That way, in the classes.ini you could change the starting item, the amount, etc. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |