Page 3 of 3

Re: My Own Little Mod for Exult.

Posted: Thu Feb 02, 2006 2:15 pm
by marzo
You can replace the offset arrays with (say) the following:

var offset_X = [0, 1, -1];
var offset_Y = [0, 1, -1];

As for the guard 'patrols'; you could do it with timers... even a single timer would be enough if you use static variables (take a look at how I did the Lock Lake cleanup). The timer would be used to ensure that the required number of hours would have passed for each egg; you could add further checking by use of UI_game_hour to (say) make sure that the current time is a multiple of 3.

Re: My Own Little Mod for Exult.

Posted: Thu Feb 02, 2006 2:25 pm
by Wizardry Dragon
Ok, so the final bit is to make the gargoyles and guards fight, remember this script?

eggBeginCombat 0xd00 ()
{
if (event == 3)
//egg event; call this function again with a time delay.
//Also, use a different event id to differentiate.
script item after 10 ticks call eggBeginCombat, 2;

else if (event == 2) //scripted event
{
const int distance = 30;
const int mask = 4; //NPCs
const int any_shape = -359;

//Get a list with the party members:
var party = UI_get_party_list();

//Find all NPCs at a distance find_nearby
var nearby_npcs = find_nearby(any_shape, distance, mask);

//Loop variables:
var index;
var max;
var npc;

for (npc in nearby_npcs with index to max)
{
if (!(npc in party))
{
//NPC is not in party.
//Get NPC's alignment:
var align = npc->get_alignment();

if (align == 0 || align == 2)
{
//Ignore neutral NPCs.
//Set NPC to attack nearest foe:
npc->set_attack_mode(0);
//Put NPC in 'combat' schedule:
npc->set_schedule_type(0);
}
}
}
}
}



It compiles, it just doesn't seem to work, the gargoyles still barrel right for me, oblivious to the much more threatening guards beside me.

Also, I want to make the guards into usecode eggs for my script, but I need to know how I can attach equipment profiles to them, if thats even possible.

~ Wizardry Dragon

Re: My Own Little Mod for Exult.

Posted: Thu Feb 02, 2006 2:36 pm
by marzo
When the changes I just commited become available, you will be able to use UI_create_new_object2 to create a monster with equipment; right now, you'd have to add the equipment 'manually' (as in, via usecode).

Right, I had forgotten about it. Try replacing the end with this:

//Loop variables:
var index;
var max;
var npc;

var friend_list = [];
var enemy_list = [];

for (npc in nearby_npcs with index to max)
{
if (!(npc in party))
{
//NPC is not in party.
//Get NPC's alignment:
var align = npc->get_alignment();

if (align == 0) || align == 2)
{
//Ignore neutral NPCs.
//Set NPC to attack nearest foe:
npc->set_attack_mode(0);
//Put NPC in 'combat' schedule:
npc->set_schedule_type(0);
if (align == 0)
friend_list = [friend_list, npc];
else
enemy_list = [friend_list, npc];
}
}
}

//How many friendly NPCs are there:
var count = UI_get_array_size(friend_list);
for (npc in enemy_list with index to max)
//Make hostiles attack friendly:
npc->set_opponent(UI_get_random(count));
}
}

Re: My Own Little Mod for Exult.

Posted: Thu Feb 02, 2006 2:42 pm
by Wizardry Dragon
Gives a parse error, and I don't see any easy mistakes like forgotten semi-colons.


// this causes guards to fight with gargoyles
eggBeginCombat 0xd00 ()
{
if (event == 3)
//egg event; call this function again with a time delay.
//Also, use a different event id to differentiate.
script item after 10 ticks call eggBeginCombat, 2;

else if (event == 2) //scripted event
{
const int distance = 30;
const int mask = 4; //NPCs
const int any_shape = -359;

//Get a list with the party members:
var party = UI_get_party_list();

//Find all NPCs at a distance find_nearby
var nearby_npcs = find_nearby(any_shape, distance, mask);

//Loop variables:
var index;
var max;
var npc;

var friend_list = [];
var enemy_list = [];

for (npc in nearby_npcs with index to max)
{
if (!(npc in party))
{
//NPC is not in party.
//Get NPC's alignment:
var align = npc->get_alignment();

if (align == 0) || align == 2)
{
//Ignore neutral NPCs.
//Set NPC to attack nearest foe:
npc->set_attack_mode(0);
//Put NPC in 'combat' schedule:
npc->set_schedule_type(0);

if (align == 0)
{
friend_list = [friend_list, npc];
}
}
else
{
enemy_list = [friend_list, npc];
}
}
}
}
}

Gives:
npcs/gargoyles.uc:48: parse error

~ Wizardry Dragon

Re: My Own Little Mod for Exult.

Posted: Thu Feb 02, 2006 2:58 pm
by marzo
The copy/paste introduced quite a few errors ;-)

Below the line 'friend_list = [friend_list, npc];', there are two '}'; move one of them below the line 'enemy_list = [friend_list, npc];'

Also, the copy/paste deleted the following lines:

//How many friendly NPCs are there:
var count = UI_get_array_size(friend_list);
for (npc in enemy_list with index to max)
//Make hostiles attack friendly:
npc->set_opponent(UI_get_random(count));

Re: My Own Little Mod for Exult.

Posted: Thu Feb 02, 2006 3:00 pm
by Wizardry Dragon
Could you maybe post the whole script so I don't copy and past very well? xD

As well, I now have a forum here: http://lfs.lfhost.com/tfl_forum/index.php

Maybe you guys (being Marzo and Crysta, as well as anyone else interested) could sign up there and discuss this kind of thing there so we don't hog Exult's forum? ^_~

~ Wizardry Dragon

Re: My Own Little Mod for Exult.

Posted: Thu Feb 02, 2006 3:10 pm
by marzo
Sure. I've posted the script in your forum.

Re: My Own Little Mod for Exult.

Posted: Thu Feb 02, 2006 3:12 pm
by Wizardry Dragon
Thankee ^_^

I think from now on, this thread can just be used to get some feedback, post screenshots, etc. For us, Marzo and Crysta, just keep an eye on that forum (dont imagine it'll become too active) for anything I might need/the next time I bork my usecode ^_~

(Hey, don't suppose Exult would link me? :D )

~ Wizardry Dragon

Re: My Own Little Mod for Exult.

Posted: Thu Feb 02, 2006 3:29 pm
by Dominus
It'd be usefull for the exult forum to have subforums for the modding stuff. And a tag to conserve code here.

Re: My Own Little Mod for Exult.

Posted: Sat Feb 04, 2006 5:45 am
by Vistaer
Oh... my... god...

Sir. You have SHOCKED me, and I am DYING to play your mod!

:D

Re: My Own Little Mod for Exult.

Posted: Sat Feb 04, 2006 11:13 am
by Wizardry Dragon
^__________^

Comments like that are what keeps me going when the going gets tough.

~ Wizardry Dragon

Re: My Own Little Mod for Exult.

Posted: Sun Feb 05, 2006 3:52 am
by Petrell
Wizardry Dragon, what exactly is small in your mod? :P ;)

Re: My Own Little Mod for Exult.

Posted: Sun Feb 05, 2006 8:27 am
by Wizardry Dragon
Spark.

~ Wizardry Dragon

Re: My Own Little Mod for Exult.

Posted: Sun Feb 05, 2006 2:11 pm
by Wizardry Dragon
So, I'm going to start releasing snapshots, at hopefully a semi-regular interval.

You can find the latest here:

http://www.lfs.lfhost.com/tfl_forum/viewtopic.php?t=15

Hardly complete; hardly started, really, but it gives you a chance to poke around. Right now, changes include a recoded conversation fro Iolo, Dupre, Shamino, and Jaana, and if you teleport to Skeptran and then change to Map 002, you can check out the Feudal Lands, what little Ive done thusfar.

I'll cross-post future snapshots in this thread if the forum mods don't mind, for those interested.

~ Wizardry Dragon

Re: My Own Little Mod for Exult.

Posted: Sun Feb 05, 2006 3:47 pm
by Dominus
I'll cross-post future snapshots in this thread if the forum mods don't mind, for those interested.
How could we be against this? :)
Go ahead, Marzo's and your mods are the most interesting things that happen atm with Exult.

Re: My Own Little Mod for Exult.

Posted: Sun Feb 05, 2006 3:53 pm
by Wizardry Dragon
Feel free to try the snapshots and post comments/suggestions ^_~

~ Wizardry Dragon

Re: My Own Little Mod for Exult.

Posted: Sun Feb 05, 2006 10:14 pm
by octopusfluff
Back when Exult Studio was still a new thang and things like multi-maps not conceived of yet, I had hoped to do a 'remake' of Ultima4. I've since found I totally lack the time for such a venture, and look forward to seeing the results here.
It may not be what I envisioned, but hey, this looks like it'll be plenty of awesome. :)

Re: My Own Little Mod for Exult.

Posted: Mon Feb 06, 2006 3:01 am
by Vasculio294
Cool album Crysta!

Re: My Own Little Mod for Exult.

Posted: Mon Feb 06, 2006 11:52 am
by Wizardry Dragon
Octupusfluff - its more of u3 meets u4 meets u5 than a straight u4 remake. It will push the boundaries of Exult's capabilities in a lot of regards ^_^

~ Wizardry Dragon

Re: My Own Little Mod for Exult.

Posted: Mon Feb 06, 2006 12:06 pm
by wjp