YesNoOk
avatar

mode selection + groove bars & bugs fixed (Read 7039 times)

Started by Laxxe23, August 18, 2009, 02:21:31 pm
Share this topic:
mode selection + groove bars & bugs fixed
New #1  August 18, 2009, 02:21:31 pm
  • ****
  • Aka ShadesTeam/Zeckle
mode selection (groove selection) (during intro)
Note: This is for two modes, if you wish more than two grooves, then use this code instead of the first 3 sets of code

Spoiler, click to toggle visibilty

[state 190, choose var];starts round with a random groove. 
type = VarRandom
trigger1 = time = 0
v = 4
range = 0,1

[state 190]
type = varset
trigger1 = command = "up"
v=4
vaule = 0

[state 190]
type = varset
trigger1 = command = "down"
v=4
vaule = 1

[State 190, Explod]
type = Explod
trigger1 = var(4)=0
trigger1 = numexplod(18)=0
anim = 137
ID = 18
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 0
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermove
pausemove
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0


[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = var(4)=1
id = 17

[State 190, Explod]
type = Explod
trigger1 = var(4)=1
trigger1= numexplod(17)=0
anim = 138
ID = 17
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 0
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermove
pausemove


scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0


[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = var(4)=0
id = 18




have the explode be the word with a
little arrow pointing up on the top of it
like:

[Aggression]
    \/
    /\
  [Power]

(origionally made this for a friend to use, so I thought why not share it)
edit
also need to delete the variable reset at the end of the round in the common1


Spoiler, click to toggle visibilty
thanks [E] for pointing out the lack of numexplod

NOTE: Screwed up with the id of the explods before, the first explod should have been 18 and not both of them 17, fixed now

Updates Updates Updates

Adding a groove bar

1.  Getting Ready

Several things First you will need a bg for you bar (Sorry for the lack of pictures Ill update this once I get My laptop back)
_____________
|___________/

You will also need a bar

 |////////////

Make sure you have a variable set aside for this

2.  Setting up your sprites

You will want an axis in your sff for the bg to be on the lower left
   _____________
 +|___________/

and for the axis on the bar itself to be on the middle left

  +|////////////

Make sure you set up a propper animation for each of the two sprites


3.  The actual code

In the -3 state or -2 (ill look when i get my laptop back, so its one of those)
add an explod


;this one will be used if the second groove is chosen
[state -2]
type = Explod
trigger1 = var(4)=1
trigger1= numexplod(17)=0
trigger1 = numexplod(27)=0
trigger1 = teamside=1
anim = 238                             ;lets use this animation for the grooves bg for now
ID = 27
pos = 10,220
postype =left ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = 1,1
sprpriority =999
removetime=-1

;and for the bar lets use something three pixel over so it will fit
;you will also need to lower the bar abit, lets say five pixels

[state -2]
type = Explod
trigger1 = var(4)=1
trigger1 = numexplod(27)=1
trigger1= teamside=1
anim = 338                             ;lets use this animation for the grooves fill bar for now
ID = 37
pos = 13,215
postype = left
facing = 1
vfacing = 1
bindtime = -1
scale = 1,1
sprpriority = 9999
removetime=-1
;-----------------------------------------------------------------------------------
This section is a repeat except for the fact it will allow p2 to use the bar on his/her side
;-----------------------------------------------------------------------------------
[state -2]
type = Explod
trigger1 = var(4)=1
trigger1= numexplod(17)=0
trigger1 = numexplod(27)=0
trigger1 = teamside=2
anim = 238                             
ID = 27
pos = -10,220
postype =right ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = -1
scale = 1,1
sprpriority = 999
removetime=-1

[state -2]
type = Explod
trigger1 = var(4)=1
trigger1 = numexplod(27)=1
trigger1= teamside=2
anim = 338                             
ID = 37
pos = -13,215
postype = right
facing = -1
vfacing = 1
bindtime = -1
scale = 1,1
sprpriority = 9999
removetime=-1
;-----------------------------------------------------------------------------------

;this is where the new variable comes in. 
[state -2]
type = varset
trigger1 = 1
fv=5
value = (100*power/const(data.power))*0.01;<<<<<Note 1>>>>>

[state -2];or 3
type = modifyexplod
trigger1 = var(4)=1
trigger1 = numexplod(27)=1
ID=37                                ;this modify's the powerbar
scale =fvar(5),1

;or combine the previous two parts and have less work for yourself to do, just put (power/3000) in place of fvar(5)



Thanks Valodim for stopping me from making some stupid mistakes in this guide and for pointing out some bugs after I posted this part of the last update. 

Spoiler: random notes (click to see content)

Note 1*
Big thanks to Syn for helping me complete my code and allowing me to use his powerbar scaling values

Shades 2 site:Shades of Manhattan
Last Edit: October 04, 2009, 12:53:27 pm by Shades team
Re: mode selection
#2  September 03, 2009, 05:43:45 pm
  • ****
  • Club -SyN- in my past life
    • USA
    • negative-edge.net
If you are going to use this for choosing grooves assigned to a specific var value:

[state 190]
type = varset
trigger1 = command = "up"
v=4
vaule = 0

[state 190]
type = varset
trigger1 = command = "down"
v=4
vaule = 1

Then this block below is not needed at all,

[state 190, choose var]
type = VarRandom
trigger1 = time = 0
v = 4
range = 0,1

Btw Var random automatically chooses the implemented values for you.
And with the trigger being time zero, it will always be set @ value = 0 which makes the var random again worthless.
Re: mode selection
#3  September 03, 2009, 09:45:17 pm
  • ****
  • Aka ShadesTeam/Zeckle
var random was meant for it to start randomly, not end randomly. 
Shades 2 site:Shades of Manhattan
Re: mode selection
#4  September 03, 2009, 10:09:10 pm
  • ****
  • stillRetired.
  • Formerly Known As Genesis
    • USA
    • www.mediafire.com/folder/7j1slkpa7lm0w/Public_Works
I may use this
Re: mode selection
#5  September 04, 2009, 04:57:34 am
  • ****
  • Club -SyN- in my past life
    • USA
    • negative-edge.net
var random was meant for it to start randomly, not end randomly. 

Who ever said anything about ending anything.

Bottom line, you have it set up where you can MANUALLY chose that vars value.
Why in the hell would you need a var random in the first place.
Thats what I am saying.

And your trigger is time = 0 meaning, and I will repeat this, the value will always remain at 0 making the var random sctrl completely useless.

For whatever silly reason you want to use the var random, the trigger should be trigger1 = 1 to make it randomize the values by each tick that passes.
Last Edit: September 04, 2009, 05:06:05 am by -SyN-
Re: mode selection
#6  September 04, 2009, 08:44:50 pm
  • ****
  • Aka ShadesTeam/Zeckle
so when the time = 0 ie the state starts? your saying it wouldnt work to randomize it, the point is if your fighting against a cpu you wont always fight against the same mode. 

Actually its in a character and working currently right now the way its supposed to. 
http://mugenguild.com/forumx/index.php?topic=104725.0
Shades 2 site:Shades of Manhattan
Last Edit: September 04, 2009, 08:49:09 pm by Shades team
Re: mode selection
#7  September 05, 2009, 12:35:36 am
  • ****
  • Club -SyN- in my past life
    • USA
    • negative-edge.net
so when the time = 0 ie the state starts?

It wont have a chance to choose.

the point is if your fighting against a cpu you wont always fight against the same mode. 

Then additional triggers would be needed, at least I would think so.

[state 190, choose var]
type = VarRandom
trigger1 = time = 0
v = 4
range = 0,1

could be

[state 190, choose var CPU ONLY]
type = VarRandom
triggerall = ishometeam && matchno > 1 ;<---- works in arcade mode only
trigger1 = roundstate < 2 ;<---randomly chooses the var value until the intro is played out or skipped.
v = 4
range = 0,1

Triggerall = ishometeam && matchno > 1 id's the arcade mode or team arcade mode for mugen after the first match since either arcade mode allows more than 1 match, not rounds. the ishometeam in arcade mode will id the cpu no matter if the human player is either player 1 or player 2.

Allowing this for match no 1 will interfere with other modes since the ishometeam trigger will be assigned to player one only if not using arcade mode and there is really no way around it unless that paticular char uses a sorta cpu detection, AI related method.

Anyway You never explained the purpose of the var random when you got two manual triggers for the same thing since the start of this post, thats why I said it was pointless.
Re: mode selection
#8  September 05, 2009, 12:46:48 am
  • avatar
  • ******
    • USA
since shades only uses 2 modes you may want to add a RANDOM option aswell, that would fix any problem without needing to detect the PCU player at all.

it would be like this

Quote
AGGRESION - option: up

RANDOM - neutral cursor: dont touch anything

POWER - option: down

this way the character would always start in RANDOM mode and then the person can either choose a mode or just leave it at random and the AI will always start at random so no need to difference any player or CPU player.
Re: mode selection
#9  September 05, 2009, 12:54:33 am
  • ****
  • Aka ShadesTeam/Zeckle
so when the time = 0 ie the state starts?
Spoiler, click to toggle visibilty
So im mistaken that time = 0 works? (spoilered post because it was long, not to be rude or anything)
Shades 2 site:Shades of Manhattan
Re: mode selection
#10  September 08, 2009, 12:09:38 am
  • ******
  • [E]
    • Mexico
no, syn is mistaken, just ignore all that he has said.
Re: mode selection updated for more than two grooves
#11  September 10, 2009, 12:27:25 am
  • ****
  • Aka ShadesTeam/Zeckle
updated (look in spoiler)
Shades 2 site:Shades of Manhattan
Re: mode selection updated for more than two grooves
#12  September 10, 2009, 05:17:57 pm
  • ******
  • [E]
    • Mexico
Don'0t you need a numexplod trigger to avoid making several explods with the same image? maybe with a static menu is not noticeable, but it might be so if you have a nice animation of the groove fading in or something.
Re: mode selection updated for more than two grooves
#13  September 10, 2009, 05:28:49 pm
  • ****
  • Aka ShadesTeam/Zeckle
done and thanks, didnt think about that
Shades 2 site:Shades of Manhattan
Re: mode selection + bars & bugs fixed
#14  September 28, 2009, 08:52:28 pm
  • ****
  • Aka ShadesTeam/Zeckle
Updated bar code to work 100 percent. 
[size=5pt]its hard when you dont have anything to work with, but easy once you do :P[/size]
Shades 2 site:Shades of Manhattan