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 =)
Learning skills from objects, and other confusions!
Posted by Mopop on Sun 27 Nov 2005 04:20 AM — 18 posts, 64,757 views.
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.
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.
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.
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:
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.
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.
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.
"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!
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!
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?
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?
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
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.
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!
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!
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.
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.
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.
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.
http://www.mudconnect.com/discuss2/discuss.cgi?mode=MSG&area=coders&message=23219#23219
In case you want some ideas.
Yeah I saw that, It was in ROM so It just confused me more. I dont even know if thats how SMAUG works.
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?
Actually that post helps a lot. It doesn't matter if it's for Rom, that code he posted will still work fine. And so will the ideas. The only thing that won't work is that "obj_table" stuff I think.
This is a VERY cool idea, I like it quite a bit. I am no coder... I'm just trying to learn.. slowly. But this is what I DO know:
It is possible to 'imbue' objets with spells. When the player is wearing the object they are affected by that spell. Since the spell/skill system in smaug is basically all one entity, I don't see why wearing an object couldn't activate a skill also.
On the mud I frequent we have spells that do things such as affect dodge by 30 . This adds 30% to your current dodge proficiency, and I believe 'gives' you dodge even if it is not on your slist.
I think the problem you will run into doing it this way is going to be with the proficiency levels. If you want the skill to 'go away' when they remove the 'materia', I don't think it will be possible to let them 'learn' the skill any farther than what the original materia gives them. For instance: if equipping the materia gives 30% dodge, I don't think the proficiency could go up with use without some detailed code changes.
Maybe you could set it up so that people could 'buy' enhancements to armor and weapons. For instance create some sort of point system that they could use in a specific shop to add spells named 'materia'. It would cost you X amount to add Y percent to Z skill. If they chose to remove this skill, you could refund the points.
I'm rambling now.. hehe
It is possible to 'imbue' objets with spells. When the player is wearing the object they are affected by that spell. Since the spell/skill system in smaug is basically all one entity, I don't see why wearing an object couldn't activate a skill also.
On the mud I frequent we have spells that do things such as affect dodge by 30 . This adds 30% to your current dodge proficiency, and I believe 'gives' you dodge even if it is not on your slist.
I think the problem you will run into doing it this way is going to be with the proficiency levels. If you want the skill to 'go away' when they remove the 'materia', I don't think it will be possible to let them 'learn' the skill any farther than what the original materia gives them. For instance: if equipping the materia gives 30% dodge, I don't think the proficiency could go up with use without some detailed code changes.
Maybe you could set it up so that people could 'buy' enhancements to armor and weapons. For instance create some sort of point system that they could use in a specific shop to add spells named 'materia'. It would cost you X amount to add Y percent to Z skill. If they chose to remove this skill, you could refund the points.
I'm rambling now.. hehe
Well I was trying to keep it true to the game -.- Right now I sorta cancelled that project but you can set the skills according to how you want. In the future I may pick up on this series again but right now it was alittle beyond my skill so im just gonna step away slowly.