Hi, it's been a while (study abroad & school), but I was wondering if there was a way to add weapons to a class that normally doesn't have them. For example, if I have a class that enters a shop of weapons, they would normally not be able to use guns, but then if they went to the firing range coach, he could (for a small fee) teach various firearms. I think I somehow missed the option in eventing, unless it takes a script.
Apologies if this is misplaced, I've been away for a while.
I don't believe there is an event for something like this. What you could do is allow the player to use firearms from the start and prevent the player from buying them through the shop event, i.e. make the shopkeeper tell the hero that he must receive special training or something before he can buy them. On page two of the event, check and see if a variable (CanUseGuns or whatever) is greater than some value of your choice (we'll assume that 0 is off and 1 is on), and go from there. Innately, CanUseGuns is equal to 0; after going to the trainer, you can simply set CanUseGuns to 1. Bam, now you can buy guns.
... That's what I would do, anyway. I'm sure someone has a better method somewhere, but hey. Anywho, back to WoW.
The problem with that is, though, if someone else has firearm proficiency, they would need guns too, yes? So they would be able to be switched to the hero... Also, gun might be a chest or random drop item...
I would suggest switching classes (only because I am an eventer, not a scripter...) to something will all your original weps, and also a gun. Of course, this would likely cause problems if you want there to be a range of trainers that different chars can visit...
This game is a largely one actor game during the scenes where this takes place, and they are the only character that will have this class, but I see your point.
I did a
script: p $data_classes[1].weapon_set
and that told me a list of numbers in a set, such as [1,5], which match up with the weapons selected in a list, like weapon 1 might be bronze sword and weapon 5 might be bronze spear.
But when i tried something like
p $data_classes[1].weapon_set[5]
I got some screwy numbers, sometimes nil. I tried setting different weapons in the main, but I don't understand what the weapon_set[number] command is doing.
Weapon_Set is an array. The number is corresponding to the unit which is that number in that array.
For example: array = [1, 2, 3, "Rabbit", 5]
array[0] would return 1, array[1] would return 2, array[3] would return the string "Rabbit", and array[5] would return nil, since there are only 5 values in the array (computers start counting from 0).
Quote from: Ness on October 22, 2010, 11:23:50 PM
Weapon_Set is an array. The number is corresponding to the unit which is that number in that array.
For example: array = [1, 2, 3, "Rabbit", 5]
array[0] would return 1, array[1] would return 2, array[3] would return the string "Rabbit", and array[5] would return nil, since there are only 5 values in the array (computers start counting from 0).
aww crud, you beat me too it. I just figured that out 90 seconds ago :(
but do you know how to append that array, by adding something to it?
Use .push
array = [1, 2]
array.push(3)
The array would now be [1, 2, 3]
worked like a charm. ^^