YesNoOk
avatar

Helper (SCTRL) 1.0 + 1.1b (Read 95645 times)

Started by Odb718, October 13, 2015, 09:00:46 pm
Share this topic:
Helper (SCTRL) 1.0 + 1.1b
New #1  October 13, 2015, 09:00:46 pm
  • *****
  • Shame on you!
    • USA
Creates another instance of the player as a helper character.

Required parameters:
    none
Optional parameters:
    helpertype = type_string (string)        This parameter is deprecated; player-type helpers are not supported. If helpertype = normal, then the helper will be allowed to move off the edge of the screen. Furthermore, the camera will not move to try to keep the helper on screen. If helpertype = player, then the helper will be constrained to the screen and will be followed by the camera, just like a normal player. Defaults to normal. If you plan to use a helper for camera manipulation, do not use a player-type helper; instead use the ScreenBound controller in a normal helper with the "movecamera" parameter.

    name = "name_string" (string)        Specifies a name for this helper, which must be enclosed in double quotes. If omitted, the name defaults to "<parent>'s helper", where <parent> represents the name of the player creating the helper.

    ID = id_no (int)        Sets an ID number to refer to this helper by. Defaults to 0.

    pos = off_x, off_y (int)        Specifies the x and y offsets to create this helper at. The precise meaning of these parameters is dependent on the postype. Defaults to 0,0.

    postype = postype_string (string)        postype_string specifies the postype -- how to interpret the pos parameters. In all cases, a positive y offset means a downward displacement. In all cases, off_y is relative to the position of the player. Defaults to P1

        Valid values for postype_string are the following:

        p1            Interprets offset relative to p1's axis. A positive off_x is toward the front of p1.

        p2            Interprets offset relative to p2's axis. A positive off_x is toward the front of p2. If p2 does not exist, the position is calculated with respect to p1 and a warning is logged.

        front            Interprets off_x relative to the edge of the screen that p1 is facing toward. A positive off_x is away from the center of the screen, whereas a negative off_x is toward the center.

        back            Interprets off_x relative to the edge of the screen that p1 is facing away from. A positive off_x is toward the center of the screen, whereas a negative off_x is away from the center.

        left            Interprets off_x relative to the left edge of the screen. A positive off_x is toward the right of the screen.

        right            Interprets off_x relative to the right edge of the screen. A positive off_x is toward the right of the screen.

    facing = facing (int)        If postype is left or right, setting facing to 1 will make the helper face the right, and a value of -1 makes the helper face left. For all other values of postype except p2, if facing is 1, the helper will face the same direction as the player. If facing is -1, the helper will face the opposite direction. In the case of postype = p2, facing has the same effect as above, except it is with respect to p2's facing. Defaults to 1.

    stateno = start_state (int)        Determines the state number that the helper spawns into. Defaults to 0.

    keyctrl = ctrl_flag (boolean)        If ctrl_flag is 1, then the helper is able to read command input from the player (e.g., the keyboard or joystick). Also, the helper will inherit its root's State -1. If ctrl_flag is 0, then the helper does not have access to command input, and does not inherit State -1. The default value of ctrl_flag is 0.

    ownpal = pal_flag (boolean)        If pal_flag is 0, the helper will inherit its parent's palette. If the parent's palette is temporarily changed (eg. by a PalFX controller), the changes will be reflected in the helper too. If pal_flag is 1, the helper will receive its own working palette, that is independent of its parent's. Defaults to 0.

    supermovetime = move_time (int)        Specifies the number of ticks that the helper should be unfrozen during a SuperPause. Defaults to 0.

    pausemovetime = move_time (int)        Determines the number of ticks that the helper should be unfrozen during a Pause. Defaults to 0.

    size.xscale (float)        See below.
    size.yscale (float)        See below.
    size.ground.back (int)        See below.
    size.ground.front (int)        See below.
    size.air.back (int)        See below.
    size.air.front (int)        See below.
    size.height (int)        See below.
    size.proj.doscale (int)        See below.
    size.head.pos (int,int)        See below.
    size.mid.pos (int,int)        See below.
    size.shadowoffset (int)        These parameters have the same meaning as the corresponding parameters in the root's CNS file. You can specify one or more of these parameters to change it to a value suitable for this helper. Otherwise, they default to the values inherited from the parent.

Note:
Any helper spawned before the round start during the intro(s) will be destroyed if the intro is skipped.

Example:
Code:
[State 0, Helper]
type = Helper
trigger1 = time = 0
helpertype = normal ;player
name = "Odb718's helper"
ID = 718
stateno = 187
pos = 41,-87
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
;size.xscale =
;size.yscale =
;size.ground.back =
;size.ground.front =
;size.air.back =
;size.air.front =
;size.height =
;size.proj.doscale =
;size.head.pos = ,
;size.mid.pos = ,
;size.shadowoffset =
;ignorehitpause =
;persistent =


1.1b Exclusive

Optional parameter:

remappal = dst_pal_grp, dst_pal_item (int, int)
Forces a palette remap of the helper's indexed-color sprites to the specified palette. This parameter is used only if ownpal_flag is non-zero. If dst_pal_grp is -1, this parameter will be ignored. Defaults to -1, 0.

RELATED TRIGGERS:
IsHelper
NumHelper
ParentDist
RootDist

RELATED SCTRL:
BindToParent
BindToRoot
DestroySelf
ParentVarAdd
ParentVarSet
vVv Ryuko718 Updated 10/31/22 vVv
Last Edit: June 12, 2023, 04:02:12 pm by Odb718
Re: Helper (SCTRL) 1.0 + 1.1b
#2  October 28, 2015, 03:07:13 pm
  • ******
    • www.justnopoint.com/
added 1.1b documentation
Re: Helper (SCTRL) 1.0 + 1.1b
#3  November 26, 2015, 05:24:04 am
  • ******
    • www.justnopoint.com/
Added related triggers and SCTRLs
Re: Helper (SCTRL) 1.0 + 1.1b
#4  October 24, 2016, 02:56:44 am
  • ******
    • www.justnopoint.com/
Some things to note about helpers and helpertype = player/normal

If you use helpertype = player then your helper will be able to access the -2 and -3. But it also is treated as a character and not a helper. As said in the first post the camera tracks it, it stays on screen. To add to that the opponent will auto turn toward the helper when close similar to Team mode. and the helper inherits all the push box properties of the player.

To have a helper access the -1 (.cmd) you must have keyctrl = 1 as a parameter.
Re: Helper (SCTRL) 1.0 + 1.1b
#5  October 25, 2016, 01:10:34 am
  • ***
Could the Helpertype = player be used to achieve vertical zoom in 1.1?
Or would that be a stupid idea?

For example, your character does a super jump.
While doing so, he spawns a helper to reach the edge of the stage and cause it to zoom out.

Just curious, because 1.1 doesn't have vertical zoom.
Re: Helper (SCTRL) 1.0 + 1.1b
#6  October 25, 2016, 02:15:06 am
  • ******
    • www.justnopoint.com/
I don't use 1.1 so I don't know but if you test it post the results! Does it do so if P1 is on the ground and P2 super jumps or vice versa? If yes then I think this would work.
Re: Helper (SCTRL) 1.0 + 1.1b
#7  October 25, 2016, 07:43:45 pm
  • ***
Well currently 1.1 only has horizontal zoom when Players reaches the edge of the stage on the sides.
When you have a super jump, the camera follows, but does not zoom out.
The result is not seeing the other player when you reach a certain point.

So I thought, if the jumping character (or maybe both) would spawn a helper to reach the edge for him, the stage might zoom.
I might play around with this idea whenever I got some time :)
Re: Helper (SCTRL) 1.0 + 1.1b
#8  October 28, 2016, 02:30:23 pm
  • ***
Well, it kinda worked
The camera follows the jumping player in the vertical direction, but the player on the ground still won't be followed.
And if both players are near an edge, it's won't work either.


This was achieved by screenbound instead of helpertype = player.
The latter caused p2 to turn and such.

Code in spoiler, I put it in the jump state, dunno if there'd be a better place for that.
It's not recommended for stages without stagezoom though, it will can strange panning behavior instead.
I'm sure this code can be tweaked further.

Spoiler, click to toggle visibilty
Re: Helper (SCTRL) 1.0 + 1.1b
#9  October 29, 2016, 09:12:40 am
  • *****
  • Shame on you!
    • USA
I've made a "runner" helper for one of my characters. Either Sagat or N00B Saibot. It was for a throw so P1 wouldn't go out of bounds and that P2 would come back to the area of the screen with the most room. It took a couple tries to get it to work properly. I'll try to track down the code and post what I used. It may work for what you want. It should.

In the picture, does the stage's horizontal zoom work further out? Like was it maxed out? If it was it's acting like it has to because of the stage's definitions, not because the helper didn't work right.
vVv Ryuko718 Updated 10/31/22 vVv
Re: Helper (SCTRL) 1.0 + 1.1b
#10  October 29, 2016, 03:43:59 pm
  • ***
In the picture, does the stage's horizontal zoom work further out? Like was it maxed out? If it was it's acting like it has to because of the stage's definitions, not because the helper didn't work right.

That might be it, I haven't touched mugen for ages myself.
I should look for other 1.1 zoom stages to try.

Re: Helper (SCTRL) 1.0 + 1.1b
#11  January 21, 2017, 04:56:33 am
  • ******
    • www.justnopoint.com/
Another note to make Helpers continue adding to hit count you will want to make sure they do not get destroyed too soon. Make the last frame of the anim group -1 and the time -1.  To destroy the helper you want the target to not be in MoveType = H
Re: Helper (SCTRL) 1.0 + 1.1b
#12  January 23, 2017, 09:09:39 pm
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
Are there any other known strategies for making a character appear to have learned? The simplest I could think of was to have a character count the seconds it was defeated in and update its "random conditions" accordingly as the match unfolds.

Felicia's projectile safety check is basically checking for and error. "Did I get through the projectile with this?" "Nope, try this one." "Did that work?" "Yes." "Then keep using it.

Doesn't work for pure helper projectiles though, sadly. I may put an invisible projectile in mine that stays alive as long as the helper is just so projectile detection can work.

Quoting my latest post in that thread because I just realized a potential solution for not being able to detect helper projectiles. The idea is to create an invisible, unhittable projectile with a guard.dist of 0 so that it can be used to detect that there is a helper out there that is a projectile. Maybe we could even make some clever use of parameters like ID to detect other properties. Can't recall if there's a way to get an ID of an enemy's projectile that's currently out there, though.
Last Edit: January 23, 2017, 09:21:48 pm by Jesuszilla
Re: Helper (SCTRL) 1.0 + 1.1b
#13  January 23, 2017, 11:16:18 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Nah, only if a specific ID exists. No projID for a redirect. Just numprojID which of course returns how many of those projectiles are alive.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Helper (SCTRL) 1.0 + 1.1b
#14  January 25, 2017, 09:35:23 pm
  • ******
    • www.justnopoint.com/
If you want Helpers that use sounds for an intro to stop playing correctly when you skip the intro be sure to place the sounds in the root and use redirection.

You can't stop a helper's sound if you skip the intro.

More details
Re: Helper (SCTRL) 1.0 + 1.1b
#15  February 15, 2017, 04:04:39 pm
  • ******
    • www.justnopoint.com/
As stated earlier, once a helper/fireball connects it must remain alive for the following hits to add to the combo counter. To do this your last frame of the helper should be invisible -1 with a time of -1

If you use a lot of helpers/fireballs in your moves you may wish to use a method that will only keep the 1st helper alive while killing off other helpers that hit after the fact.

To do this you can apply this to your helpers:

This is for the actual fireball/attack
Code:
[State ]
type=parentvarset
trigger1=!parent,var(1)
trigger1=movehit=1
var(1)=1

[State ]
type=selfstate
trigger1=movehit=1
value=1001+(parent,var(1)=1)

[State ]
type = changestate
trigger1 = moveguarded
value = 1001
ignorehitpause=1


This is the state the helper goes into to destroy itself
This version destroys itself after the animation plays. So adjust the time as needed
Code:
[State ]
type=destroyself
trigger1=ishelper
trigger1=Time>=12


This is the state the 1st helper that hits goes into to destroy itself
This version stays alive until the opponent is no longer in a hit state
Code:
[State ]
type=parentvarset
trigger1=1
var(1)=2

[State ]
type=destroyself
trigger1=ishelper
trigger1=P2MoveType!=H

And in your -2 be sure to place this code so your var(1) will reset to 0 after P2 recovers
Code:
[State -2, VarSet]
type = VarSet
trigger1 = P2MoveType != H
var(1) = 0

details
http://mugenguild.com/forum/topics/keep-only-1-helper-alive-hit-178496.0.html
Last Edit: February 15, 2017, 05:18:28 pm by Just No Point
Re: Helper (SCTRL) 1.0 + 1.1b
#16  March 28, 2017, 06:04:46 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
1.1b Exclusive

Optional parameter:

remappal = dst_pal_grp, dst_pal_item (int, int)
Forces a palette remap of the helper's indexed-color sprites to the specified palette. This parameter is used only if ownpal_flag is non-zero. If dst_pal_grp is -1, this parameter will be ignored. Defaults to -1, 0.
Although the remappal parameter in the Helper state controller is exclusive to 1.1, you can still use a RemapPal controller within the Helper's code in both 1.0 and 1.1.

However RemapPal affects the pal used by sprites globally.  It doesn't matter if the RemapPal controller is in the Helper states or root player's states - it will have exactly the same effect.

Last Edit: March 28, 2017, 07:07:38 pm by altoiddealer
Re: Helper (SCTRL) 1.0 + 1.1b
#17  July 31, 2017, 05:02:15 am
  • ******
  • If you’re gonna reach for a star...
  • reach for the lowest one you can.
    • USA
    • network.mugenguild.com/jmorphman
Crossposting this, from the Command thread, here:
An interesting quirk that me and JustNoPoint discovered a few weeks ago (by accident): it's pretty well known that because MUGEN processes characters/helpers one at a time, there is sometimes a one-tick delay in relaying information from one character/helper to another, based on what order the former player/helper's code is executed in relation to the latter. One example of this might be something like this: when P2's time = 60, they set var(0) to 60; and P1 has a ChangeState that sends them into State 195 whenever Enemy, var(0) = 60, then P1 will be sent to State 195 one tick after P2's time = 60. This is because P1's code is executed before P2's code is, and so when P1 checks P2's var(0) on the very same tick that P2's time = 0, it won't have been set to 60 yet!

The Command trigger, however, doesn't work like this! If P2 were to input "down" on a particular tick, then P1 would be able to see that P2 has indeed input "down" on the very tick; this is also true of Helpers (if they have keyctrl = 1, of course). What is most likely happening is that ALL active players/helpers have their commands processed before their respective code is run, so there's no delay relaying that information back and forth. This might be true of a few other triggers (maybe Time? not sure what else), but neither us has done any testing.
Applying this to a Helper offers a pretty easy of fixing the reverse command bug (you would basically use the helper to process all commands, and have it always face to the right, so that the character can always know what the player's input is without the commands reversing or anything), and on the more complicated end of things, making a lag-free buffering system.
Re: Helper (SCTRL) 1.0 + 1.1b
#18  October 12, 2017, 10:38:02 pm
  • ***
  • too obsessed with NES stuff
    • USA
Regardless of the current team mode, for all helpers: TeamMode = Single. If you need the helper to detect what team mode you're in, you need to use the root's TeamMode instead.
might as well put this forum about bootleg games here
BGC Forums
Re: Helper (SCTRL) 1.0 + 1.1b
#19  May 19, 2020, 11:28:02 pm
  • **
  • Expert Noob
  • I am a lover and a fighter!
    • USA
Helpful little tip, From a Noob 4 Anyone. ;)

Ran into this problem while working on a character.

MUGEN has a limit as to how many helpers can be on the screen at once (configurable in mugen.cfg in the data folder.). So if the limit is reached, no other helpers will spawn/appear no matter what. If the helper in question is stationary and is never de-spawned/destroyed, then it can/will look like only one helper has spawned when really the maximum amount has actually spawned. To help prevent this, you can place the following trigger into your helper state.

Code:
triggerall = !NumHelper(*)

What this trigger is basically saying is; "As long as (triggerall) there are no helpers with the ID of * currently existing (!NumHelper(*)) then spawn the helper with ID *. (Replace the star with the ID number you gave the helper.)

This will make it so that only one instance (or spawn) of the helper will appear during the conditions specified in the other triggers. There by preventing the helper limit from being reached.

Hope this will be of help to all you fine people in the future. :)
May you always win every round, both in MUGEN and Life. :)
Re: Helper (SCTRL) 1.0 + 1.1b
#20  February 25, 2022, 08:31:33 pm
  • ******
    • www.justnopoint.com/
If you wish to have a helper be immune to reversaldefs be sure that theu have a hitoverride set for everything that you want them to be immune for.

Even if you have them without CLSN or nothitby