 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Mon Mar 09, 2009 7:11 am Post subject: Advise to update ennemies formation on a map! |
|
|
I would like to update the ennemies formation on my maps using plotscripting.
At the beginning, I was thinking placing many formation set (some with very weak ennemies, some other a bit more strong and so on) but you can have only one ennemie formation set for a given x,y,z location
I have the beginning of the solution : when the main hero would arrive
on the map there would be a script in the autorun map,
that would check the hero level (using the command "get hero level (who)" )
The problem is what should I put next?
I was thinking of modifing ennemies stats and apperance (and why not the background in the same time) but I may be wrong
Has somoene already done this? What would be the most convenient way according to you? _________________ It's time to make games! |
|
Back to top |
|
 |
TwinHamster ♫ Furious souls, burn eternally! ♫

Joined: 07 Mar 2004 Posts: 1352
|
Posted: Mon Mar 09, 2009 7:25 am Post subject: |
|
|
You would probably want to use a 'Instead of Battle Script' if scaling formations are what you're after.
Your hero's level would be called up, and a random formation from a pre-made set of appropriate difficulty would be used for the fight.
Or, modifying each enemy's stats and appearances would also be a great way to do this.
(I wasn't even aware you could do this until checking the dictionary just now) |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Mon Mar 09, 2009 7:42 am Post subject: |
|
|
TwinHamster wrote: | Or, modifying each enemy's stats and appearances would also be a great way to do this.
(I wasn't even aware you could do this until checking the dictionary just now) |
Grumble... I kinda regret that feature. it is going to be hell for backwards compatibility someday :( |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Mar 10, 2009 1:09 am Post subject: |
|
|
Yes. Not to mention that the enemy modifying commands are very messy; several mistakes were made.
It's also possible to modify enemy formations, but that's probably a much harder avenue.
There's probably two easy ways of doing this: an instead of battle script which throws a different formation/formation set depending on the hero level, or by modifiying formation sets to include harder formations. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Thu Mar 12, 2009 12:35 am Post subject: Great idea! |
|
|
The Mad Cacti wrote: | instead of battle script which throws a different formation/formation set depending on the hero level, or by modifiying formation sets to include harder formations. |
That's a great idea! What should we put in the instead of battle script?
Here's a proposition
Code: |
# instead of battle script for map2
script, updating ennemies map2, begin
suspend player #useful here?
variable (main hero level) # find hero level and store it in a variable
set variable (main hero level, get hero level)
if (main hero level == 13) then, begin # if main hero is at level 13 then, begin
# what commands do we need here?
end
resume player
end #end of the script
#---------------------------------------------------
|
One of the problem with the code above is that when the main hero will get to level 14 f won't word anymore and the ennemies formation set will become weaks again.
There is another important thing to take on account is that the player can come to manipulate one of the hero's friend! If we made an article, we'll need to explain that it is important to give the same current level fighting skills when a new hero appears else, if the newbie stays alone (for some reasons) the player will kill him easily. It also important that only hero's position has to be taken in account (not the hero's name)
Let's says that the teams members are at level 18 and a newbie arrived. (He is at level 1 or 0) Because of the instead of battle script, the formation are updates and ennemies can be killed only by hero of level (18 or more). Then the new hero stay alone: he'll certainly killed on battle!
Anyway let's keep on thinking above this all together and I'm sure we'll find a solution! _________________ It's time to make games! |
|
Back to top |
|
 |
ringthehat custom title

Joined: 19 Jan 2009 Posts: 16 Location: Midwestern wastelands
|
Posted: Thu Mar 12, 2009 5:57 am Post subject: |
|
|
Quote: | One of the problem with the code above is that when the main hero will get to level 14 f won't word anymore and the ennemies formation set will become weaks again. |
You could use if statements to establish a range of different formation posibilities, ie
Code: |
if(hero levels << 7)
then(
#code that determines low level enemies encountered
)
else(
if(hero levels << 16)
then(
#code that determines mid level enemies encountered
)
else(
#etc, or the most powerful enemy formations player can encounter
)
)
)
|
You can always scan through the current players in the party and come up with a way to determine the party's overall threat to enemies (such as their cumulative level, or just average level, or whatevs), then use that number to either pick from a collection of prefabricated enemy formations, or play around with adding enemysto lower formations.
for reference:
http://gilgamesh.hamsterrepublic.com/wiki/ohrrpgce/index.php/Plot:Fight_formation
http://gilgamesh.hamsterrepublic.com/wiki/ohrrpgce/index.php/Plot:Add_enemy_to_formation |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Mar 12, 2009 8:14 am Post subject: Re: Great idea! |
|
|
Code: |
suspend player #useful here?
|
No, not useful there. "suspend player" is never needed in a script that has no "wait" commands. |
|
Back to top |
|
 |
Spoon Weaver

Joined: 18 Nov 2008 Posts: 421 Location: @home
|
Posted: Thu Mar 12, 2009 9:36 am Post subject: |
|
|
The only problem I see with the code, is basically that it refers to only 1 hero. but if thats not a problem then I guess it's fine. Here's the improvements that I think will help.
Code: |
plotscript, updating enemies map2, begin
#main hero level became mhl for simplicity
variable (mhl)
set variable (mhl, get hero level (0))
if (mhl<< 5) then, begin
fight formation (random formation (1))
end
if (mhl >= 5, and, mhl<< 10) then, begin
fight formation (random formation (2))
end
if (mhl >= 10, and, mhl<< 15) then, begin
fight formation (random formation (3))
end
if (mhl >= 15, and, mhl<< 20) then, begin
fight formation (random formation (4))
end
if (mhl >= 20) then, begin
fight formation (random formation (5))
end
end |
the numbers will have to be changed to fit your need. but other then that it should work. |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Thu Mar 12, 2009 11:58 pm Post subject: That's it! But guess what?! I've got another problem! |
|
|
This code will be usefull! And we us hero(0) which means that if the player came to play with a different hero placed first in the party (a futur friend)
the fight formations will be adapted and be able to fight!
Thanks a lot as always!
But guess what? I've got another problem!
I've started again to work on my YuGiOh game. You may remember that you helped me to implement the D key thanks to which the Npc could say something different from what they says with a text box.
You especially helped me with the switch. Here's the script
Code: |
script, duelmodemap6, begin
suspend player
suspend npcs
variable (MyDirect, Xcheck, Ycheck)
MyDirect:= hero direction (me)
Xcheck:= heroX (me)
Ycheck:= heroY (me)
switch (hero direction (me)) do, begin
case (north) do ( Ycheck -= 1)
case (south) do ( Ycheck += 1)
case (left) do ( Xcheck -= 1)
case (right) do ( Xcheck += 1)
end
switch (get NPC ID (NPC at spot (Xcheck, Ycheck)) ) do, begin
case(2) do , begin # npc2 is yugi
set npc direction (2,(MyDirect+2,mod,4))
suspend box advance
suspend npcs
show text box (61)
wait for key (any key)
while (key is pressed (key:d)==true) do, begin
advance text box
wait(1)
resume box advance
resume npcs
end, else, begin #if the key is not d then... HSPEAK COMPLAINS HERE
set tag (tag: duelmodeends, on)
set tag (tag: dsecond, on)
wait (1)
end #end while key is pressed
end #end for case
case(5) do, begin # npc5 is Sugoroku Muto
set npc direction (5, (MyDirect+2,mod,4))
suspend box advance
show text box (83)
wait for key (any key)
while ( key is pressed (key:d)==true) do, begin
advance text box
wait(1)
resume box advance
resume npcs
end, else, begin #if the key is not d then...
set tag (tag: duelmodeends, on)
set tag (tag:dsecond, on)
wait (1)
end #end while key is pressed
end
case(9) do, begin # npc9 is Kaiba
set npc direction (9, (MyDirect+2,mod,4))
suspend box advance
suspend npcs
show text box (78)
wait for key (any key)
while ( key is pressed (key:d)==true) do, begin
advance text box
wait(1)
resume box advance
resume npcs
end, else, begin #if the key is not d then...
set tag (tag: duelmodeends, on)
set tag (tag:dsecond, on)
wait (1)
end #end while key is pressed
end #end for case
case(14) do, begin # npc14 is Mai
set npc direction (14, (MyDirect+2,mod,4))
suspend box advance
show text box (74)
wait for key (any key)
while ( key is pressed (key:d)==true) do, begin
advance text box
wait(1)
resume box advance
resume npcs
end, else, begin #if the key is not d then...
set tag (tag: duelmodeends, on)
set tag (tag:dsecond, on)
wait (1)
end #end while key is pressed
end
case(15) do, begin # npc15 is Anzu
set npc direction (15, (MyDirect+2,mod,4))
show text box (75)
wait for key (any key)
while ( key is pressed (key:d)==true) do, begin
advance text box
wait(1)
resume box advance
resume npcs
end, else, begin #if the key is not d then...
set tag (tag: duelmodeends, on)
set tag (tag:dsecond, on)
wait (1)
end #end while key is pressed
end
end #end of the switch
#le tag ci-dessus évite que le npc recommence a marcher
if (check tag(tag: duelmodeends)==on) then, begin
resume player #if space has been previously pressed then...
wait(1)
end, else, begin
resume player #if nothing happens then...
resume npcs
set tag (tag:dsecond, off)
end
end #end of the plotscript
#---------------------------------------------------------------------
|
My problem is the following : when hspeak.exe arrived at line 764 I've got the following message
Hspeak.exe wrote: |
if should be follow an if or then
|
Could somoene help me to find what to put instead without changing anything when the runs (it ran perfectly in the previous tests) As I put in the command the else, begin have an important role to play : it tells what to do when d is not press (most of time it's the space bar)
Thanks a million for the script that updates battles. I will write an article when I'll have some free time! Good luck! _________________ It's time to make games! |
|
Back to top |
|
 |
ringthehat custom title

Joined: 19 Jan 2009 Posts: 16 Location: Midwestern wastelands
|
Posted: Fri Mar 13, 2009 5:17 am Post subject: |
|
|
try this syntax instead:
Code: | #le tag ci-dessus évite que le npc recommence a marcher
if (check tag(tag: duelmodeends)==on) then(
resume player #if space has been previously pressed then...
wait(1)
)
else(
resume player #if nothing happens then...
resume npcs
set tag (tag:dsecond, off)
) |
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Mar 13, 2009 7:40 pm Post subject: |
|
|
This is what your code looks like:
Code: | set npc direction (2,(MyDirect+2,mod,4))
suspend box advance
suspend npcs
show text box (61)
wait for key (any key)
while (key is pressed (key:d)==true) do, begin
advance text box
wait(1)
resume box advance
resume npcs
end, else, begin #if the key is not d then... HSPEAK COMPLAINS HERE
set tag (tag: duelmodeends, on)
set tag (tag: dsecond, on)
wait (1)
end #end while key is pressed
|
Why are you using while? That should be an if. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sat Mar 14, 2009 7:28 pm Post subject: This time this is a question about strings |
|
|
Thanks! The script works perfectly now! I just had to replace while(s) and do(s) by if(s) and then. I wonder how I went to put while in this script....
may be an old confusion from implementing new behaviour for the keys. Anyway... I'm learning how strings works by now. I tried the example given by James with slight modifications.
Here is is again
Code: |
1="Hello "
get hero name (2, hero:bob)
1 $+ 2
show string (1) #this will show the string "Hello <name>", depending on the name of the hero
|
My question is the following : how can I get the same effect (make appear hello and the name of current hero in slot 2 using a text box with ${S1} (strings) in it.
Thanks for the information! _________________ It's time to make games! |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sat Mar 14, 2009 11:47 pm Post subject: |
|
|
Hmm? Write "${S1}" in a textbox of course. But in that case it's a lot easier to use the "${H#}" tag to embed the name of hero id #. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Mon Mar 16, 2009 3:50 am Post subject: Well I've tried to |
|
|
Well I've tried to replace show string by a text box with ${S1} in it but when I try to compile the hss file
I've got the message "Expected script, function or flow control but found an expression with value 1. It will do nothing here.
So? Could somoene help me how to modify the script?
$1 "hello" is fine. Hello appears in the text box but the problem is for the hero's name
Good luck! _________________ It's time to make games! |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Mar 16, 2009 8:36 pm Post subject: |
|
|
In the code you posted, you forgot the $ before 1. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|