Jump to content


Photo

Area script


  • Please log in to reply
29 replies to this topic

#1 Nastian

Nastian
  • Member
  • 280 posts

Posted 25 June 2005 - 09:08 AM

I want to add a creature to area, but there's no AI script... how can I do it?

#2 Lord-Jyssev

Lord-Jyssev

    L¤J

  • Member
  • 451 posts

Posted 25 June 2005 - 09:19 AM

hmmm you could do it in dltcep...

#3 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 25 June 2005 - 09:30 AM

You mean the area doesn't have a script that you can add the creature spawn? If so, then:

COPY_EXISTING ~arXXXX.are~ ~override~ // the area file
  WRITE_ASCII 0x94 ~arXXXX~ // the name of the new area script
  BUT_ONLY_IF_IT_CHANGES

Areas are stored in save games, so you'll need to have a new game or a game where you haven't visited the area yet to see the effects of the new script.

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#4 Nastian

Nastian
  • Member
  • 280 posts

Posted 25 June 2005 - 10:05 AM

Thanks. B)

Edit: Anyone knows what is the number of Irenicus' sound file - "Quiet, dog!" (or something like that)?

Edited by Laguna, 25 June 2005 - 10:45 AM.


#5 Nastian

Nastian
  • Member
  • 280 posts

Posted 26 June 2005 - 03:09 AM

Oh, great and wise modders... I have other simple question. :^^:

How can I remove creature marked as "SKELDED.CRE" from AR0602... pernamently? :)

#6 jastey

jastey
  • Administrator
  • 3219 posts

Posted 26 June 2005 - 03:23 AM

How can I remove creature marked as "SKELDED.CRE" from AR0602... pernamently?

View Post


ActionOverride("creaturename",DestroySelf())
I am not sure what the deathvariable of the "SKELDED.CRE" is, though.


What exactly does " BUT_ONLY_IF_IT_CHANGES"? Is this to make sure no already existing area script will be overwritten?

#7 Nastian

Nastian
  • Member
  • 280 posts

Posted 26 June 2005 - 03:28 AM

What exactly does " BUT_ONLY_IF_IT_CHANGES"? Is this to make sure no already existing area script will be overwritten?


From WeiDU ReadMe:
"True only if the file is actually changed by patching actions. Unlike all other when clauses, this one is evaluated just before the result would be written out to the disk."

#8 jastey

jastey
  • Administrator
  • 3219 posts

Posted 26 June 2005 - 04:39 AM

That means it would override another already existing different area script name? No way of checking whether there is one already?

#9 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 26 June 2005 - 05:33 AM

The convention for area scripts is that they use the same name as the area, i.e. ar1000.are uses ar1000.bcs. If a mod uses something else it's really the modder's fault for causing incompatibilities. You could check and confirm that either the area script is correct or set to none, but it adds a lot of overhead for no gain.

BUT_ONLY_IF_IT_CHANGES is there out of habit. :)

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#10 jastey

jastey
  • Administrator
  • 3219 posts

Posted 26 June 2005 - 06:17 AM

True, I only had problems to understand the BUT_ONLY_IF_IT_CHANGES command. I think I got it now, thank you! :)

#11 -Guest-

-Guest-
  • Guest

Posted 27 June 2005 - 10:33 AM

If you want the SKELDED's to never appear in the game at all it is possible that an area script will cause the SKELDED's to appear for a second before disappearing if you use scripting to remove them.

It is also possible to remove a creature from an area using WeiDU patching. If the creature is listed in the .are file you can find out the offsets and DELETE BYTES which will remove the creature that way. Don't forget to modify the offsets that occur after the creature to take account of the bytes you deleted tho. In fact you may be able to simply wipe the bytes clean, but I'm sure some ubermodder will tell me that will corrupt the area or something :)

If you just want them to disappear mid game (quest related or something), then yeah, script away.

The_Swordalizer

#12 -Bons-

-Bons-
  • Guest

Posted 27 June 2005 - 11:44 AM

Edit: Anyone knows what is the number of Irenicus' sound file - "Quiet, dog!" (or something like that)?

View Post


DBJON154

#13 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 27 June 2005 - 12:09 PM

It is also possible to remove a creature from an area using WeiDU patching. If the creature is listed in the .are file you can find out the offsets and DELETE BYTES which will remove the creature that way. Don't forget to modify the offsets that occur after the creature to take account of the bytes you deleted tho. In fact you may be able to simply wipe the bytes clean, but I'm sure some ubermodder will tell me that will corrupt the area or something :)

View Post

You could delete, but it would probably be easier to just set the creature to have no appearance times.

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#14 jcompton

jcompton
  • Modder
  • 492 posts

Posted 27 June 2005 - 01:01 PM

Another way to address this problem, since requiring players to start a new game in order to see mod content isn't always popular, is to place the spawn code in a script that will run, then immediately move the resulting CRE to the proper area. We use this trick to get Keto into the Five Flagons (which doesn't have an area script in its non-stronghold state.) We spawn her in the Bridge District script, then immediately bounce her into the bar. Players don't notice.

Edited by jcompton, 27 June 2005 - 01:01 PM.


#15 -Guest-

-Guest-
  • Guest

Posted 28 June 2005 - 12:11 AM

@CamDawg - Yeah. That'd work too. And be hell of a lot less work. :)

Gosh-darn low-down no-good uber modders!! :D

#16 Nastian

Nastian
  • Member
  • 280 posts

Posted 29 June 2005 - 04:48 AM

Thanks. If you wanna why I asked about it check this demo (it's really twice beta version).

Edited by Nastian, 15 September 2009 - 11:39 PM.


#17 Nastian

Nastian
  • Member
  • 280 posts

Posted 02 July 2005 - 07:45 AM

The script was added to AR1203 (Firkraag's lair).

That's what I put in it:

IF
	Global("Dragonslayers","GLOBAL",0)
        Dead("firkra02")
THEN
	RESPONSE #100
  SetGlobal("Dragonslayers","GLOBAL",1)
  CreateCreature("Slayer1",[968.946],13)
  CreateCreature("Slayer2",[898.945],13)
  CreateCreature("Slayer3",[876.1005],13)
END

But the game crash when Firkraag is killed. Something amiss, but what? :blink:

Edited by Laguna, 02 July 2005 - 07:46 AM.


#18 Deathsangel

Deathsangel

    Living on Wings of Dreams

  • Modder
  • 3089 posts

Posted 02 July 2005 - 07:57 AM

Example for Kido:
IF
 Global("KidoExists","AR0510",0)
THEN
 RESPONSE #100
 SetGlobal("KidoExists","AR0510",1)
 CreateCreature("Kido",[757.924],13)
END

You have no area coded, so the game chrashes as it doesn't know where to put the creatures

Still modding the Mod for the Wicked... It is a big project you know... And I got sidetracked (several times) a bit... sorry.
However, as we all know, Evil never really sleeps.


Sentences marking (my) life:

Winds of change... Endure them, and in Enduring grow Stronger
It takes a fool to look for logic in a man's heart
Never question the sanity of the insane
The Harmony of Life is Chaos
Living on Wings of Dreams



(1st march 2009) SHS women over me:
Kat: if there were more guys that looked like you out here, people's offspring wouldnt be so damn ugly
Noctalys: you are adorable :P

~~ I love it, and I am humbled! Yay! ~~


#19 hlidskialf

hlidskialf

    Incarnation of the Eternal Ale Warrior

  • Modder
  • 2510 posts

Posted 02 July 2005 - 08:23 AM

Actually area globals are no different than regular Global or Local triggers. What's most likely the problem is a bad cre file. Try CLUAConsoling them in one at a time. If they appear and work fine, then you know it's something else.

Edit: For understanding variables try this section of IESDP.

The great wolf Fenrir gapes ever at the dwelling of the gods.


#20 Nastian

Nastian
  • Member
  • 280 posts

Posted 02 July 2005 - 08:34 AM

Try CLUAConsoling them in one at a time.

View Post


Yep. Slayer2 crashed the game. I do not know why yet. He appers to be fine. If anybody could only look at his cre file...

Edited by Nastian, 15 September 2009 - 11:40 PM.