Jump to content


Photo

Giving a unit the selection icon when overlay


  • Please log in to reply
18 replies to this topic

#1 ZenBKage

ZenBKage

    Ini Coder/BFME2 Arcade Edition Creater

  • Hosted
  • 427 posts

Posted 03 January 2007 - 12:12 AM

i managed to make a unit out of the fireflight object that Drogoth fires. it can fully attack and move around no problem. if i drag a selection box over it i can select them but if i try to click on directly theres no box that appears to do so. is there a way to code in the selection box which appears say over a structure but onto a unit instead?
- Freedom is Choice -

#2 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 03 January 2007 - 12:17 AM

You need to draw a bounding in order to simplify selection of the object.

Bounding Box

If the model you are using does not have a bounding box already, you can add it using code, in order to simplify selection of the Object.
This is the typical code for a human-sized Object :

			Geometry = CYLINDER
	GeometryMajorRadius = 8.0
	GeometryMinorRadius = 8.0
	GeometryHeight = 19.2
	GeometryIsSmall = Yes
	Shadow = SHADOW_DECAL
	ShadowSizeX = 20;
	ShadowSizeY = 20;
	ShadowTexture = ShadowI;

edit the values accordingly, with the help of RenX (draw a box with the settings above, and see how it fits with your unit)
Software is like sex; it's better when it's free ~Linus Torvald

#3 ZenBKage

ZenBKage

    Ini Coder/BFME2 Arcade Edition Creater

  • Hosted
  • 427 posts

Posted 03 January 2007 - 01:35 AM

ok that seems to only affect the health bar. the actualy pulsing box which appears over the unit isnt appearing for me. for some reason other objects ive used it on, like trees and animals i have gotten them to work but this. dunno. i'll post the entire object code and see if im missing something.

;------------------------------------------------------------------------------
Object FireDragons

; *** ART Parameters ***
	Draw = W3DScriptedModelDraw ModuleTag_Draw
		DefaultModelConditionState
			Model	= EXDrogoth_FW
		;Texture	= Drogoth_C.tga GBFire.tga
		;Texture	= Drogoth_C2.tga GBFire.tga
		;Texture	= DrogothArmor.tga GBFire.tga
;		ParticleSysBone B_TAIL03 DrogothFlightFire FollowBone:yes
;		ParticleSysBone B_TAIL03 DrogothFlightSmoke FollowBone:yes
			ParticleSysBone B_HEAD DrogothFlightSmoke FollowBone:yes
			ParticleSysBone B_HEAD DrogothFlightFire FollowBone:yes
			ParticleSysBone B_HEAD DrogothFlightFire FollowBone:yes
			ParticleSysBone B_HEAD DrogothFlightFire FollowBone:yes
			ParticleSysBone B_HEAD DrogothFlightFire FollowBone:yes
			
			
		End
		IdleAnimationState
			Animation = EXDrogoth_FW
				AnimationName		= EXDrogoth_FW.EXDrogoth_FW
				AnimationMode		= LOOP
				AnimationBlendTime	= 0
			End
		End	
	End

; *** AUDIO Parameters ***;

	VoiceAttack							= DrogothVoxAttack
	VoiceAttackCharge					= DrogothVoxAttackCharge
	VoiceCreated						= EVA:DrogothCreated
	VoiceFullyCreated					= EVA:DrogothCreated
	VoiceFear							= EVA:DrogothHelpMe
	VoiceGuard							= DrogothVoxMoveMS
	VoiceMove							= DrogothVoxMoveMS
	VoicePriority						= 90
	VoiceSelect							= DrogothVoxSelect

	VoiceEnterStateAttack				= DrogothVoxEnterStateAttack
	VoiceEnterStateAttackCharge			= DrogothVoxEnterStateAttackCharge
	VoiceEnterStateAttackStructure		= DrogothVoxEnterStateAttackBuilding

	SoundAmbient						= DrogothVoxAmbientLoop
	SoundImpact							= ImpactHorse
	SoundMoveStart						= FellBeastMoveStart

; ***DESIGN parameters ***
		Side				= Men
		DisplayName		 = OBJECT:FireDragons
	EditorSorting	 = UNIT
	VisionRange			= VISION_FLIER
	ShroudClearingRange = SHROUD_CLEAR_FLIER
	Scale				= 0.75
	BuildCost			= 750
	BuildTime			= 30
	ShockwaveResistance = SHOCKWAVE_RESISTANCE_STRONG		
	CommandSet			= FireDragonCommandSet
	CommandPoints		= 75
  CrushableLevel   = 2;What am I?:		0 = for infantry, 1 = for trees, 2 = general vehicles
	WeaponSet
	
	; Primary is for special powers.
	
		Weapon				= SECONDARY		NazgulPlowAttack
		PreferredAgainst	= SECONDARY		STRUCTURE MACHINE HORDE INFANTRY CAVALRY

		Weapon				= TERTIARY		NazgulClawAttack
		OnlyAgainst			= TERTIARY		MONSTER

		ReadyStatusSharedWithinSet = Yes
	End

	ArmorSet
		Conditions	  = None
		Armor		   = DrogothArmor
		DamageFX		= FellBeastDamageFX
	End

; *** ENGINEERING Parameters ***
	RadarPriority = UNIT
	KindOf = PRELOAD SELECTABLE CAN_CAST_REFLECTIONS SCORE NO_FREEWILL_ENTER SCARY MONSTER CANNOT_RETALIATE GIANT_BIRD

	Body = ActiveBody ModuleTag_Body
		MaxHealth	   = 2000.0
	End

	Behavior = DestroyDie ModuleTag_DestroyDie
	End
	
	Behavior = BezierProjectileBehavior ModuleTag_Bezier
		FirstHeight						= 9	; Height of Bezier control points above highest intervening terrain
		SecondHeight					= 9
		FirstPercentIndent				= 20%; Percentage of shot distance control points are placed
		SecondPercentIndent				= 100%
		FlightPathAdjustDistPerSecond	= 50; Can allow a max speed this can attempt to follow a target. Units are their velocity we can tag. 

(45 is default human speed)
		DetonateCallsKill				= Yes
		CurveFlattenMinDist				= 50.0
	End

	#include "..\..\..\includes\StandardUnitEvaEvents.inc"

	Behavior = PhysicsBehavior ModuleTag_Physics
		KillWhenRestingOnGround = Yes
		GravityMult = 0.0
	End

	 Behavior = GiantBirdAIUpdate ModuleTag_GiantBirdAI
		AutoAcquireEnemiesWhenIdle	= Yes ATTACK_BUILDINGS
		MoodAttackCheckRate			= 500
		AILuaEventsList				= FellBeastFunctions	
		FollowThroughDistance		= 200
		FollowThroughCheckStep		= 50
		FollowThroughGradient		= 1.0
		
		GrabTossTimeTrigger			= 2.5
		GrabTossHeightTrigger		= 100.0
		TossFX						= FX_DiebyFalling
		SpecialContactPoints		= Swoop

		AttackPriority = AttackPriority_FellBeast
	  End
	
	  LocomotorSet
		Locomotor = FellBeastLocomotor
		Condition = SET_NORMAL 
		Speed	 = 75  
	  End
	  LocomotorSet
		Locomotor = FellBeastLocomotor; BALANCE FellBeast
		Condition = SET_SUPERSONIC 
		Speed	 = 100 
	  End
	  LocomotorSet
		Locomotor = FellBeastLocomotor; BALANCE FellBeast
		Condition = SET_WANDER 
		Speed	 = 78
	  End
	  LocomotorSet
		Locomotor = FellBeastSwoopLocomotor; BALANCE FellBeast
		Condition = SET_PANIC
		Speed	 = 160
	  End
  
	Behavior = FXListDie ModuleTag_Die
		DeathTypes	= ALL
		DeathFX		= FX_DrogothFlamingProjectileExplosion
	End

	Behavior = StancesBehavior ModuleTag_StancesBehavior
		StanceTemplate = Hero
	End

	Geometry				= CYLINDER
	GeometryMajorRadius 	= 30.0
	GeometryMinorRadius 	= 30.0
	GeometryHeight			= 16.0
	GeometryIsSmall			= No
End

- Freedom is Choice -

#4 Grim

Grim

    Mad Axe

  • Project Team
  • 537 posts
  •  T3A Team Chamber Member
  • Division:T3A Moderator

Posted 03 January 2007 - 01:50 AM

I don't understand what your pulsing box is.
Is it the boundingbox? (doesn't seem so)
Is it the healthbar? (doesn't seem so)
Is it the pulsing fx when you select a unit or structure?
Is it that defectuous pixel on your screen? :thumbsdownsmiley:
Posted Image

#5 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 03 January 2007 - 01:54 AM

the selectiondecal defined in experiencelevels.ini ?
Software is like sex; it's better when it's free ~Linus Torvald

#6 ZenBKage

ZenBKage

    Ini Coder/BFME2 Arcade Edition Creater

  • Hosted
  • 427 posts

Posted 03 January 2007 - 03:06 AM

when you move your mouse cursor (the arrow) over a non-selected (non-clicked on) unit or structure on the playing field u get a box which pulses in and out slightly. interestingly enough trying to get a screenshot of it doesnt show up at all.
- Freedom is Choice -

#7 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 03 January 2007 - 09:48 AM

never seen a pulsing box..must be a bug with your pc or something
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#8 Hard_Sander

Hard_Sander
  • Members
  • 244 posts

Posted 03 January 2007 - 10:14 AM

Those boxes exist ingame. :p I have them?

#9 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 03 January 2007 - 11:23 AM

had a talk with Zen on MSN, and I understood what he meant :p

it's just the cursor change when you move over something selectable (from arrow to animated square thing).

so the problem is probably that the unit is not selectable due to the absence of a bounding box
Software is like sex; it's better when it's free ~Linus Torvald

#10 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 03 January 2007 - 12:13 PM

oh that pulsing box :p
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#11 ZenBKage

ZenBKage

    Ini Coder/BFME2 Arcade Edition Creater

  • Hosted
  • 427 posts

Posted 03 January 2007 - 05:13 PM

lol a bug in the pc. yeah. anyway hehe. yes that box. ive managed to make units like the bear, some trees selectable with this box so would those be bounded and the object im trying to get this to work not bounded? or is it simply code?
- Freedom is Choice -

#12 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 04 January 2007 - 12:25 AM

i think the SDK documentation has a small bit about BBoxes

really, everyone should read it. it's not just crap, you know :grin:

Edited by 2playgames, 04 January 2007 - 12:26 AM.

bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#13 ZenBKage

ZenBKage

    Ini Coder/BFME2 Arcade Edition Creater

  • Hosted
  • 427 posts

Posted 04 January 2007 - 04:16 PM

from what ive been told buildings dont have bboxes which means technically you could simply code it in. how would u do this? ive investigated into the inis for various structures but nothing stands out.
- Freedom is Choice -

#14 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 04 January 2007 - 05:34 PM

read my first post where I detail what you need to know about bounding boxes :grin:

Edited by 2playgames, 04 January 2007 - 08:24 PM.

Software is like sex; it's better when it's free ~Linus Torvald

#15 ZenBKage

ZenBKage

    Ini Coder/BFME2 Arcade Edition Creater

  • Hosted
  • 427 posts

Posted 04 January 2007 - 08:43 PM

if i have to use a 3d program as well as inputting the code i dont think it will work. argolis tried yesterday to add a bounding box to the unit and the program wouldnt accept it for some reason.
- Freedom is Choice -

#16 Hard_Sander

Hard_Sander
  • Members
  • 244 posts

Posted 05 January 2007 - 08:03 PM

i think the SDK documentation has a small bit about BBoxes

really, everyone should read it. it's not just crap, you know :huh:


Is there an SDK Documentation? :p
*checks*
Yes, there is! ;)

Edit: I even found an typo.

Edited by Hard_Sander, 05 January 2007 - 08:12 PM.


#17 ZenBKage

ZenBKage

    Ini Coder/BFME2 Arcade Edition Creater

  • Hosted
  • 427 posts

Posted 06 January 2007 - 06:36 PM

theres a civlian prop called Bag and by adding the SELECTABLE term to its KindOf a bbox appears for it, yet try as i might none appear for the fireflight object.
- Freedom is Choice -

#18 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 06 January 2007 - 07:53 PM

by adding the SELECTABLE term to its KindOf a bbox appears for it

just to clarify, a bbox (bounding box) is not the pulsing cursor, it's 3d box around your object. if the cursor touches that box it will change into the 'pulsing box'.

so the bag has always had a bbox, it just wasn't used :p
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#19 ZenBKage

ZenBKage

    Ini Coder/BFME2 Arcade Edition Creater

  • Hosted
  • 427 posts

Posted 06 January 2007 - 10:17 PM

f'ing bag lol ok riddle me this. why is it i cant code the selection cursor from a building into this unit?
- Freedom is Choice -




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users