Full Version : Lil problems with IF statements
xmlspawner >>Q&A >>Lil problems with IF statements
<< Prev | Next >>
gizmo- 06-08-2006
Ive done alot over the past week or so here with the 3.1 system and love every part of it, cant stop working with it honestly. I have a question that will help me out with any scenrio I need this for in the future. the IF statment.
How would one do this in your XML Syntax...
IF (RND,1,5) = 1 Spawn Mongbat else spawn balron
i know this isnt your syntax but its understandable what i want to do with this. How would one format for this occurance? Thanks ahead of time cause your post response time is awsome.
ArteGordon- 06-08-2006
there are a couple of ways to do it. One would be to use sequential spawning and have something like this
subgroup 1: IF/RND,1,5=1/33/44
subgroup 1: GOTO/1
subgroup 33: balron
subgroup 44: mongbat
If you just want to spawn 1 creature and have it be a mongbat 4 out of 5 times, the easiest way is to just have regular spawner entries and set the max for each entry according to the frequency that you want them to occur. Then set the spawner maxcount to 1 and you will get 1 creature that will be either a mongbat or balron with the mongbat being the more likely.
mongbat max=4
balron max=1
spawner maxcount=1
gizmo- 06-09-2006
Well that was just an example, i was more curious about how the syntax worked my friend because it was a lil hmm how does this work when looking at the xml spawner help file. but now that you showed me a example of it. Im a very very very happy man. Thats one of the last key pieces I need to take real advantage of this amazing system. Over the past few weeks of learning this. Ive done some good stuff that my players really love like...
Automated PVM Event system, Wisp Dungon Puzzle (takes them about 3-4 hours first time though and it constantly changes combonations ect.. Few other overworld mini spawns of sorts to keep players busy. XML has helped bring our server back to life. Just thought I say a huge thanks.
ArteGordon- 06-09-2006
glad to hear it. Feedback, ideas, and suggestions are always welcome.
gizmo- 06-10-2006
Im a bit curious about the IF/(statement)/Sub/Sub
Does this always have to leave to a sub? or can i have it do....
IF/(Statement)/<OrcishMage/Hue/1155>/<OrcishMage>
??? sorry silly question
ArteGordon- 06-10-2006
yep, has to be a subgroup number
gizmo- 06-12-2006
Well we managed to get a good IF Block system working to cover the AI for a situation for a escorting quest of sorts.
We used a brigand, stripped it reformed it. It follows that path (that keshok our GM posted on in another thread)
So what I did was use a AI system kinda to watch over that escortable. Because it can be attacked by the monsters on the way and if It dies. And it isnt the end point where the last spawner despawns her to spawn the attacking version. then it will sit there IDLE looping waiting for her to just die so it can reset the whole sequenced system of spawners. So I didnt really need the mongbat and balron to spawn, i just needed a good example of the IF block logic. Much thanks man. This escort quest is working great.