Get your Custom NPCs right here folks!

Jun 26, 2014 at 9:10 PM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 26
Could you post the code?

Oh and right Aar, I finally remember to do you thing.

offset NPC---

#define
L_frame_distance = 0
U_frame_distance = 0

sprite_width = 10
sprite_height = 10
#enddefine

push ebp
mov ebp,esp
sub esp,10
xor eax, eax
mov dword [ebp-10],eax
mov dword [ebp-c],eax
mov dword [ebp-8],eax
mov dword [ebp-4],eax
setpointer

cmp npc.direction, 2
jne :render
mov eax, playerYpos
add eax, -1000
mov npc.Y, eax

mov edx, playerXpos
mov npc.X, edx


:Render
mov al, L_frame_distance
mov npc.DisplayL, al
add al sprite_width
mov npc.DisplayR, al

mov al, U_frame_distance
mov npc.DisplayU, al
add al sprite_height
mov npc.DisplayD, al
mov esp,ebp
pop ebp
retn




You will have to set the frame distance yourself along with the NPC number.
 
Jun 27, 2014 at 12:20 AM
Senior Member
Modding Community Discord Moderator
CSE Discord Moderator
"I, Ikachan. The Life and Documentary of the OrigiNAL SQuiD."
Join Date: Jan 14, 2014
Location: Antarctica (The Penguins say Hi)
Posts: 150
Age: 24
BLink said:
Could you post the code?
offset NPC258

#define

L_framerect_distance = 0
U_framerect_distance = 20

sprite height = 20
sprite width = 11
#enddefine

push ebp
mov ebp,esp
sub esp,10
xor eax, eax
MOV DWORD [EBP-10],eax
MOV DWORD [EBP-C],eax
MOV DWORD [EBP-8],eax
MOV DWORD [EBP-4],eax
setpointer

:render
mov eax, npc.scriptstate
imul al, al, sprite width
add eax L_framerect_distance
mov npc.DisplayL,eax
add eax, sprite width
mov npc.displayR,eax
mov eax, U_framerect_distance
mov npc.displayU,eax
add eax, sprite height
mov npc.displayD,eax

:end_of_code
mov esp, ebp
pop ebp
retn

Changing the height define doesn't change anything in game.
(the sprite is never taller than ~10~)
 
Jun 27, 2014 at 2:09 AM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 26
I don't see anything wrong with the code at all...

*slowly facepalms*

Are you sure you're setting the scriptstate properly/ your bitmap is set up properly/ your framerect_distance is not set to "XX" before assembling?
 
Jun 27, 2014 at 7:48 AM
Senior Member
Modding Community Discord Moderator
CSE Discord Moderator
"I, Ikachan. The Life and Documentary of the OrigiNAL SQuiD."
Join Date: Jan 14, 2014
Location: Antarctica (The Penguins say Hi)
Posts: 150
Age: 24
I don't see anything wrong with the code at all...


Must be my assembling then...


*slowly facepalms*


I'm sorry...

Are you sure you're setting the scriptstate properly/ your bitmap is set up properly/ your framerect_distance is not set to "XX" before assembling?


If you mean the <TSC code then yes, bitmap should be fine (I'm no artist though so I could be wrong) and yes (I updated my OP).
 
Jun 27, 2014 at 3:45 PM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 26
Must be my assembling then...





I'm sorry...




If you mean the <TSC code then yes, bitmap should be fine (I'm no artist though so I could be wrong) and yes (I updated the OP).




No I'm talking about in defines.



You can't modify the OP, you're not a mod or the user who made Opening Post to the thread?
 
Jul 5, 2014 at 8:26 PM
scrungy
Bobomb says: "I need a hug!"
Join Date: Oct 7, 2011
Location: PrtWeed
Posts: 777
Age: 24
diph.php

(NPC 133 is an example, I wanted to use 014.)

When I try to assemble it, this happens.
Do I need to do some sort of hex conversion?
 
Jul 5, 2014 at 11:37 PM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 26
All the evidence points against it.

You need to download it in the OP and place it in the same folder as the assember.


E: apparently the link was invalid, fixed now.
 
Jul 8, 2014 at 7:08 AM
Senior Member
Modding Community Discord Moderator
CSE Discord Moderator
"I, Ikachan. The Life and Documentary of the OrigiNAL SQuiD."
Join Date: Jan 14, 2014
Location: Antarctica (The Penguins say Hi)
Posts: 150
Age: 24
BLink said:
No I'm talking about in defines.
Found out the real problem (I really need to do more testing before I start complaing about a problem...).
The defines were working in reverse.
Setting the sprite height to a higher number was increasing the NPC's size down. (See fig 1)

:heartrefill: =NPC. ^ or V = Size increase.
^
:heartrefill:1 :heartrefill:2
V

You can't modify the OP, you're not a mod or the user who made Opening Post to the thread?
I had meant my Other Post (forgot that also meant Opening Post :critter: )
 
Aug 14, 2014 at 9:14 AM
Senior Member
"Wahoo! Upgrade!"
Join Date: Jan 4, 2013
Location:
Posts: 52
Hey, I need an enemy that chases you around and one-hit-kills you.
Basically, something like a grave keeper that always follows, and maybe jumps over obstacles? (might be way too hard to make this part.)
You don't actually have to make the "jumping over obstacles" part, I'll just design my map over it instead.
 
Aug 15, 2014 at 3:54 AM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 26
#define

L_framerect_distance = 0
U_framerect_distance = 0

sprite_width = 10
sprite_heigth = 10

horiz_move_speed = 100
ver_move_speed = 100

#enddefine

push ebp ;This starts the code
mov ebp, esp
sub esp,10

mov dword [EBP-10],0
mov dword [EBP-C],0
mov dword [EBP-8],0
mov dword [EBP-4],0
setpointer


;check direction
mov eax, PlayerXpos
cmp npc.X, eax
jg :on_left

;on right
cmp DirectionFaced, 0
je :hide
mov npc.framenum, 1
add npc.X, horiz_move_speed
mov npc.direction, 2
jmp :U/D_check

:on_left
cmp DirectionFaced, 2
je :hide
mov npc.framenum, 1
add npc.X, -horiz_move_speed
mov npc.direction, 0
jmp :U/D_check

:hide
mov npc.framenum, 0
jmp :render


:U/D_check
mov eax, PlayerYpos
cmp npc.Y, eax
je :render
jg :move_up
jl :move_down


:move_up
add npc.Y, -ver_move_speed
jmp :render

:move_down
add npc.Y, ver_move_speed
jmp :render


;----REndering-----

:render
xor eax, eax
mov eax, npc.framenum
imul al, al, sprite_width
mov npc.DisplayL,eax
add eax, sprite_width
mov npc.displayR,eax
mov eax, U_framerect_distance
cmp npc.direction, 2
jne :render_left
add eax sprite_heigth
:render_left
mov npc.displayU,eax
add eax,sprite_heigth
mov npc.displayD,eax

:end_of_code
mov esp, ebp
pop ebp
retn

Yay, I like it when I can pull straight from my notes.

it's not affected by gravity, is that an issue?
 
Aug 15, 2014 at 2:24 PM
Senior Member
"Wahoo! Upgrade!"
Join Date: Jan 4, 2013
Location:
Posts: 52
Yeah, kind of. I thought he'd chase you down the stairs at one point or another
 
Oct 28, 2014 at 2:50 AM
beep boop
Bobomb says: "I need a hug!"
Join Date: Aug 16, 2014
Location: no
Posts: 845
Age: 23
Hey, is there any way that you can make a command for tsc that works like FAC, only can draw from multiple face sets? If you can, that would be great. What I mean by that is that 1 face set would be 0000, another would be named 0001, and so on, and can use the faces like normal. Thanks regardless. Sorry for a bump, but I saw it and didn't notice until now. Sorry.
 
Oct 28, 2014 at 3:21 AM
thinks dogs are cool
"All your forum are belong to us!"
Join Date: Apr 6, 2014
Location: a bathroom
Posts: 620
why can't you just use <FAC
 
Oct 28, 2014 at 3:24 AM
beep boop
Bobomb says: "I need a hug!"
Join Date: Aug 16, 2014
Location: no
Posts: 845
Age: 23
I am going to need the ability to use more than one face set, so the story can be more detailed.
 
Oct 28, 2014 at 3:31 AM
thinks dogs are cool
"All your forum are belong to us!"
Join Date: Apr 6, 2014
Location: a bathroom
Posts: 620
but what do you mean by more than one faceset
do you mean extending the height of the face.bmp/pbm?
 
Oct 28, 2014 at 3:32 AM
beep boop
Bobomb says: "I need a hug!"
Join Date: Aug 16, 2014
Location: no
Posts: 845
Age: 23
I don't think that would work. What I mean is it would choose a face set, then choose a face from that face set to display, so I can add a face for most npcs in my mod.
 
Oct 28, 2014 at 3:34 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
That's more work than it originally is
Just use <FAC normally
 
Oct 28, 2014 at 3:35 AM
leader of the meme team feat. tom, snaf and polad
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Jan 24, 2014
Location: Polar✪
Posts: 300
Bionicobot said:
I don't think that would work.
It does though.

You can extend facesets with no issues.
 
Top