Creature Script Vs. Area Script
#1
Posted 13 November 2006 - 05:40 AM
I have tried:
DestroyItem("HOLDRING")
ActionOverride(MYSELF,"HOLDRING")
TakeItemReplace("HOLDRING","RING09",MYSELF)
An I have also tried using the creatures death variable in place of MYSELF.
If the creature is frozen still by holdring, will it NOT execute it's own script? I want to toss these treants in several wooded areas and do not want to write different scripts.
LugNut
#2
Posted 13 November 2006 - 05:56 AM
IF HasItem("HOLDRING",Myself) // <Invalid Strref -1> THEN RESPONSE #100 DestroyItem("HOLDRING") // <Invalid Strref -1> Continue() END
Retired from modding.
#3
Posted 13 November 2006 - 06:09 AM
IF
See(PLAYER1)
Global("TreeAttack","LOCALS",0)
THEN
RESPONSE #100
SetGlobal("TreeAttack","LOCALS",1)
DestroyItem("HOLDRING")
Wait(4)
Enemy()
Attack(PLAYER1)
END
I use a similar script to get some statues to come alive in another area. However, I have to use the area script to do an ActionOverride on those creatures in order to lose the ring. I would like to avoid that line of code when doing these guys.
Lug
#4
Posted 13 November 2006 - 07:05 AM
Edited by GeN1e, 13 November 2006 - 07:11 AM.
Retired from modding.
#5
Posted 13 November 2006 - 08:23 AM
In that case yes, use area script instead; or you could use another creature's script.
#6
Posted 13 November 2006 - 08:45 AM
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.
#7
Posted 13 November 2006 - 10:29 AM
If I remember the first level of Watcher's Keep correctly, there is a similar script to what I used for my statues, and it is all ActionOverride to get the "HOLDRING" out of the inventory.
The problem with using an Area script is, how to I trigger the proximity? With the Creature Script, I can use "See([PC])" whereas with the BCS I immagine I would need a trap or trigger to activate it. And since the creature script is not working, I can't use the creature to set the variable.
Any suggestions?
Lug
#8
Posted 13 November 2006 - 10:50 AM
#9
Posted 14 November 2006 - 06:09 AM
If you are in the dryad area of Irenicus'd dungeon you could add variables?
If you kill any of the dryads the tree could come to life via area script.
Or if you talk to any of the dryads... or if you come within range.
You could also use the undetectable trap that summons the golemns to his bedroom.
Just my two copper.
Sticz
#10
Posted 15 November 2006 - 01:08 AM
you could choose MINHP1, MONHP1 or SUREHP1, just off the top of my head - or you could create a custom item of yr own that did everything you wanted but didn't have the foot circle issue. there's no reason why you have to use HOLDRING, after all.
"A simple test of the relative merits of science and religion is to compare lighting your house at night by prayer or electricity" - A. C. Grayling
"EFF files have saves, too." - CamDawg
|| this is radio seanas || BP Series v3 || seanas at work ||
#11
Posted 15 November 2006 - 05:24 AM
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.
#12
Posted 15 November 2006 - 05:54 AM
As posted above, this may prove challenging as I do not know exactly how to script a new trap in an existing area with WeiDu. I really am not in favor of the invisible .cre there to perform the actions.
Lug.
#13
Posted 15 November 2006 - 07:21 AM
I do remember that it had a disclamer about not being very effective, perhaps someone can "prrofread" this or get you a better link:
//******************************************************************
//*Notes:
//* You may use this code for your own mods. Simply change
//* whatever RESREFs you need.
//* Do not change any of the variables that have already been
//* made up, particulary those that alter offsets as it
//* will mess up the area file.
//* If you plan on adding more than one type of header (such as
//* two actors, you'll need to duplicate this code exactly.
//* Of course, you can alter any of the X,Y points to your own decimals.
//* I've only included the most popular changes to headers, so
//* if you need to change the number of times an actor has been
//* spoken to, for example, you'll have to figure out the offset.
//* When adding this code to your own .TP2, do not include these notes or
//* the BEGIN 'How to....' line
//*
//******************************************************************
BEGIN ~How To Add Triggers To ARE files With Weidu.~
//Which File are we going to edit:
COPY_EXISTING ~AR0020.ARE~ ~override/AR0020.ARE~
//Prepare for the area modification.
//---------------------------------DO NOT ALTER FROM HERE TO THE FOLLOWING BREAK.
READ_SHORT ~0x058~ ~#ofActor~
READ_SHORT ~0x054~ ~actorOff~
READ_SHORT ~0x05a~ ~#ofTrigg~
READ_SHORT ~0x05c~ ~triggOff~
READ_SHORT ~0x064~ ~#ofSpawn~
READ_SHORT ~0x060~ ~spawnOff~
READ_SHORT ~0x06c~ ~#ofEntra~
READ_SHORT ~0x068~ ~entraOff~
READ_SHORT ~0x074~ ~#ofConta~
READ_SHORT ~0x070~ ~contaOff~
READ_SHORT ~0x076~ ~#ofItems~
READ_SHORT ~0x078~ ~itemsOff~
READ_SHORT ~0x080~ ~#ofVerti~
READ_SHORT ~0x07c~ ~vertiOff~
READ_SHORT ~0x082~ ~#ofAmbia~
READ_SHORT ~0x084~ ~ambiaOff~
READ_SHORT ~0x08c~ ~#ofVaria~
READ_SHORT ~0x088~ ~variaOff~
READ_SHORT ~0x09c~ ~#ofExplo~
READ_SHORT ~0x0A0~ ~exploOff~
READ_SHORT ~0x0A4~ ~#ofDoors~
READ_SHORT ~0x0A8~ ~doorsOff~
READ_SHORT ~0x0AC~ ~#ofAnima~
READ_SHORT ~0x0B0~ ~animaOff~
READ_SHORT ~0x0B4~ ~#ofTiled~
READ_SHORT ~0x0B8~ ~tiledOff~
READ_SHORT ~0x0BC~ ~songsOff~
READ_SHORT ~0x0C0~ ~restcOff~
READ_SHORT ~0x0C8~ ~#ofAutom~
READ_SHORT ~0x0C4~ ~automOff~
//Increase the number of TRIGGERS and correct the offsets
WRITE_SHORT 0x05a (~%#ofTrigg%~ + 1)
WRITE_SHORT 0x060 (~%spawnOff%~ + 196)
WRITE_SHORT 0x068 (~%entraOff%~ + 196)
WRITE_SHORT 0x070 (~%contaOff%~ + 196)
WRITE_SHORT 0x078 (~%itemsOff%~ + 196)
WRITE_SHORT 0x07c (~%vertiOff%~ + 196)
WRITE_SHORT 0x084 (~%ambiaOff%~ + 196)
WRITE_SHORT 0x088 (~%variaOff%~ + 196)
WRITE_SHORT 0x0A8 (~%doorsOff%~ + 196)
//Complete the prep work by adding a bunch of blank bytes.
INSERT_BYTES (~%triggOff%~ + ~%#ofTrigg%~ * 196) 196
//Prep work is done.
//-----------------------------DO NOT ALTER ANYTHING ABOVE HERE TO THE TOP BREAK.
//Set up the vertices you'll be adding.
WRITE_SHORT 0x080 (~%#ofVerti%~ +
//NOTE: YOU CAN CHANGE THE "8" TO HOWEVER NUMBER OF VERTICES YOU ARE
// ADDING FOR YOUR TRIGGER.
INSERT_BYTES (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196) 32
//In the above two lines, only change the "32". That numeral should be
//THE NUMBER OF VERTICES YOU'RE ADDING TIMES 4.
//Correct the offsets
WRITE_SHORT 0x0A0 (~%exploOff%~ + 228)
WRITE_SHORT 0x0B0 (~%animaOff%~ + 228)
WRITE_SHORT 0x0B8 (~%tiledOff%~ + 228)
WRITE_SHORT 0x0BC (~%songsOff%~ + 228)
WRITE_SHORT 0x0C0 (~%restcOff%~ + 228)
WRITE_SHORT 0x0C4 (~%automOff%~ + 228)
//IN THE ABOVE SECTION, THE "228"s CAN BE CHANGED.
//IT SHOULD BE (196 + (~#newVertices~ * 4)), so this example adds 8 vertices.
//196 + 8*4 = 228.
//-------------------------------------INSERT SPECIFICS BELOW.
//Now, you can start adding in the actual code for whatever you are inserting.
//Name
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196) ~Your_New~
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + ~Trigger1~
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 16) ~~
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 24) ~~
//Trigger Type
WRITE_SHORT (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 32) 01
//01=Info
//02=Travel
//03=Proximity
//Trigger Icon
WRITE_SHORT (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 52) 22
//22=Info Question Mark
//28=Inside Exit (stair)
//30=Outside Exit (door)
//Destination Area RESREF
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 56) ~~
//Exit point
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 64) ~~
//Flags:
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 96) 04
//04=Party Required
//Trigger Text
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 100) 5185
//Replace the "5185" with your chosen dialog string for Info Points.
//You can use SAY here, just replace "WRITE_LONG" with "SAY" and "5185" with "@#"
//Trap Detection %
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 104) 00
//Trap Removal %
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 106) 00
//Is Trapped Flag
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 108) 00
//0=no
//1=yes
//Trap Already Detected Flag
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 110) 00
//same as above?
//Trap Location:
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 112) 244
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 114) 746
//Key Type
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 116) ~~
//Associated Script
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 124) ~~
//Associated Dialog
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 188) ~~
//Now, we've got to set up the vertices. I suggest you use IETME to make the graphical
// representation, then view the numbers with NI
//bounding box:
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 34) 568
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 36) 175
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 38) 676
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 40) 337
//CHANGE YOUR POINTS TO THE BOUNDING BOX.
//#vertices
WRITE_SHORT (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 42) 8
//CHANGE THE "8" TO HOWEVER NUMBER OF NEW VERTICES YOU'LL BE ADDING.
//vertex index
WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 44) ~%#ofVerti%~
//Now, write the new vertices.
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196) 589
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 2) 332
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 4) 568
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 6) 235
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 587
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 10) 189
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 12) 620
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 14) 174
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 16) 667
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 18) 182
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 20) 676
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 22) 217
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 24) 661
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 26) 337
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 28) 589
WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 30) 332
//Of course, you can alter the points above to match your trigger
//as well as add new points, AS LONG AS EVERYTHING FOLLOWS THE PATTERN!
Enjoy,
Sticz