Gammon Forum
Entire forum
SMAUG
SMAUG coding
Learning skills from objects, and other confusions!
Learning skills from objects, and other confusions!
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Pages: 1 2
Posted by
| Mopop
(115 posts) bio
|
Date
| Sun 27 Nov 2005 04:20 AM (UTC) |
Message
| Hello I was wondering how I could get equiped objects to teach a skill. I am trying to add a materia system. I think I have a general idea about what to do about it. But I was wondering how to get an object to teach a skill, and then have it so they dont know it when removed? Also how would I be able to add sockets to armor for the item to be equiped in. Thanks for your help guys =) | top |
|
Posted by
| Zeno
USA (2,871 posts) bio
|
Date
| Reply #1 on Sun 27 Nov 2005 04:24 AM (UTC) |
Message
| Well, you could use obj progs to do this but that would be somewhat limited. You'll probably want to add more variables to the object struct for the skill number and perhaps more variables for whatever else is needed. I suppose if you make it a new item type (ex: materia), then you could use v0 to v5 to do this, and you wouldn't have to add a whole new variable to the struct. You'd have 5 free variables right there.
As for forgetting the skill when removed, that seems tricky. For example if you have the system in, what if they learn it normally yet equip a weapon that gives the skill, then removes it? They could lose the skill even though they learned it normally. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | top |
|
Posted by
| Mopop
(115 posts) bio
|
Date
| Reply #2 on Sun 27 Nov 2005 04:46 AM (UTC) |
Message
| Well this will be the only way for them to learn skills. So they wont have to worry about any of that. As for all the object stuff could you tell me where to look at some good examples for what you said. I tried greping and keep falling short of what Im looking for. | top |
|
Posted by
| Zeno
USA (2,871 posts) bio
|
Date
| Reply #3 on Sun 27 Nov 2005 04:51 AM (UTC) |
Message
| This shouldn't be too hard then. An example if you made it an item type and picked v0 to be the skill it teaches, something like this can be done:
sn = obj->value[0];
ch->pcdata->learned[sn] = 5;
Of course, this example meaning the person would be the "ch", and you wanted the skill to be set at 5%. That code would probably go in the wear_obj function in an ifcheck that checks if it's the item type and if value0 has a value that is not 0.
Then in the remove obj function, just this should do.
sn = obj->value[0];
ch->pcdata->learned[sn] = 0;
Again, with the appropriate ifcheck.
The only problem would be that this way restricts the skills that can be learned from an obj to 1, unless you use more of the values. Then it'll be 6 max. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | top |
|
Posted by
| Mopop
(115 posts) bio
|
Date
| Reply #4 on Sun 27 Nov 2005 05:08 AM (UTC) |
Message
| "The only problem would be that this way restricts the skills that can be learned from an obj to 1, unless you use more of the values. Then it'll be 6 max"
Do you mean when they remove the materia it will be reverted to 1% skill learned?
Also I should note materia is inserted into an item, will the same effect still take hold, do I still use values to make sockets for materia to go into? i didnt realize what I was getting myself into! | top |
|
Posted by
| Zeno
USA (2,871 posts) bio
|
Date
| Reply #5 on Sun 27 Nov 2005 05:17 AM (UTC) |
Message
| No, I meant that only 1 skill would be able to be learned from an item.
Well I don't really know what you mean. I'm not sure how you are planning it. What objects are suppose to teach the skill? Any object that can be worn? Just materia? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | top |
|
Posted by
| Metsuro
USA (389 posts) bio
|
Date
| Reply #6 on Sun 27 Nov 2005 05:28 AM (UTC) |
Message
| Hes trying to make it like ff7, you place the materia in a worn item and you get a skill for it, once you remove it you lose the skill. and thats the only way you get skills from materias, like in ff7 expect for the steal materia i think |
Everything turns around in the end | top |
|
Posted by
| Mopop
(115 posts) bio
|
Date
| Reply #7 on Sun 27 Nov 2005 05:28 AM (UTC) |
Message
| I guess you never played FFVII ;-) Yes it is only suppose to be one skill per materia orb, and only materia will teach skills. Will prove to have some intresting charector customization when it comes in. | top |
|
Posted by
| Zeno
USA (2,871 posts) bio
|
Date
| Reply #8 on Sun 27 Nov 2005 05:30 AM (UTC) |
Message
| I've played it, I just wasn't sure if you were going to follow the game exactly or not. But even so, I still don't understand the question.
Also I should note materia is inserted into an item, will the same effect still take hold, do I still use values to make sockets for materia to go into? i didnt realize what I was getting myself into!
|
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | top |
|
Posted by
| Mopop
(115 posts) bio
|
Date
| Reply #9 on Sun 27 Nov 2005 05:35 AM (UTC) |
Message
| Yeah its inserted into an item. Like weapons and armor thats how it works. i was asking if the thing you provided as an example for the skill would still work because it isnt going to be equipped like a regular item. Then I was asking how would I go about adding the slots for the armor and weapon so players can insert the materia. Its going to be just like the game, AP and all. | top |
|
Posted by
| Zeno
USA (2,871 posts) bio
|
Date
| Reply #10 on Sun 27 Nov 2005 05:36 AM (UTC) |
Message
| Well... either you could make the skill learned when the materia is inserted into the item, or you'd have to do an ifcheck against all the materia in an item when it's worn. Although I have no idea how you're going to do the materia system; it'd have to be something more than just a variable in an object. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | top |
|
Posted by
| Mopop
(115 posts) bio
|
Date
| Reply #11 on Sun 27 Nov 2005 05:55 AM (UTC) |
Message
| Probably the skill learned when inserted. I really didnt think how else I could do it. I had a vague idea how to do it...its just the code, I dont know all the functions and what not yet. =P Ill be so happy to get my ass back in school. | top |
|
Posted by
| Zeno
USA (2,871 posts) bio
|
Date
| Reply #12 on Sun 27 Nov 2005 07:29 PM (UTC) |
Message
| Looks like someone asked about materia on TMC:
http://www.mudconnect.com/discuss2/discuss.cgi?mode=MSG&area=coders&message=23219#23219
In case you want some ideas. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | top |
|
Posted by
| Mopop
(115 posts) bio
|
Date
| Reply #13 on Sun 27 Nov 2005 09:57 PM (UTC) |
Message
| Yeah I saw that, It was in ROM so It just confused me more. I dont even know if thats how SMAUG works. | top |
|
Posted by
| Mopop
(115 posts) bio
|
Date
| Reply #14 on Tue 29 Nov 2005 04:08 AM (UTC) |
Message
| Actually as I planned materia more and more, I read his post and it doesnt really even help. Except for the using containers as an idea for the sockets to insert. Right now im wonder how to set the materia as to the skill or spell. I just learned about skill numbers so im assuming thats how it works. but how would i represent it as the materias v0? | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
40,480 views.
This is page 1, subject is 2 pages long: 1 2
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.