ID:150971
Jun 19 2001, 6:21 am
|
|
ok yeah yeah.. its ture i have been here fr a long time but have done little codeing and havent really read anything.. just sorta reading others code and trying to pick stuff up.. but i got this code that wont work.. Gun icon = 'lazer.dmi' density = 0 opacity = 0 verb/target(mob/M) usr.targat = M verb/shoot() if(prob(FLAME_DAMAGE_PROB)) targat.Damage(2, "shot by [usr]", 1) you see... i dont know what to put to make shoot damage your targat (spelled wrong becase i already have a few differant target vars..) if i put usr.targat in the () it wont work... hrrrmmm |
Jun 19 2001, 6:27 am
|
|
Try changing both instances of usr in that code snippet to src instead.
|
In response to Shadowdarke
|
|
On 6/19/01 9:27 am Shadowdarke wrote:
Try changing both instances of usr in that code snippet to src instead. that wont work.. i still cant make it damage the targat.. after i get this working im going to need to ask about micors... |
I assume you already have a proc in place for PCs called Damage(). If the error is that it claims it is a bad proc, try changing the call to targat:Damage(2, "shot by [usr]", 1) -- notice the colin replacing the period. This asks the compiler to be lenient on whether Damage() is an available proc. With the period, it makes sure that every possible value for targat has the proc defined in it. With the colin, it only makes sure that at least one possible value (defined mob) has that proc.
The other option would be to define that proc as doing nothing at the top level of mob: mob/proc/Damage() Hope this helps /mob/skysaw On 6/19/01 9:21 am jobe wrote: ok yeah yeah.. its ture i have been here fr a long time but have done little codeing and havent really read anything.. just sorta reading others code and trying to pick stuff up.. but i got this code that wont work.. |
In response to Skysaw
|
|
On 6/19/01 9:30 am Skysaw wrote:
I assume you already have a proc in place for PCs called Damage(). If the error is that it claims it is a bad proc, try changing the call to targat:Damage(2, "shot by [usr]", 1) -- notice the colin replacing the period. This asks the compiler to be lenient on whether Damage() is an available proc. With the period, it makes sure that every possible value for targat has the proc defined in it. With the colin, it only makes sure that at least one possible value (defined mob) has that proc. mob/proc/Damage() Hope this helpswell i think the problem is that it dosent know what targat is supposed to be.. targat is a var of the usr and i dont think i could put usr.targat.damage hrrrrmmmm... |
In response to jobe
|
|
On 6/19/01 9:37 am jobe wrote:
well i think the problem is that it dosent know what targat is supposed to be.. targat is a var of the usr and i dont think i could put usr.targat.damage hrrrrmmmm... You can use usr.targat.Damage(). Does the targat belong to the gun, or the mob using the gun? (I thought you were working on your sentinel guns, that's why I suggested src, meaning the gun, instead of usr.) |
ok here is a bit that works but dose not do what i want it to do... verb/shoot(mob/T) if(prob(FLAME_DAMAGE_PROB)) T.Damage(2, "shot by [usr]", 1) what i want it to do is shoot only the targat of the usr..... so you dont have to chosse who you shoot every time.. oh yeah.. if you targat a mob/critter/alien then will you shoot all the aliens you see? or will you shoot only that one instance of the alien? |
In response to Shadowdarke
|
|
On 6/19/01 9:42 am Shadowdarke wrote:
On 6/19/01 9:37 am jobe wrote: no sentinal guns are next but first i need a working modle of a player gun.. ill try doing usr.targat.Damage [edit] nope.. it says usr.targat.Damage is a bad proc here is the code im trying out now.. Gun icon = 'lazer.dmi' density = 0 opacity = 0 verb/target(mob/M) usr.targat = M verb/shoot() if(prob(FLAME_DAMAGE_PROB)) usr.targat.Damage(2, "shot by [usr]", 1) |
In response to jobe
|
|
On 6/19/01 9:43 am jobe wrote:
oh yeah.. if you targat a mob/critter/alien then will you shoot all the aliens you see? or will you shoot only that one instance of the alien? Just that instance of the alien. You could store a mob type for filtering the mobs in view through in your target acquisition proc. |
In response to Shadowdarke
|
|
On 6/19/01 9:46 am Shadowdarke wrote:
On 6/19/01 9:43 am jobe wrote: well thats what i wanted.. only one instance of the alien.. in this way you have to stop just long enof to target the next alien... bubye...lol |