Aug 22, 2011 at 6:30 PM
Senior Member
"Huzzah!"
Join Date: Aug 10, 2011
Location:
Posts: 222
I messed with bullet.pbm as well.
 
Aug 22, 2011 at 6:32 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Are the polar star images there? They should be in the upper right corner if my memory is correct.
 
Aug 22, 2011 at 7:10 PM
Senior Member
"Huzzah!"
Join Date: Aug 10, 2011
Location:
Posts: 222
there aren't any polar star images in the top right, but the bullets are in the center-ish part of bullet.pbm. If you are talking about Armsimage.pbm, it is the third image on the left
 
Aug 22, 2011 at 7:14 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
I meant bullet.pbm, but that's fine.
I'm not sure what's wrong.

I do have a question of my own, though.
Is there a way to render my own graphic? I need to show a message from textbox.pbm that represents ram offset 0x49dda0, along with a graphic beside it.
 
Aug 23, 2011 at 12:33 AM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
LunarSoul said:
I do have a question of my own, though.
Is there a way to render my own graphic? I need to show a message from textbox.pbm that represents ram offset 0x49dda0, along with a graphic beside it.

Code:
PUSH (graphicsid)
LEA EAX,[some address]    ;rects
PUSH EAX
PUSH (y)
PUSH (x)
PUSH 48F91C
CALL 40C3C0
ADD ESP,14

There's the rendering function. I think I mentioned that to you that before.

The most important part is pushing the rects address. You should store your framerects for the graphic you want to render into some local variables, such as [EBP-4], [EBP-8], and so forth.
Next, as soon as you have your list of 4 numbers, such as {10,20,30,40}, and you want to use that as your rects, then you LEA into EAX the address of the last number (in this case, 40).

For example...

Code:
MOV DWORD [EBP-4],10    ;lower
MOV DWORD [EBP-8],20    ;right
MOV DWORD [EBP-C],30    ;upper
MOV DWORD [EBP-10],40   ;left (ok fine these framerect numbers make no sense but just ignore that)
PUSH (graphicsid)
LEA EAX,[EBP-10]
PUSH EAX
... and so on.

After that, you should be set. Obviously, you can use any register (not just EAX) to do the LEA part.
 
Aug 23, 2011 at 2:37 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Sorry for making you repeat yourself, I forgot about that.
Thanks, I almost understand now. So is the graphicsid just a number that signifies the graphic, like healthbar or exp bar?
Other than that, I completely understand. Thank you.
RENDERING KNOWLEDGE GET!
 
Aug 23, 2011 at 8:36 AM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
LunarSoul said:
Sorry for making you repeat yourself, I forgot about that.
Thanks, I almost understand now. So is the graphicsid just a number that signifies the graphic, like healthbar or exp bar?
Other than that, I completely understand. Thank you.
RENDERING KNOWLEDGE GET!

Uh... graphics ID...

It's explained in the ASM Compendium. They're basically spritesheet numbers.

Code:
Bitmap object slots:
0 = title image 
1 = "2004.12 Studio Pixel"
2 = current map tileset*
3 = null
4 = null
5 = null
6 = bg fade sheet
7 = null
8 = itemimage.pbm *
9 = Map System something
0A = Screenshot (for Map System, Pause)
0B = arms.pbm*
0C = armsimage.pbm
0D = The text that appears from <MNA
0E = stageimage.pbm
0F = "Loading" image from title screen [behaves oddly]
10 = mychar.pbm*
11 = bullet.pbm*
12 = null
13 = caret.pbm
14 = npcsym.pbm*
15 = Map NPC tileset 1*
16 = Map NPC tileset 2*
17 = npcregu.pbm*
18 = null
19 = null
1A = textbox.pbm
1B = face.pbm
1C = Map BG
1D = something to do with the text for weapon names in menu; changes the gfx depending on last weapon viewed
1E = TextBox Line 1
1F = TextBox Line 2
20 = TextBox Line 3
21 = ????
22 = Null
23 = Credits Text Bitmap?
24 = For Credits
25 = For Credits
26 = Null
27 = Null

For example, when I did a "bigger main char" hack for Kick Ass's Hermit Story, I used PUSH 10. 10 (in hex) is the graphicsID for MyChar.pbm or .bmp, which totally makes sense if you're trying to mess with the rendering for the main character.
 
Aug 23, 2011 at 1:18 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
I understand now, it's the pbm used for the graphic.
Thanks much!

EDIT: Well it's kind of working, but the graphic only shows up for a split second. Does it have to be constantly run?
 
Aug 23, 2011 at 11:36 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
The function has to be called every frame.
 
Aug 23, 2011 at 11:41 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Yeah, I thought so.
I can't seem to find a way to do that though. I tried replacing the pot NPC's code with it. It didn't work.
 
Aug 24, 2011 at 12:08 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
LunarSoul said:
Yeah, I thought so.
I can't seem to find a way to do that though. I tried replacing the pot NPC's code with it. It didn't work.

Everything is drawn after the NPC's run their functions. So basically it IS drawing, it is just being drawn behind the background and tiles.
 
Aug 24, 2011 at 1:40 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
I understand now. I still need a place that's going to constantly run this though. Somewhere with a lot of space. HuRrRrrRRr.
 
Aug 26, 2011 at 7:51 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Dec 1, 2010
Location: France (yup)
Posts: 9
Welp, I should login here more often, but heh.

I just got back to CS hacking (which I haven't praticed more than a month anyway). I'm trying to do a simple debugging room to check if my new sprites and some scripts run well. I cut the Life Capsule from First Cave, pasted it into Starting Point (which I made the debug room in), and did the same with the script.

However, when I try to use the capsule, the game does nothing but make the character use the "facing the background" pose like usual failed scripts do. Did I forget to do something important ? Thanks. :confused:
 
Aug 26, 2011 at 7:54 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Your entity needs entity flag 0x2000 and event # the same event number for your event in the TSC script.
 
Aug 26, 2011 at 9:12 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Dec 1, 2010
Location: France (yup)
Posts: 9
I'm pretty sure I have done that. *check*
Yeah, I set up flag x2000 (and x4000). The event is #461 so it (hopefully) doesn't conflict with anything and is specified in both the script and the entity. :V
 
Aug 26, 2011 at 9:16 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Is an event running at the time? You can't run events when there's already one going on. Try double-checking your script. Every script should have <END at the end, and look for any infinite loops.
 
Aug 26, 2011 at 9:16 PM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
You mean the event is #0461 right?

That 0 is important.
 
Aug 26, 2011 at 10:09 PM
Pirate Member
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Dec 26, 2007
Location: Lithuania
Posts: 1946
GIRakaCHEEZER said:
You mean the event is #0461 right?

That 0 is important.

I've seen Pixel use three digit events without the 0 in front.
 
Aug 26, 2011 at 10:12 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
WoodenRat said:
I've seen Pixel use three digit events without the 0 in front.

pics or it didn't happen?

But either way that's incorrect and will cause errors in your scripts.
 
Aug 26, 2011 at 10:23 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Dec 1, 2010
Location: France (yup)
Posts: 9
LunarSoul said:
Is an event running at the time? You can't run events when there's already one going on. Try double-checking your script. Every script should have <END at the end, and look for any infinite loops.

Nah, it seems like no event is going on and all the events have <ENDs. And yes, the event is actually #0461.

Oh, wait, actually, I'm using an already modded version of CS- it's a translation in French so I can more easily check what I'm doing, being french and having played the game in french first.
Though these are only text changes, maybe the translater has broken some script that didn't do much in the translation but would affet my mod. I should look into that, but I don't think it's the source of the problem. Anyway, testing it won't hurt. Thanks for the help !
 
Top