Angband.oook.cz
Angband.oook.cz
AboutDownloadVariantsLadderForumCompetitionSpoilersComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Variants

Reply
 
Thread Tools Display Modes
Old December 2, 2009, 09:27   #1
will_asher
DaJAngband Maintainer
 
will_asher's Avatar
 
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
inventory effect no-no, got to be a better way to do this.. (code stuff)

So there's this warning near the top of cmd6.c which reads:

* There may be a BIG problem with any effect that can cause changes
* to the inventory. For example, a "scroll of recharging" can cause
* a wand/staff to disappear, moving the inventory up. Luckily, the
* scrolls all appear BEFORE the staffs/wands, so this is not a problem.
* But, for example, a "staff of recharging" could cause MAJOR problems.
* In such a case, it will be best to either (1) "postpone" the effect
* until the end of the function, or (2) "change" the effect, say, into
* giving a staff "negative" charges, or "turning a staff into a stick".
* It seems as though a "rod of recharging" might in fact cause problems.
* The basic problem is that the act of recharging (and destroying) an
* item causes the inducer of that action to "move", causing "o_ptr" to
* no longer point at the correct item, with horrifying results.

I have transgressed and made an effect which can cause changes to the inventory (the staff of telekinesis), and of couse it causes problems.
There's got to be a way around this. I think it's kindof stupid that the object index changes based on where the object is.
Anyone care to help me find a workaround for this so I can keep the staff of telekinesis in the game? I don't care how hacky it is if it works.
I can't delay the effect until the end of do_cmd_use_staff() because then it would still use a charge if you didn't target anything.

..I just noticed it isn't only the staff of telekinesis, you can use the staff of mana-free spellcasting to cast recharging which can blow up something and mess things up that way too.

PS: whoever made these comments in the code used quotation marks WAY too often. Some of the usages of quotation marks in the comments are just rediculous as you can see from the quote above.
__________________
Will_Asher

Play DaJAngband:
http://sites.google.com/site/dajangbandwebsite/home
will_asher is offline   Reply With Quote
Old December 2, 2009, 10:51   #2
andrewdoull
Unangband maintainer
 
andrewdoull's Avatar
 
Join Date: Apr 2007
Location: Sydney, Australia
Age: 40
Posts: 871
andrewdoull is on a distinguished road
Quote:
Originally Posted by will_asher View Post
So there's this warning near the top of cmd6.c which reads:

* There may be a BIG problem with any effect that can cause changes
* to the inventory. For example, a "scroll of recharging" can cause
* a wand/staff to disappear, moving the inventory up. Luckily, the
* scrolls all appear BEFORE the staffs/wands, so this is not a problem.
* But, for example, a "staff of recharging" could cause MAJOR problems.
* In such a case, it will be best to either (1) "postpone" the effect
* until the end of the function, or (2) "change" the effect, say, into
* giving a staff "negative" charges, or "turning a staff into a stick".
* It seems as though a "rod of recharging" might in fact cause problems.
* The basic problem is that the act of recharging (and destroying) an
* item causes the inducer of that action to "move", causing "o_ptr" to
* no longer point at the correct item, with horrifying results.

I have transgressed and made an effect which can cause changes to the inventory (the staff of telekinesis), and of couse it causes problems.
There's got to be a way around this. I think it's kindof stupid that the object index changes based on where the object is.
Anyone care to help me find a workaround for this so I can keep the staff of telekinesis in the game? I don't care how hacky it is if it works.
I can't delay the effect until the end of do_cmd_use_staff() because then it would still use a charge if you didn't target anything.

..I just noticed it isn't only the staff of telekinesis, you can use the staff of mana-free spellcasting to cast recharging which can blow up something and mess things up that way too.

PS: whoever made these comments in the code used quotation marks WAY too often. Some of the usages of quotation marks in the comments are just rediculous as you can see from the quote above.
Hey - I fixed this in Unangband and blogged about it briefly. I mark the chosen item with a flag when selecting it, which I then use to find it later when I destroy it. Have a look at the Unangband cmd6.c - the flag is IDENT_BREAKS.

Andrew
__________________
The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
In UnAngband, the level dives you.
ASCII Dreams: http://roguelikedeveloper.blogspot.com
Unangband: http://unangband.blogspot.com
andrewdoull is offline   Reply With Quote
Old December 2, 2009, 14:40   #3
fizzix
Prophet
 
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 2,648
fizzix is on a distinguished road
Ah, that explains the weirdness of this effect. So telekinesis staff will decrease the charges of whatever is above if the item you get occurs before the staves. If the item is after the staves it works properly. I wonder what would happen if the staff is the only item with charges in your inventory?
fizzix is offline   Reply With Quote
Old December 2, 2009, 20:35   #4
will_asher
DaJAngband Maintainer
 
will_asher's Avatar
 
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
Thanks Andrew. I used your idea and got it to work correctly.

For now I'm only using the IDENT_BREAKS flag for using staffs. I might change it so it uses that for other objects later (like if I add a scroll of telekinesis).

The other issue with telekinesis is that it picks up items which are out of line of sight, and I think that's overpowered, but Fizzix says it would be pretty much useless if it restricted it to objects in line of sight. So I'm thinking I'll either 1) make the staff very rare and add a scroll of telekinsis also, so it'll usually be a one-use thing. or 2) limit it by distance or by line of sight so you have to get either in line of sight or within ten spaces of the object.
The thief and tourist both get telekinesis as a spell, but it's in the last dungeon book for the thief and the second to last useable book for the tourist.
__________________
Will_Asher

Play DaJAngband:
http://sites.google.com/site/dajangbandwebsite/home
will_asher is offline   Reply With Quote
Old December 2, 2009, 21:04   #5
PowerDiver
Prophet
 
Join Date: Mar 2008
Posts: 2,588
PowerDiver is on a distinguished road
Quote:
Originally Posted by will_asher View Post
The other issue with telekinesis is that it picks up items which are out of line of sight, and I think that's overpowered, but Fizzix says it would be pretty much useless if it restricted it to objects in line of sight.
If you like the idea, but think it is overpowered, you could weaken it by moving the item 1 square closer every 10 [or whatever] game turns. To avoid inventory issues, you could force the player to pick it up manually. I think V currently charges 1 game turn to pick things up, but I'm not sure, and I don't know what it was in 3.0 so you might want to look at that if you went for manual pickup.
PowerDiver is offline   Reply With Quote
Old December 2, 2009, 21:43   #6
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,008
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate Send a message via Skype™ to Magnate
Quote:
Originally Posted by will_asher View Post
The other issue with telekinesis is that it picks up items which are out of line of sight, and I think that's overpowered, but Fizzix says it would be pretty much useless if it restricted it to objects in line of sight.
I have to say I'm with Fizzix on this. Sang's "nab object" ability (a burglary-related talent) is essentially short-range tk, and only works on objects in LOS. It's a lovely idea but I can count the number of times I've ever used it on the fingers of one hand. It's a lot of coding effort for such a rarely-used thing.
Magnate is offline   Reply With Quote
Old December 2, 2009, 21:58   #7
Psi
Knight
 
Join Date: Apr 2007
Location: Surrey, UK
Age: 39
Posts: 821
Psi is on a distinguished road
Its a mage spell in FA (for objects in LoS) and I used it a lot when way out of my depth and unable to kill the monsters sitting on or around the object I want.
Psi is offline   Reply With Quote
Old December 2, 2009, 22:00   #8
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 6,042
Derakon is on a distinguished road
Last I checked (back in the 2.9.3 days, admittedly), Vanilla charged one turn to get any number of objects from the tile you are standing on. However, you can pick up items for free by using - to move onto the tile.

I say just limit the range to 8 tiles or so. Enough so that you have to actually go into the greater vault to get the items out of its center.
Derakon is offline   Reply With Quote
Old December 2, 2009, 23:04   #9
fizzix
Prophet
 
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 2,648
fizzix is on a distinguished road
Quote:
Originally Posted by Psi View Post
Its a mage spell in FA (for objects in LoS) and I used it a lot when way out of my depth and unable to kill the monsters sitting on or around the object I want.
In my current game, if I'm in LOS I'm already going to use my 0% fail TO rather than try to move an object.

Distance could work. I'd actually prefer it goes by path length, so you wouldn't be able to move stuff out of vaults without clearing the walls first. Something like 50-70 connected squares. That may be a hard coding problem though.

In my current game I just got the palantir, and I have 3 staves of Telekinesis. If I abuse both the distance issue I have a cheesy tactic of enlighting the level and then clearing out what I want.

I'm going to claim a lack of good gear and call it even.

Apparently I also abused the telekinesis anywhere bug several times during my comp win. In my defense, I didn't know it was a bug...
fizzix is offline   Reply With Quote
Old December 3, 2009, 00:48   #10
will_asher
DaJAngband Maintainer
 
will_asher's Avatar
 
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
Quote:
Originally Posted by fizzix View Post
In my current game I just got the palantir, and I have 3 staves of Telekinesis. If I abuse both the distance issue I have a cheesy tactic of enlighting the level and then clearing out what I want.
that's exactly why it's overpowered.

I think I finally have it working the way I want it to. Telekinesis requires the object to be in line of sight OR within max distance for the spell, which is usually 8 (but can be a little higher with good luck). If you have a full inventory, you can now use telekinesis to move the object to the space at your feet.
There's still one little annoying detail: I have a message to tell the player the max distance, but it gets replaced by the targetting prompt before the player has a chance to see it and I can't figure out how to add a -more- so that the player will have a chance to read the message.
EDIT: I figured out how to do this with inkey() so no problems now.
__________________
Will_Asher

Play DaJAngband:
http://sites.google.com/site/dajangbandwebsite/home

Last edited by will_asher; December 3, 2009 at 02:46.
will_asher is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about scrolls effect duration Kyle Vanilla 1 July 25, 2009 00:44
Which Band has the most stuff? Larvitz Vanilla 5 January 24, 2009 18:43
Protect my stuff bpleshek Vanilla 12 October 13, 2008 18:48
Spell effect ideas that should be in some variant Jude Variants 7 July 13, 2008 17:57
Area of Effect kandrc Vanilla 16 January 19, 2008 13:27


All times are GMT +1. The time now is 12:43.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.