Apr 20, 2011 at 10:54 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Miza is rubbish
Please don't even bother.
Just download Cave Editor from its thread on the forums in some section or another.
 
Apr 21, 2011 at 1:45 AM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
LunarSoul said:
Hmm...Seems like a waste of space. Unless it's to group types of ASM code together, like weapon shot code.
It's actually a really efficient and elegant method to go to different portions of the code. In items with ids, such as previously mentioned entities or weapons, there is bound to be a lot of checks as to which id or which state we are in, and how to proceed from there. A simple way to do this would look something like this:
Code:
  cmp eax,0
jne A
...
A cmp eax,1
jne B
...
B cmp eax,2
jne C
...
Where you check whether this part of the code should be run, and if not, jump down to the next check. However, those jmps are more often then not going to be long or "absolute" jmps (as opposed to short/relative jmps) which take up (if I remember correctly) six bytes each. Coupled with the cmps, this has a best case scenario of s = 9*n (tual best case, w/ short jumps, is 5*n). The jmp table has one jmp, and then a table of possible locations, meaning s = 7 + 4*n. The implication of this is that if you have more than ONE (7 if only short jumps) check(s), a jmp table will be more efficient. It is also obscenely easy to expand. If you think that you might increase the number of states later, just leave some nops at the end of the table and you can fill them in later. With the first method, you have to completely restructure the code each time.

WoodenRat said:
Yeah I ment I want to make an NPC generator.
I don't know how much assembly you know, Mr. Rat. The easiest method to do such a thing would be to hack into an already existing generator and just swap out the entity argument in the creation function. If you don't know where to begin with that, say why not and me/nox/whoever will walk you through it.
 
Apr 21, 2011 at 2:04 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Lace said:
Where you check whether this part of the code should be run, and if not, jump down to the next check. However, those jmps are more often then not going to be long or "absolute" jmps (as opposed to short/relative jmps) which take up (if I remember correctly) six bytes each. Coupled with the cmps, this has a best case scenario of s = 9*n (tual best case, w/ short jumps, is 5*n). The jmp table has one jmp, and then a table of possible locations, meaning s = 7 + 4*n. The implication of this is that if you have more than ONE (7 if only short jumps) check(s), a jmp table will be more efficient. It is also obscenely easy to expand. If you think that you might increase the number of states later, just leave some nops at the end of the table and you can fill them in later. With the first method, you have to completely restructure the code each time.
Hmm. I'm still a bit confused, but I think I get what you're getting at.
I just don't know the jne command. Is it like the jmp command?
Oh, and it checks if eax is the same as 0, right? And if so, it does a jne to A? So, does it keep checking until it's true? Or does it skip jne, or something wonky like that?
 
Apr 21, 2011 at 2:10 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Something tells me you didn't finish reading Carrotlord's guide
I would appreciate you having at least a fundamental understanding of the meaning of each command before attempting anything more complicated than editing values...... .. :)
 
Apr 21, 2011 at 2:16 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
I apologize trying to increase my education in ASM offended you, nox. T.T
And no, I didn't finish it. I never get time on my compy.
 
Apr 21, 2011 at 2:19 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
You misconstrue my meaning
It's just that these questions could be much more easily and more readily answered by looking at the book, saving time for both parties.
 
Apr 21, 2011 at 2:30 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Meh, I suppose.
To be honest, I completely forgot about carrotlord's guide. :awesomeface:
 
Apr 21, 2011 at 4:05 AM
Senior Member
"Wahoo! Upgrade!"
Join Date: Apr 8, 2011
Location: Living in a far away place with Kazuma.
Posts: 61
In cave editor If I place a HP-UP in the stating point room how do I get it so that it will respond?
 
Apr 21, 2011 at 5:41 AM
Absentee Modder
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Sep 7, 2010
Location: Outside your window. No no, don't check, it's okay
Posts: 272
Age: 29
Give the entity an event #.
That number will link it to that numbered event in the map's script file.

Then, give the entity flag 2000. This will make it run that event when you press the down arrow.

Sorry if this is too complex or too basic... I'm not sure how experienced you are with modding.
 
Apr 21, 2011 at 5:55 AM
Senior Member
"Wahoo! Upgrade!"
Join Date: Apr 8, 2011
Location: Living in a far away place with Kazuma.
Posts: 61
What event number do I give it?
 
Apr 21, 2011 at 6:12 AM
Absentee Modder
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Sep 7, 2010
Location: Outside your window. No no, don't check, it's okay
Posts: 272
Age: 29
Doesn't matter. As long as it's over 50, and it's not already taken by something else on that map.

You just need to make an event with the same number, in the map's script file.

There ARE guides for this stuff, you know. Here's a good one: http://dragonboots.tile44.org/cmgbasic.htm
 
Apr 21, 2011 at 8:25 AM
Been here way too long...
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Sep 16, 2009
Location:
Posts: 519
If you're working on default CS, go for over 100
 
Apr 21, 2011 at 3:34 PM
Senior Member
"Wahoo! Upgrade!"
Join Date: Apr 8, 2011
Location: Living in a far away place with Kazuma.
Posts: 61
What and where is the map script?
 
Apr 21, 2011 at 3:38 PM
Only Love, Maximum Love, Forever
"Life begins and ends with Nu."
Join Date: May 6, 2009
Location: somewhere new
Posts: 2137
Age: 29
Professor Fufflykins said:
What and where is the map script?

I wish to see all your questions answered, but these are rather basic ones so I recommend searching the forums for "CaveEditor for Beginners."
Noxid wrote an easy to understand tutorial, I actually used it when I was getting started.
 
Apr 21, 2011 at 6:35 PM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jan 21, 2011
Location:
Posts: 249
Since no one seemed to notice my question, I'll ask again:

How many teleporter slots does the engine support?
 
Apr 21, 2011 at 6:54 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Haven't got a clue. My advice would be "Make more until they stop working".
 
Apr 21, 2011 at 8:12 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Testing is the key to success.
Always.
ALWAYS.
ALWAYS!!!!!
 
Apr 21, 2011 at 9:42 PM
Pirate Member
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Dec 26, 2007
Location: Lithuania
Posts: 1946
Plantation, Egg Corridor, Land of weed, Sand zone, Labyrinth.

That's five...Or was it six? You could add more with assembly but I wouldn't suggest that. Hell, you should do your best to avoid assembly at all times. If there's a way to get around it with TSC, do it. And with teleporters, you can. Just add <YNJs and you're set.
 
Apr 21, 2011 at 11:10 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Can someone double-check some ASM for me? I can't figure out what's wrong.

Code:
CPU Disasm
Address   Hex dump          Command
0048B905  /$  8B0D CCE64900 MOV ECX,DWORD PTR DS:[49E6CC]
0048B90B  |.  8B15 D0E64900 MOV EDX,DWORD PTR DS:[49E6D0]
0048B911  |>  8305 CCE64900 ADD DWORD PTR DS:[49E6CC],1
0048B918  |.  39D1          CMP ECX,EDX
0048B91A  \.  C3            RETN

...Load of NOPs...

0048B920    ^ EB E9         JMP SHORT 0048B90B

It's supposed to completely fill your HP. It seems to only refill one point of health, regardless of whether it is full or not.
It stores current HP to ECX, and max HP to EDX. It then adds 1 to HP....oops.
Gimme a sec.

Oh, and WR: Land of weed? Really?


EDIT: Here's the revised version.
It still doesn't work though.

Code:
CPU Disasm
Address   Hex dump          Command                                  
0048B905  /$  8B0D CCE64900 MOV ECX,DWORD PTR DS:[49E6CC]
0048B90B  |.  8B15 D0E64900 MOV EDX,DWORD PTR DS:[49E6D0]
0048B911  |>  8305 CCE64900 ADD DWORD PTR DS:[49E6CC],1
0048B918      8B0D CCE64900 MOV ECX,DWORD PTR DS:[49E6CC]
0048B91E      39D1          CMP ECX,EDX
0048B920      C3            RETN
0048B921    ^ EB E8         JMP SHORT 0048B90B

...Yeah, I realize I don't need that first MOV command.
 
Top