Scripts I need

Description: Have idea for a script, but you can't make it? Post it here!
Moderators: Lx Xzit, Yoshi021, 5438A38A, Moderators, Semi-moderatos

Alvespires M
Topic author, Count
Count
Avatar
Alvespires M
Topic author, Count
Count
Age: 18
Reputation: 16
Posts: 222
Joined: 20 Aug 2016
Location: Koopa Troopa Beach

Post #1by Alvespires » 7 May 2017, 17:21

Hello.I'm really nedding a really simple Script,How do you know if one player is standing left or right from one particular NPC?I really need it but have no idea at all.

Also,I also need a way of making an NPC or/and Background do exactly the same movement as player(Well,just to jump,accuratly chase right/left,fall at same speed,Etc.)

The last one is not a script,but a question,This really bothered me a lot,and I'm here anyways,so I'm going to ask:There's a Global Variable Limit?Having too much make your episode laggy?

Well,that's it.
"This giant fish is a mouth breeder, so it spits babies out of its mouth at Mario." - Nintendo Power Strategy Guide for Super Mario Bros. 3

I don't really have anything to say.

I think I also probably lost it.

I'm supporting:

Spoiler

Image

I know I'm annoying sometimes,so please send me a PM if one of my messages hurts your feelings or if it's stupid so you can help me become a better person.

Spoiler
"And then they said something about 'Vandalism' being a bad thing. What a bunch of hypocrites."

Status: Trying to be more social. Trying to.

Yoshi021 M
Moderator
Moderator
Avatar
Yoshi021 M
Moderator
Moderator
Age: 18
Reputation: 120
Posts: 667
Joined: 15 Feb 2016
Location: Yoshi's Island

Post #2by Yoshi021 » 7 May 2017, 19:13

1) For the first, simple name an NPC in the advanced settings II with the name 'name' and make two variables, one called 'ID' and the other called 'dir'. When the script is activated dir = -1 when the player is to the left from the NPC and 1 when he is right to the NPC.

Code: Select all

v(id) = getIDbyName("name")
do
  if NPC(v(id)).x > char(1).x then
    v(dir) = -1
  else
   v(dir) = 1    
  end if
  call sleep(1)   
loop
   


2)Place a BGO in a layer called 'Att-Player1(name)' and the bgo will do the same movements as the player.
3) I haven't used a lot od global variables, but you should be able to have 100 gv without the game lagging.
Links
ImageImageImage
Image
Image
"Going to University is FUN!" :pardon:

Alvespires M
Topic author, Count
Count
Avatar
Alvespires M
Topic author, Count
Count
Age: 18
Reputation: 16
Posts: 222
Joined: 20 Aug 2016
Location: Koopa Troopa Beach

Post #3by Alvespires » 9 May 2017, 17:57

Actually,there's a way to make that background/NPC chase you just when a condiction is met?And stand WHERE it is when it's not instanded of backing to it's original place?
And,there's a way of making it move the opposing direction?
"This giant fish is a mouth breeder, so it spits babies out of its mouth at Mario." - Nintendo Power Strategy Guide for Super Mario Bros. 3

I don't really have anything to say.

I think I also probably lost it.

I'm supporting:

Spoiler

Image

I know I'm annoying sometimes,so please send me a PM if one of my messages hurts your feelings or if it's stupid so you can help me become a better person.

Spoiler
"And then they said something about 'Vandalism' being a bad thing. What a bunch of hypocrites."

Status: Trying to be more social. Trying to.

Ruther M
Citizen
Citizen
Avatar
Ruther M
Citizen
Citizen
Reputation: 0
Posts: 8
Joined: 23 Sep 2017
Website

Post #4by Ruther » 7 Oct 2017, 3:33

v(id) = getIDbyName("name")

do
call sleep(1)
loop until condiction

do
if char(1).x+16< NPC(v(id)).x+(weightnpc/2) then
v(dir) = -1
else
v(dir) = 1
end if

call sleep(1)
loop


and to programming(check in execution parallax) your npc on another script
Spoiler
with npc(sysval(param1))
if val(dir)=-1 then
.xsp=-2
elseif val(dir)=1 then
.xsp=2
end if
end with


Return to “Script requests”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest