Magic Questions

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Exar Kun
Novice Poster
Posts: 42
Joined: Wed Apr 19, 2006 12:29 pm

Magic Questions

Post by Exar Kun »

Hey guys, I'm ripping into magic for the first time. I've been back and forth through the package and thought I "understood" most of what's going on.

My problem is this - what fires before the spells do?

In game, I try to cast Magic Arrow. The spell appears in spells.cfg with the correct spell ID, and I have a magic arrow spell listed in my package.

When I try to cast in game, the power words appear over my head, reagents are spent and I get the smoke puff, but the actual magic arrow program does not run. I know because I stuck a print statement in the first line.

I would have expected the program would run and perform all the appropriate skill checks, but obviously I'm mistaken. Anyone help?

Thanks.
User avatar
Tritan
Grandmaster Poster
Posts: 147
Joined: Sat Feb 04, 2006 8:17 am

Post by Tritan »

I checked this and got everything to print on my scripts with no problem. I did not think anything else was called first for the spells.

You did not change anything in your magic package lately have you?
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

POL 095 or 096?
Exar Kun
Novice Poster
Posts: 42
Joined: Wed Apr 19, 2006 12:29 pm

Post by Exar Kun »

POL095

I changed CheckSkill radically. I confirmed the spells.cfg was okay because I changed the words of power from In Por Ylem to In Your Face and it worked.

If I put a print statement as the first line of the spell and it doesn't print, but I still go through the animation, say the words of power, and fizzle....then I can only assume that something DOES indeed run before the spell script is actually run.

I just can't seem to find it.
Exar Kun
Novice Poster
Posts: 42
Joined: Wed Apr 19, 2006 12:29 pm

Post by Exar Kun »

Okay, maybe a better question is: what gets called when you d-click the spell icons in the client?
Exar Kun
Novice Poster
Posts: 42
Joined: Wed Apr 19, 2006 12:29 pm

Post by Exar Kun »

I just put a print statment inside every single function in my magic.inc. Nothing.

Maybe somehow it's running something in the npc scripts?
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

In POL095 a lot of stuff happens BEFORE your script is run.

Hmm..... maybe check out the 096 core-changes txt file. I think it has a list of all the things you have to do manually now.... by implication, the list of things is what the core does in 095.

Note: even if you set the skill to 0 in the cfg file you can still fail the core skillchecks if your skill is below 19. (I had this problem when I tried to make half the spellbook use a different skill attributeid.
Exar Kun
Novice Poster
Posts: 42
Joined: Wed Apr 19, 2006 12:29 pm

Post by Exar Kun »

Thanks man. That's the best lead I've had yet. I KNEW something was getting called before my script.

I just can't believe no one knows what it is. Magic must be something that no one messes with. I bet there's a reason for that.
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

No-one messes with it? Had to laugh when I read that.

One sure way to mess with magic more than you ever really wanted, is to get 096 to behave exactly the same way as 095.

Every time I read someone having problems with the 096 spellbook showing 64 copies of the same spell I just know they are on a path to magic understanding :) Things that appear in the core-changes suddenly make sense AFTER you have the problems. At least that's the way I seem to function.

As for 095 magic, your script won't even run if you fizzle and no amount of checking the path and sript in the cfg file will change that. You can script a few things by zeroing out the skillcheck, reagents and delays etc from the cfg files, but in the end you will want 096 because of things like the pre-casting delay as opposed to the delay after saying the magic words etc.
Exar Kun
Novice Poster
Posts: 42
Joined: Wed Apr 19, 2006 12:29 pm

Post by Exar Kun »

I've heard that to craft in 096, you're required to define the realm for the crafter, the item, the material, etc etc....I don't want to switch to a system to requires you to use a "feature" that I don't want to use. If I'm wrong, that'd be great, otherwise, I've got so many custom craftables and materials I don't want the headache.

Also, I don't understand packet hooking. I'm not sure I CAN understand it.

I have a script in hand for a staff that listens for Words of Power. I'm going to use that and do away with the spell book. Players will have to macro the Words of Power. I've considered making all spells dot commands anyway, and allowing players to macro in their own words of power or choose to cast silently.

I've done a couple interfaces in VB, and I've even thought of distributing a windows "spell book" for those who want to play mages. I put together a English-to-Drow translator that sends the translations to the client with a carriage return (i suppose how HOD works).

I'm not even going to try to mess with this if something between the client and the core can cause so much havoc, but thanks for all the help. Again, I haven't seen anyone with as much knowledge in this area as you.

*bows to the wisdom of OldnGrey*
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

You are wrong Exar Kun. If you dont want to use more than one map then you dont have to define realms at all. But the instant you want to use more maps, a huge conversion of your scripts would be required to support the other maps. As long as you stick to 1 map and in UO.EM, the constant DEFAULT_REALM is set to your map name you're using in the Realms folder, you'll be fine never putting in the realm parameter.

Packethooks are a bit difficult because you can crash the client if you write them wrong but they are nice with a little learning.

If you actually still decide to use spellbooks, you can fix the 64 of the same spell part by changing the itemdesc.cfg entry of the spellbook from Container to Spellbook.
User avatar
Tritan
Grandmaster Poster
Posts: 147
Joined: Sat Feb 04, 2006 8:17 am

Post by Tritan »

Don't you still have to define the realm at the time of creation though to pass to the core?

From what I have read in the POL096 scripts that is how this is getting done. I have avoided upgrading fully to 96 for that very reason, amoung some others that I will not get into here right now.
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

You won't have any realm problems if you decide to stay in Britannia.

Take a look at all the functions that take realms as a paramter. As OWO says, all you need to do it make sure the default realm is where you want to live and off you go.

Of course there are lots of little issues to deal with, but you can even make britannia_alt your default realm so that v4 clients behave the same way as v2 clients for pushthrough.

Sorry, we were talking about magic...... I too have long thought of the advantages of using a different spell book. The only thing that stops me is the player convenience of those draggable gumps / icons for quickcasting the spells.

A control script that runs on a mage staff is a nice way to monitor for a player speaking the power words though.
Exar Kun
Novice Poster
Posts: 42
Joined: Wed Apr 19, 2006 12:29 pm

Post by Exar Kun »

*LOL* guys.

Thanks for all the help. Dot commands aren't bad either, especially with a player interface. Of course, with a lot of spells comes a lot of buttons which makes for a crowded window. We'll see...
Post Reply