
Spawn-Points or Scripting?
Started by Sticz, Nov 03 2006 10:50 AM
4 replies to this topic
#1
Posted 03 November 2006 - 10:50 AM
I want to make an area that contains pieces to a quest. However, I want the monsters to drop the quest item on a very rare basis so that the party has to do alot of killing in order to complete the quest. (I was thinking of adding some ware-rats to the sewers and make their pelts part of a quest)
My point is, how do I correctly write for this? If I use scripting, I would have to set a timer on the spawns so that they would be recurring, and I would have to write a random number generator in there in order for the relevant creature or item to be present:
IF
GlobalTimerExpired("RatSpawn","ARXXX")
RandomNum(20,1)
!InMyArea("WareRat")
THEN
RESPONSE #100
CreateCreature("WareRat",[0.0],0)
SetGlobalTimer("RatSpawn","ARXXX",ONE_DAY) /// Unless there is a time ammount less than 1 day
END
~Then make a buch of other ones to go along with it
If I even have this right (I have no experience with timers).
Would it be better to have a Spawn point inserted into the area and just have the creatures I want on the list of random creatures to be spawned? If I chose the Spawn-Point, how would that be coded? I think the .BCS would be less intrusive, but would it also be less practical?
If I was making a new area it would be a spawn point, but adding to an existing area...
Sticz
My point is, how do I correctly write for this? If I use scripting, I would have to set a timer on the spawns so that they would be recurring, and I would have to write a random number generator in there in order for the relevant creature or item to be present:
IF
GlobalTimerExpired("RatSpawn","ARXXX")
RandomNum(20,1)
!InMyArea("WareRat")
THEN
RESPONSE #100
CreateCreature("WareRat",[0.0],0)
SetGlobalTimer("RatSpawn","ARXXX",ONE_DAY) /// Unless there is a time ammount less than 1 day
END
~Then make a buch of other ones to go along with it
If I even have this right (I have no experience with timers).
Would it be better to have a Spawn point inserted into the area and just have the creatures I want on the list of random creatures to be spawned? If I chose the Spawn-Point, how would that be coded? I think the .BCS would be less intrusive, but would it also be less practical?
If I was making a new area it would be a spawn point, but adding to an existing area...
Sticz
"For a crazy person, you don't drool much." Complement from Dilbert's Wally.
#2
Posted 03 November 2006 - 01:10 PM
Ware-rat? What animation are you going to use for that?
I'm kinda new at this modding thing, so please hang with me. I would just like to see where this goes, but from what I know, I would go with the script if I was adding to a new area. If you want to make an item hard to find, make the random number gen in the creatures script. That way you won't have to make 20+ events in your script.
At least from everything I've seen in a few mods I've looked at.
just my 2 cp.
Lug

I'm kinda new at this modding thing, so please hang with me. I would just like to see where this goes, but from what I know, I would go with the script if I was adding to a new area. If you want to make an item hard to find, make the random number gen in the creatures script. That way you won't have to make 20+ events in your script.
At least from everything I've seen in a few mods I've looked at.
just my 2 cp.
Lug

#3
Posted 03 November 2006 - 01:16 PM
Pilfered avatar from bestial animations mod: Ware-Rat
I had thought of the .cre BCS, but I am still not sure if I want to go with a Script instead of a spawn. The plus side to the script is that I'm pretty familiar with it. The downfall is that it's a lot of code for the few things I want to accomplish. I also want to get more familiar with editing areas already in game.
I'm not 100% positive yet, but I think I'll go with scripting since Its not too difficult. I just wish I could get the timer less than ONE_DAY. I would prefer something along the lines of 4 game hours...
Sticz
I had thought of the .cre BCS, but I am still not sure if I want to go with a Script instead of a spawn. The plus side to the script is that I'm pretty familiar with it. The downfall is that it's a lot of code for the few things I want to accomplish. I also want to get more familiar with editing areas already in game.
I'm not 100% positive yet, but I think I'll go with scripting since Its not too difficult. I just wish I could get the timer less than ONE_DAY. I would prefer something along the lines of 4 game hours...
Sticz

"For a crazy person, you don't drool much." Complement from Dilbert's Wally.
#4
Posted 03 November 2006 - 01:39 PM
Going by the example of STATE.IDS I have seen, would this work?
APPEND ~STATE.IDS~
~0x80101FEF CD_STATE_NOT_VALID~
UNLESS ~CD_STATE_NOT_VALID~
A quick change would be:
APPEND ~GTIMES.IDS~
~### EIGHT_HOURS~
UNLESS ~EIGHT_HOURS~
Perhaps it is all fouled up, but it makes sense. Maybe someone more experienced knows for sure.
Lug
APPEND ~STATE.IDS~
~0x80101FEF CD_STATE_NOT_VALID~
UNLESS ~CD_STATE_NOT_VALID~
A quick change would be:
APPEND ~GTIMES.IDS~
~### EIGHT_HOURS~
UNLESS ~EIGHT_HOURS~
Perhaps it is all fouled up, but it makes sense. Maybe someone more experienced knows for sure.
Lug

#5
Posted 05 November 2006 - 06:37 AM
I'd stick with using scripts. Avenger once made the comment that spawn points don't work correctly (actually, I've cleaned up what he really said!) and AFAIK there's been no change in that statement since.
Inasfar as timings are concerned, there is nothing to stop you calculating your own timings from seconds and adding the resulting shorthand to the gtimes.ids file e.g.
ONE_HOUR 3600
FOUR_HOURS 14400
Just remember that if you're compiling on installation you will need to check that the shorthand does/doesn't already exist in the player's gtimes.ids file
APPEND ~gtimes.ids~ ~ONE_HOUR 3600~ UNLESS ~ONE_HOUR~
etc.
-Y-
Inasfar as timings are concerned, there is nothing to stop you calculating your own timings from seconds and adding the resulting shorthand to the gtimes.ids file e.g.
ONE_HOUR 3600
FOUR_HOURS 14400
Just remember that if you're compiling on installation you will need to check that the shorthand does/doesn't already exist in the player's gtimes.ids file
APPEND ~gtimes.ids~ ~ONE_HOUR 3600~ UNLESS ~ONE_HOUR~
etc.
-Y-
Edited by Yovaneth, 05 November 2006 - 06:44 AM.
'Go for the optics, Chiktikka. GO FOR THE OPTICS!!' - Tali vas Neema
DLTCEP Tutorials Update Page
DLTCEP Tutorials Main Page
Yovaneth's AI Scripts for BG1, BG2-SoA and IWD1
Fishing for Trouble - a quest mod for Shadows of Amn