View previous topic :: View next topic |
Author |
Message |
cjJohnson Guest
|
Posted: Mon Oct 01, 2012 11:45 pm Post subject: "catch a monster" script |
|
|
im hoping to design a game where the hero can catch monsters and use them in battle. Ive got the battle part down (involves a lot of attack linking)
and i am going to change "steal" to "capture".
here is the hard part:
I need a script that when the player lands a successful "steal" or "capture"
in my case, the enemy will die.
Doesn't seem too impossible right?
Any help would be forever appreciated and will not go unrecognized.
Thank you in advance! |
|
Back to top |
|
|
Bob the Hamster OHRRPGCE Developer
Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Oct 02, 2012 6:09 am Post subject: |
|
|
You can't run scripts in battle, but I think you can do this with counterattacks.
Rename an elemental to "Capture".
Your hero's capture attack should be set to do capture elemental damage.
Each enemy should have a special counterattack that only happens on capture elemental attacks.
The capture elemental counterattack will be self-targeting, and will set target HP to 0% of max.
You can give each capturable enemy their own version of the capture elemental counterattack, and each one can turn on a different tag. Then you can check the tags in an after-battle script to see which enemies have been captured. |
|
Back to top |
|
|
Rya.Reisender Snippy
Joined: 18 Jan 2008 Posts: 821
|
Posted: Tue Oct 02, 2012 1:29 pm Post subject: |
|
|
James, I think he just wants to do it via "Steal". As in you steal the monster egg from the monster.
This would require either being able to link on a successful steal or counter on a successful steal, but I'm not sure if either is possible.
(If it's not possible, it would actually be a nice idea to implement a "link only on successful steal" condition.)
But your solution should work I guess. I didn't realize you could make skills set tags. I personally prefer solutions that don't require plotscripting if possible, though.
Actually if the chance to capture should always be the same for each monster, then it would be even easier:
1. Make capture skill do nothing except linking to "steal" skill to x%.
2. Make all monster eggs 100% steal chance.
3. Always link to "instant death" skill from steal.
That way capture does not always succeed but steal will always result in death of the monster. _________________ Snippy:
"curt or sharp, esp. in a condescending way" (Oxford American Dictionary)
"fault-finding, snappish, sharp" (Concise Oxford Dictionary, UK)
1. short-tempered, snappish, 2. unduly brief or curt (Merriam-Webster Dictionary) |
|
Back to top |
|
|
cjJohnson Guest
|
Posted: Wed Oct 03, 2012 11:53 pm Post subject: WOOOPS posted a new topic instead of reply |
|
|
sorry about that!
i wanted to post this message HERE not as a new topic,
Everything sounds like it could work but... like many i am fairly new to plotscripting ( I am learning though!) could you help me out with an afterbattle script that checks the tags like you say.
something like if tagx=on then add item X to inventory
right?
this is exciting as I have not seen an ohrrpgce game with the idea of gathering tons of summonable monsters that you recieve from other monsters. ( i was pretty proud of myself when i came up with a way to do "summon" spells. They look so cool Happy ) I just made a bunch of self targetting zero damage attacks with the name of the monster to summon (this attack would read: summon X monster during the attack (all of which had rings around the caster which looked like it was sending a signal) then linked them to the attack which also was zero damage, but showed the monster... THEN linked that to the actual attack (sometimes more than one attack if I wanted it to be super kewl).
Im sure you guys have seen similar things but for a would-be game maker like me this was epic Happy
well thanks again and if you can please get back to me I am so greatfull for the community you all have created (as well as the engine) thank you thank you thank you!!!
Back to top |
|
Back to top |
|
|
Bob the Hamster OHRRPGCE Developer
Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Oct 04, 2012 6:23 am Post subject: |
|
|
Code: |
plotscript, after battle example, begin
if(check tag(tag:got slime)) then(
get item(item:slime)
set tag(tag:got slime, OFF)
)
if(check tag(tag:got goblin)) then(
get item(item:goblin)
set tag(tag:got goblin, OFF)
)
if(check tag(tag:got vampbat)) then(
get item(item:vampbat)
set tag(tag:got vampbat, OFF)
)
end
|
This example assumes that it the summon items are consumable, and it is okay if you gather more than one of them in separate battles.
Actually, if you are using items as your summons, you might be able to do this without a script at all. You can make a successful summon attack have an item cost, which you set equal to -1 of the appropriate summon item. Negative item costs cause you to gain the item.
...but I have not tested that approach myself, so I am not sure how well it will work, or if it will be any easier than the tags+scripts approach. |
|
Back to top |
|
|
Rya.Reisender Snippy
Joined: 18 Jan 2008 Posts: 821
|
Posted: Thu Oct 04, 2012 8:13 am Post subject: |
|
|
If you use my version, you won't even need plotscripting and can use the item during the same battle. :-) _________________ Snippy:
"curt or sharp, esp. in a condescending way" (Oxford American Dictionary)
"fault-finding, snappish, sharp" (Concise Oxford Dictionary, UK)
1. short-tempered, snappish, 2. unduly brief or curt (Merriam-Webster Dictionary) |
|
Back to top |
|
|
cjJohnson Guest
|
Posted: Sat Oct 06, 2012 8:27 pm Post subject: ok now it all makes sense |
|
|
ok guys you both have very good points and i will soak up all of it.
My last plea for help is in that say i had like 4 or 5 different difficulty levels of monsters regarding capturing ( 1 being the easiest to capture with a high% success rate and 5 being the hardest ect.) what would be the easiest way to do this?. this is going to be so epic. Pokemon eat your heart out! |
|
Back to top |
|
|
cjJohnson Guest
|
Posted: Sat Oct 06, 2012 8:31 pm Post subject: might i add |
|
|
i would also just like to say Bob, you are like a celebrity to me and i think it is awesome that you take the time to stay in touch with the small timers like me.
Rya, you too I have not heard of you but i am sure you have done great things.
Thanks for your help guys seriously this entire idea of ohrrpgce is like me being a kid in a candy store. i love it! |
|
Back to top |
|
|
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sat Oct 06, 2012 11:22 pm Post subject: |
|
|
If you're using counterattacks to a 'Capture' element, make the counterattack do nothing at all except chain to the real counterattack (giving an egg, or setting a tag, whichever you're doing) with X percent chance.
Rya already mentioned how to customise the steal success rate.
Personally I would use a hybrid of the two approaches: using both counter attacks and stealing, but no scripting or tags, so that you only need to create one attack per capture difficulty level (as opposed to one attack per captureable enemy) because you can easily set the right summoning item as the 'Steal Item', and, say, "40% Chance Capture" as the Capture element counter attack in the enemy definition. _________________ "It is so great it is insanely great." |
|
Back to top |
|
|
Rya.Reisender Snippy
Joined: 18 Jan 2008 Posts: 821
|
Posted: Sun Oct 07, 2012 4:20 am Post subject: |
|
|
I wasn't sure what happens if you let a monster use steal. Does the party get the item then anyway?
If that works then this would be the best solution, yes. _________________ Snippy:
"curt or sharp, esp. in a condescending way" (Oxford American Dictionary)
"fault-finding, snappish, sharp" (Concise Oxford Dictionary, UK)
1. short-tempered, snappish, 2. unduly brief or curt (Merriam-Webster Dictionary) |
|
Back to top |
|
|
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Oct 07, 2012 4:45 am Post subject: |
|
|
My mistake. I looked at the code, and it seems steal can only happen when a hero attacks an enemy. _________________ "It is so great it is insanely great." |
|
Back to top |
|
|
Rya.Reisender Snippy
Joined: 18 Jan 2008 Posts: 821
|
Posted: Mon Oct 08, 2012 1:36 am Post subject: |
|
|
In that case he has to use James's solution with tags and plotscripts if he really wants to have different success chances and handle it via counterattacks or spawns that link to a certain % to the skill that sets the tag.
Me being lazy to plotscript would probably use a workaround, though: Make a secondary monsters for each monster. That secondary monster is invinsible and has the "catch" item as drop to 100%. This monster is spawned whenever the player uses catch on the original monster. Now you can give the monster a chance to either suicide or flee. Suicide would mean the player gets the item and flee would mean he won't get it (I think flee was implemented properly a while ago). _________________ Snippy:
"curt or sharp, esp. in a condescending way" (Oxford American Dictionary)
"fault-finding, snappish, sharp" (Concise Oxford Dictionary, UK)
1. short-tempered, snappish, 2. unduly brief or curt (Merriam-Webster Dictionary) |
|
Back to top |
|
|
cjJohnson Guest
|
Posted: Tue Oct 09, 2012 3:04 am Post subject: error in script |
|
|
sorry im kinda rusty on scripting I just got back into the ohrrpgce a week or so ago after over a year but i copied this script and tried to compile with hspeak and got this message
ERROR: in script afterbattleexample on line 4 in
C:\gamez\ohrrpgce\ohrrpgce\MonsterMaster.hss.txt
if(check tag(tag:got slime)) then(get item(item:slime)set tag(tag:got slime,
OFF))
^
Unrecognised name tag:gotslime. It has not been defined as script, constant,
variable, or anything else |
|
Back to top |
|
|
Bob the Hamster OHRRPGCE Developer
Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Oct 09, 2012 6:41 am Post subject: |
|
|
You should name a tag "got slime" in the tag name editor.
Then go to the "Script Management" menu and pick "Export Names for Scripts (.hsi)"
This will create a .hsi file. I guess for you it will be named something like MonsterMaster.hsi
at the top of your script file, add
Code: |
include, MonsterMaster.hsi
|
and that will make tag names available in your scripts. |
|
Back to top |
|
|
cjJohnson Guest
|
Posted: Wed Oct 10, 2012 5:22 pm Post subject: gotcha |
|
|
naming the tag in the creation engine is what i was lacking.
silly me.
thank you so much. Are you working on any new games or changes to the creation engine? |
|
Back to top |
|
|
|