Hi Everyone
currently iv been making a spell e-z :The hero go at height "500" than he throw a missile.... This missile should not jump or do arc since the hero is already in the air!!
for this use i have work on Engine to make it for me But there is a problem Its alway jumps!!!
I guess there a special formula for this its should do an oblique From up to down & Down to up : we could call it like a Kind of Bullet system
my code is pretty crappy i guess ..... i would like to not use other people stuff and use mine becuz i made it and i know all code so i know how to modify it. I think this problem require more than only reading and spaming answer : i would like to get feedback after answer from people
p.s. : there is a bug at the end It wont go fully to ground like it should maybe its the formula or condition ?
here is my code so far
currently iv been making a spell e-z :The hero go at height "500" than he throw a missile.... This missile should not jump or do arc since the hero is already in the air!!
for this use i have work on Engine to make it for me But there is a problem Its alway jumps!!!
I guess there a special formula for this its should do an oblique From up to down & Down to up : we could call it like a Kind of Bullet system
my code is pretty crappy i guess ..... i would like to not use other people stuff and use mine becuz i made it and i know all code so i know how to modify it. I think this problem require more than only reading and spaming answer : i would like to get feedback after answer from people
p.s. : there is a bug at the end It wont go fully to ground like it should maybe its the formula or condition ?
here is my code so far
-
JumpX Engine
- Events
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_Index_Size Equal to 0
-
Then - Actions
- Trigger - Turn on JumpX Loop <gen>
- Else - Actions
-
If - Conditions
- -------- Increase the index size --------
- Set JPX_Index_Size = (JPX_Index_Size + 1)
- -------- Dynamic Index --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_Index_Size Greater than JPX_Index_maxSize
-
Then - Actions
- Set JPX_Index[JPX_Index_Size] = JPX_Index_Size
- Set JPX_Index_maxSize = JPX_Index_Size
- Else - Actions
-
If - Conditions
- -------- Dynamic Index End --------
- Set JPXInt = JPX_Index[JPX_Index_Size]
- -------- Setup those arrays --------
- -------- --------------------------------------------------------- --------
- Set JPX_CASTER[JPXInt] = JumpXCaster
- -------- ################ --------
- Set TempLoc = (Position of JPX_CASTER[JPXInt])
- Set TempLoc2 = JumpXPoint2
- -------- ################ --------
- -------- --------------------------------------------------------- --------
- Set JPX_ANGLE[JPXInt] = JumpXAngle
- Set JPX_MaxDistance[JPXInt] = JumpXMaxDistance
- -------- --------------------------------------------------------- --------
- -------- ################ --------
- -------- --------------------------------------------------------- --------
- Set JPX_CurDistance[JPXInt] = 0.00
- Set JPX_FHEIGHT[JPXInt] = 0.00
- Set JPX_Formula[JPXInt] = 0.00
- -------- --------------------------------------------------------- --------
- Set JPX_COUNTER[JPXInt] = 0
- Set JPX_XCOUNTER[JPXInt] = 0
- -------- --------------------------------------------------------- --------
- -------- ################ --------
- -------- --------------------------------------------------------- --------
- -------- if true than set arc if false set max height --------
- Set JPX_SPEED[JPXInt] = JumpXSpeed
- Set JPX_ARC[JPXInt] = JumpXArc
- Set JPX_MAXHEIGHT[JPXInt] = JumpXMaxHeight
- -------- --------------------------------------------------------- --------
- -------- --------------------------------------------------------- --------
- Set JPX_ARCYesNo[JPXInt] = JumpXArcOrHeight
- Set JPX_MissileOrUnit[JPXInt] = JumpX_MissileOrUnit
- -------- --------------------------------------------------------- --------
- Set JPX_String[JPXInt] = JumpXString
- Set JPX_String2[JPXInt] = JumpXString2
- -------- --------------------------------------------------------- --------
- Set JPX_TIME_COUNTER1[JPXInt] = JumpXTIME_COUNTER1
- Set JPX_TIME_COUNTER2[JPXInt] = JumpXTIME_COUNTER2
- -------- --------------------------------------------------------- --------
- Set JPX_DMG[JPXInt] = JumpXDMG
- Set JPX_DMG_AOE[JPXInt] = JumpXDMG_AOE
- Set JPX_DUMMY_ANIMATION_SPEED[JPXInt] = JumpXDUMMY_ANIMATION_SPEED
- Set JPX_DUMMY_BLUE[JPXInt] = JumpXDUMMY_BLUE
- Set JPX_DUMMY_GREEN[JPXInt] = JumpXDUMMY_GREEN
- Set JPX_DUMMY_RED[JPXInt] = JumpXDUMMY_RED
- Set JPX_DUMMY_SIZE[JPXInt] = JumpXDUMMY_SIZE
- -------- --------------------------------------------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_ARCYesNo[JPXInt] Equal to True
-
Then - Actions
- Custom script: set udg_JPX_Formula2[udg_JPXInt] = ( 4 * udg_JPX_ARC[udg_JPXInt])
-
Else - Actions
- Custom script: set udg_JPX_Formula2[udg_JPXInt] = ( 4 * udg_JPX_MAXHEIGHT[udg_JPXInt] / udg_JPX_MaxDistance[udg_JPXInt])
-
If - Conditions
- -------- --------------------------------------------------------- --------
- -------- ################ --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_MissileOrUnit[JPXInt] Equal to True
-
Then - Actions
- Unit - Create 1 Dummy DUMMY for (Owner of JPX_CASTER[JPXInt]) at TempLoc facing (Angle from TempLoc to TempLoc2) degrees
- Set JPX_MISSILE[JPXInt] = (Last created unit)
- Set TempLoc3 = (Position of JPX_MISSILE[JPXInt])
- Unit - Move JPX_MISSILE[JPXInt] instantly to TempLoc, facing JPX_ANGLE[JPXInt] degrees
- -------- ################ --------
- Special Effect - Create a special effect attached to the origin of JPX_MISSILE[JPXInt] using JPX_String[JPXInt]
- Set JPX_SFX[JPXInt] = (Last created special effect)
-
Else - Actions
- Set JPX_MISSILE[JPXInt] = JPX_CASTER[JPXInt]
- Set TempLoc3 = (Position of JPX_MISSILE[JPXInt])
- Unit - Move JPX_MISSILE[JPXInt] instantly to TempLoc, facing JPX_ANGLE[JPXInt] degrees
-
If - Conditions
- -------- ################ --------
- -------- --------------------------------------------------------- --------
- Set JPX_INITIALHEIGHT[JPXInt] = (Current flying height of JPX_MISSILE[JPXInt])
- -------- some stuff to make it good mui --------
- Set JPX_BOOLEAN[JPXInt] = True
- Set JPX_BOOLEANBomb[JPXInt] = True
- -------- --------------------------------------------------------- --------
- -------- basic stuff to make the missile take height when need :) --------
- Unit - Add Storm Crow Form to JPX_MISSILE[JPXInt]
- Unit - Remove Storm Crow Form from JPX_MISSILE[JPXInt]
- Unit - Turn collision for JPX_MISSILE[JPXInt] Off
- Custom script: set udg_JPX_FHEIGHT[udg_JPXInt] = GetUnitFlyHeight(udg_JPX_MISSILE[udg_JPXInt])
- Custom script: call RemoveLocation(udg_TempLoc)
- Custom script: call RemoveLocation(udg_TempLoc2)
- Custom script: call RemoveLocation(udg_TempLoc3)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
JumpX Loop
-
Events
- Time - Every 0.05 seconds of game time
- Conditions
-
Actions
-
For each (Integer JPX_LOOP) from 1 to JPX_Index_Size, do (Actions)
-
Loop - Actions
- -------- This let look everything cleaner. --------
- Set JPXInt = JPX_Index[JPX_LOOP]
- Set TempLoc = (Position of JPX_MISSILE[JPXInt])
- Set TempLoc2 = (TempLoc offset by JPX_SPEED[JPXInt] towards JPX_ANGLE[JPXInt] degrees)
- Set JPX_CURRENTHEIGHT[JPXInt] = (Current flying height of JPX_MISSILE[JPXInt])
- Set JPX_CurDistance[JPXInt] = (JPX_CurDistance[JPXInt] + JPX_SPEED[JPXInt])
- Custom script: set udg_JPX_Formula3[udg_JPXInt] = (udg_JPX_MaxDistance[udg_JPXInt] - udg_JPX_CurDistance[udg_JPXInt])
- Custom script: set udg_JPX_Formula4 [udg_JPXInt] =(udg_JPX_CurDistance[udg_JPXInt] / udg_JPX_MaxDistance[udg_JPXInt])
- Custom script: set udg_JPX_Formula[udg_JPXInt] = udg_JPX_Formula2[udg_JPXInt] * udg_JPX_Formula3[udg_JPXInt] * udg_JPX_Formula4[udg_JPXInt]
- Custom script: call SetUnitFlyHeight(udg_JPX_MISSILE[udg_JPXInt],GetLocationZ(udg_TempLoc) + udg_JPX_FHEIGHT[udg_JPXInt]+ udg_JPX_Formula[udg_JPXInt],0.)
- -------- Condition... --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_Formula[JPXInt] Greater than 0.00
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_CurDistance[JPXInt] Less than JPX_MaxDistance[JPXInt]
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Playable map area) contains TempLoc2) Equal to True
-
Then - Actions
- Unit - Move JPX_MISSILE[JPXInt] instantly to TempLoc2, facing JPX_ANGLE[JPXInt] degrees
-
Else - Actions
- Set JPX_MaxDistance[JPXInt] = 0.00
- Custom script: set udg_JPX_Formula[udg_JPXInt] = 0.
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_MissileOrUnit[JPXInt] Equal to True
-
Then - Actions
- Unit - Remove JPX_MISSILE[JPXInt] from the game
- Else - Actions
-
If - Conditions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
- -------- Actions --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_BOOLEANBomb[JPXInt] Equal to True
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_CurDistance[JPXInt] Greater than (JPX_MaxDistance[JPXInt] - 35.00)
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_Formula[JPXInt] Less than or equal to 0.00
-
Then - Actions
- Set JPX_BOOLEANBomb[JPXInt] = False
- Game - Display to (All players) the text: KILL THE MISSILE
- Animation - Change JPX_MISSILE[JPXInt] flying height to JPX_INITIALHEIGHT[JPXInt] at 0.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_MissileOrUnit[JPXInt] Equal to True
-
Then - Actions
- Unit - Remove JPX_MISSILE[JPXInt] from the game
-
Else - Actions
- Unit - Turn collision for JPX_MISSILE[JPXInt] On
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_CASTER[JPXInt] Equal to JPX_MISSILE[JPXInt]
- Then - Actions
- Else - Actions
-
If - Conditions
-
If - Conditions
- Special Effect - Destroy JPX_SFX[JPXInt]
- Unit - Create 1 Dummy DUMMY for (Owner of JPX_CASTER[JPXInt]) at TempLoc facing Default building facing degrees
- Set JPX_DUMMY[JPXInt] = (Last created unit)
- Unit - Add a 2.00 second Generic expiration timer to JPX_DUMMY[JPXInt]
- Animation - Change JPX_DUMMY[JPXInt]'s size to (JPX_DUMMY_SIZE[JPXInt]%, JPX_DUMMY_SIZE[JPXInt]%, JPX_DUMMY_SIZE[JPXInt]%) of its original size
- Animation - Change JPX_DUMMY[JPXInt]'s vertex coloring to (JPX_DUMMY_RED[JPXInt]%, JPX_DUMMY_GREEN[JPXInt]%, JPX_DUMMY_GREEN[JPXInt]%) with 0.00% transparency
- Animation - Change JPX_DUMMY[JPXInt]'s animation speed to JPX_DUMMY_ANIMATION_SPEED[JPXInt]% of its original speed
- Special Effect - Create a special effect at TempLoc using JPX_String2[JPXInt]
- Special Effect - Destroy (Last created special effect)
- Game - Display to (All players) the text: END
- Set JPX_GROUP[JPXInt] = (Units within JPX_DMG_AOE[JPXInt] of TempLoc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of JPX_CASTER[JPXInt])) Equal to False)))
-
Unit Group - Pick every unit in JPX_GROUP[JPXInt] and do (Actions)
-
Loop - Actions
- Unit - Cause JPX_CASTER[JPXInt] to damage (Picked unit), dealing JPX_DMG[JPXInt] damage of attack type Magic and damage type Demolition
-
Loop - Actions
- -------- Destroy handles --------
- Custom script: call DestroyGroup(udg_JPX_GROUP[udg_JPXInt])
- -------- RecycleIndex --------
- Set JPX_Index[JPX_LOOP] = JPX_Index[JPX_Index_Size]
- Set JPX_Index[JPX_Index_Size] = JPXInt
- Set JPX_Index_Size = (JPX_Index_Size - 1)
- Set JPX_LOOP = (JPX_LOOP - 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
- Custom script: call RemoveLocation(udg_TempLoc)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Loop - Actions
- -------- Turn the trigger again off if the index_size is below 0... --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JPX_Index_Size Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
- Custom script: call RemoveLocation(udg_TempLoc2)
-
For each (Integer JPX_LOOP) from 1 to JPX_Index_Size, do (Actions)
-
Events
Last edited: