Jump to content


Photo

making buyable items ?


  • Please log in to reply
20 replies to this topic

#1 MigLeader

MigLeader
  • Members
  • 41 posts

Posted 01 September 2008 - 12:12 PM

hi there


1-is there a trick i can make so that i make heros can buy items to improve them.

2-if buying items is possible , then can i make them drop or pick the items again.

3-if possible , can i make these items appear in the hero inventory .

4-i have tried to make the player change the heros powers while he is in game , i made a trigger with a map to give the hero a new power if he stand on it , it worked nice , but the problem is i must give all heros the behaviors and modules in his .inis and thats a really hard work , is there a workaround .

i know a lot of modding and modeling but a little map making so all i want is the idea on how to make , if there is something i don't understand then i will ask about it then.

thx for any help i get

#2 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 01 September 2008 - 01:46 PM

1) I'm not sure there is a way of making items... *

2) Dropping items seems like being highly impossible... *

3) Inventory seems (to me) impossible... *

4) Yes all the heros would need the behavior modules, but a suggestion would be is to make a .INC file and refer to it in all the hero's code, that way you can add or remove some 'powers' without having to change it on all the heros!

* if its possible i would love to know how to make that work too :p
Ridder Geel

#3 MigLeader

MigLeader
  • Members
  • 41 posts

Posted 01 September 2008 - 07:28 PM

i mean we can make an item like an upgrade that makes the hero damage for ex. +200 , then if i press on the button it just removes the upgrade then creates an object under the hero , but the hard thing is making these buttons to remove these upgrades , maybe i need some more looking around .

btw thx for the idea of .inc it will help alot.

i will post here as soon i get more results.

bye

#4 Ring o' Fate

Ring o' Fate

    The Ghost.

  • Project Team
  • 1,627 posts
  • Location:PA
  • Projects:Trying to find meaning...
  •  The guy that is just a ghost.

Posted 01 September 2008 - 07:33 PM

Two words that says it's possible: Grim Mods
A changed man is only the same man with a different outlook of life.

#5 Fingulfin

Fingulfin

    I Like Pi3. Do you?

  • Hosted
  • 1,752 posts
  • Location:California, USA
  • Projects:Staying Alive.
  •  This place looks familiar. I can't remember why.

Posted 03 September 2008 - 01:10 AM

The hard part isn't removing upgrades, its getting the dropped items {crates} to be pickuppable {actually, to make the upgrades "within" the crates to be pickuppable}.

Grim's mods might be a lead, he did alot of crazy stuff. Check out his BFME I mod especially.

If you don't want to, I can give you a few pointers:
1: Check out code relating to the one ring in the Ring Heroes INIs.
2: Check out the code relating to the one ring in the fortress INIs.
3: Specifically, in those files look for the part where it REMOVES the upgrades.
Posted Image
--------------------------------------
"You look like a ghost of your former self..."

#6 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 03 September 2008 - 01:57 PM

Here is the code of the ring found in Crate.ini:
;------------------------------------ Ring ------------------------------------------------

Object TheDroppedRing

	Draw = W3DScriptedModelDraw ModuleTag_01
		DefaultModelConditionState
			Model = TheRing
			ParticleSysBone NONE OneRing
		;ParticleSysBone NONE OneRingAura
			Shadow			= SHADOW_ADDITIVE_DECAL
			ShadowSizeX		= 200
			ShadowSizeY		= 200
			ShadowTexture	= MUCatapultFP02
			ShadowMaxHeight   = 200
			ShadowOverrideLODVisibility = yes
		End
		IdleAnimationState
			Animation
				AnimationName = THERING.THERING
				AnimationMode = LOOP
			End
		End
	End

	EditorSorting		= MISC_MAN_MADE
	DisplayName			= OBJECT:TheOneRing
	Side 				= Civilian
	KindOf				= SELECTABLE IMMOBILE NOT_AUTOACQUIRABLE UNATTACKABLE REVEAL_TO_ALL	CRATE ONE_RING	; Only Salvage crates are marked Selectable so the Mouse can interact with them and give Salvage voices.  Being dead makes them not actually selectable
	ThreatLevel			= 0.0
	ShroudClearingRange	= 100

	Body = HighlanderBody ModuleTag_Body;Can take damage, but won't die.  Can only die from ::kill() or other unresistable damage
		MaxHealth	  = 1.0
	End

; *** AUDIO Parameters ***;

	EvaEnemyObjectSightedEvent	= DiscoveredRing		; This is so that we get the DiscoveredRing event if it is unstealthed when we first see it

	ClientUpdate = EvaAnnounceClientCreate ModuleTag_AnnounceCreate
	; And this covers the case where the Ring spawns in while in sight of the player's troops
		AnnouncementEventEnemy = DiscoveredRing
		AnnouncementEventAlly = DiscoveredRing
		AnnouncementEventOwner = DiscoveredRing


		OnlyIfVisible = Yes					; Don't announce if hidden in the shroud
		UseObjectsPosition = Yes			; Play from the Ring's position
		CreateFakeRadarEvent = Yes			; Allow player to jump to the Ring after hearing annoucement

		DelayBeforeAnnouncementMS = 1000	; Allow 1 second before announcing. This is mostly so that if someone is right on top of the ring, we can use the pickup event to block the discovered event
											; and not get two announcements

	; CountAsFirstSightedAnnoucement = Yes; Doesn't matter since this unit doesn't use EvaOnFirstSightingEventEnemy/NonEnemy
	End
	
	ClientUpdate = RadarMarkerClientUpdate ModuleTag_RadarMarker
		MarkerType = PingOneRing
	End

;---------------------------

	Behavior = AttachUpdate ModuleTag_Attach
		ObjectFilter			= ANY +INFANTRY +CAVALRY +HERO +MONSTER +MACHINE -WORKING_PASSENGER -NO_COLLIDE -INERT -IGNORED_IN_GUI -PROJECTILE -NEUTRALGOLLUM -NOT_AUTOACQUIRABLE -WildSpiderling_Slaved -IsengardExplosiveMine -Wyrm -WargSentry NOT_FLYING_UNITS
		ScanRange				= 10
		ParentStatus			= HOLDING_THE_RING
		AlwaysTeleport			= No
		AnchorToTopOfGeometry	= Yes
		
		// Eva events to play when the Ring is picked up by the local player / an ally / an enemy
		ParentOwnerAttachmentEvaEvent = RingPickedUpLocal
	;ParentAllyAttachmentEvaEvent =   Nothing for now! (Are we sure???)
		ParentEnemyAttachmentEvaEvent = RingPickedUpEnemy
		
		ParentOwnerDiedEvaEvent = LocalPlayerLosesRing; E.g. the unit carrying the ring died, so we lost it.
	;ParentAllyDiedEvaEvent =  Nothing (for now)
	;ParentEnemyDiedEvaEvent = Nothing (for now)
		
	End

; Remove the ring hero upgrade from which ever player created us. This is to remove the ability to build
; the ring heroes when out fortress holding the ring has been nuked.
	Behavior = RemoveUpgradeUpgrade ModuleTag_RemoveRingFromPlayer
		TriggeredBy					= Upgrade_IsengardFaction Upgrade_MordorFaction Upgrade_WildFaction Upgrade_MenFaction Upgrade_ElfFaction Upgrade_DwarfFaction
		UpgradeToRemove				= Upgrade_RingHero
		SuppressEvaEventForRemoval	= Yes
	End

	Behavior = DestroyDie ModuleTag_Die
	End
	
	Behavior = CreateObjectDie ModuleTag_DropTheRing
		CreationList = OCL_TheOneRing
	End
	
	Geometry			= CYLINDER
	GeometryMajorRadius = 10.0
	GeometryHeight		= 10.0
	GeometryIsSmall		= Yes
	//Shadow				= SHADOW_VOLUME
	Shadow = SHADOW_DECAL

End

Looks like its not too difficult to make after all :thumbsupdrool:
You might want to concider looking at the 'money' chests, they might help a bit too :D

The fortresses all use this code for the one ring:

; Must come BEFORE the CreateObjectDie; when the CreateObjectDie processes the death,
   ; it will remove our ring upgrade which will remove the ONE_RING model condition which will
   ; confuse the FXList into thinking this was not the fortress with the one ring...
	Behavior = FXListDie ModuleTag_AnnounceWeLostTheRing
		DeathFX = AnnounceFortressDeathLostRingFX ; FXList checks for ONE_RING model condition internally
	End
	

; Spawn a dropped ring object if we have the ring hero upgrade
	Behavior = CreateObjectDie ModuleTag_DropTheRing
		CreationList	= OCL_TheOneRing
		
	; Needs both the player and object versions to create a ring when destroyed.
		UpgradeRequired	= Upgrade_RingHero Upgrade_FortressRingHero
	End

	Behavior = ModelConditionUpgrade ModuleTag_ForFX
		TriggeredBy			= Upgrade_RingHero Upgrade_FortressRingHero
		RequiresAllTriggers	= Yes
		AddConditionFlags	= ONE_RING
	End
	
; Special draw module just for rendering the ring model over the fortress to indicate ownership.
	Draw = W3DScriptedModelDraw ModuleTag_RingFX
		DefaultModelConditionState
			  Model = None
		End
		
	; Higher version for tall towers.
		ModelConditionState = ONE_RING BUILD_VARIATION_TWO
			Model = EXOneRing_CR
		End

		ModelConditionState = ONE_RING
			Model = EXOneRing
		End
		
	End

As you can see the upgrade for the ring above the fortress needs 2 upgrades, these are removed when a ring hero is made:

; Player no longer has the ring hero upgrade when the hero is created.
	Behavior = RemoveUpgradeUpgrade ModuleTag_RemoveRing
		TriggeredBy					= Upgrade_WildFaction Upgrade_IsengardFaction Upgrade_MordorFaction Upgrade_GoblinFaction
		UpgradeToRemove				= Upgrade_RingHero Upgrade_FortressRingHero
		RemoveFromAllPlayerObjects	= Yes
		SuppressEvaEventForRemoval	= Yes; Hack -- this is to avoid the Eva event about 'Gollum stole our ring'
										; when we are actually losing the upgrade because we built the ring hero
	End

; Spawn a dropped ring object.
	Behavior = CreateObjectDie ModuleTag_DropTheRing
		CreationList = OCL_TheOneRing
	End

This should save you some time searching :D
Ridder Geel

#7 MigLeader

MigLeader
  • Members
  • 41 posts

Posted 04 September 2008 - 12:08 PM

thanks for all help

i will post back after i get new results

thanks again

#8 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 17 March 2009 - 12:47 AM

thanks for all help

i will post back after i get new results

thanks again

I know this is an OLD post...way Before i joined ...
I was Thinking if this idea .. To use a Sword model - found in worldbuider civilian objects
Then Allow it to be picked up by only a hero or certain heroes i.e ones with a sword
That allows for an inceased attack or something special

It picks up and is destroyed like a crate OR hovers over their heads to show who has it .
When they die they just drop it ..

ANY IDEAS ....

#9 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 17 March 2009 - 07:28 AM

...Thats what the RC Mod is planning on doing :p (or something like it) :p
When we manage to get our system to make that work we will post it here for you if you wish :D
Ridder Geel

#10 Elrond99

Elrond99

    title available

  • Hosted
  • 464 posts
  • Location:Austria
  • Projects:None at the moment
  •  Modder without work and time :-S

Posted 17 March 2009 - 05:04 PM

definitly possible

I´m thinking of adding such things too, the question is just, is it possible to assign it to a bone rather than having it flying on top of the head

#11 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 17 March 2009 - 05:21 PM

I think it is... Just add this kind of code to the 'crate'/item :p
Draw = W3DScriptedModelDraw weapon_item
		DefaultModelConditionState
			Model = Model....
		End
		AttachToBoneInAnotherModule = Bone...
	End

This may work, it may also not work ;)
Ridder Geel

#12 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 17 March 2009 - 05:32 PM

Well, that should work as long as the sword has the right position, plus you'd have to add that code for every unit that can carry the item ^^

For a full item system it would be cool to have a CommandButton "Inventory" that changes the CommandSet to a transport-like interface. That is, the unit itself is a transport and the items are held inside like a unit would be inside a boat, using "inventory slots". How cool is that.

If you'll allow me I'll add another question. Would this work?

Behavior = RemoveUpgradeUpgrade ModuleTag_CoolItemRemove
		TriggeredBy					= Upgrade_ItemRemover
		UpgradeToRemove				= Upgrade_MyCoolItem Upgrade_ItemRemover
	End

This way I, in theory, could remove my "cool item" upgrade anytime by giving Upgrade_ItemRemover (and it could be done several times as well).
Do you guys think this would work?


Ps: I'm working on an RPG-styled CaH map where the inventory is displayed as Player Powers after they're bought from a shop. I can't change the commandsets of CaHs so that's the only way to go :S
Anyone up to make an RPG mod? ;)

Posted Image


#13 Fingulfin

Fingulfin

    I Like Pi3. Do you?

  • Hosted
  • 1,752 posts
  • Location:California, USA
  • Projects:Staying Alive.
  •  This place looks familiar. I can't remember why.

Posted 17 March 2009 - 05:57 PM

The problem isn't removing the upgrade (either on death or button upgrade; it doesn't matter), the problem is making it so PICKING UP the crate ADDS an upgrade. Crates weren't designed to do that, and as of right now only one person has been able to successfully do it... And I can't crack his code.
Posted Image
--------------------------------------
"You look like a ghost of your former self..."

#14 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 17 March 2009 - 07:00 PM

The only things that I know can be done with "crate" objects are:
Behavior = SalvageCrateCollide ModuleTag_02
	ForbiddenKindOf = PROJECTILE ENVIRONMENT IGNORED_IN_GUI
;	PickupScience = SCIENCE_GLA ; Only GLA players can pick this up
	ExecuteFX = FX_GoldChestPickup

	BannerChance = 10%
	LevelUpChance = 100%
	LevelUpRadius = 100.0
	ResourceChance = 20%
	MinResource = 25
	MaxResource = 75
	AllowAIPickup = No
  End

And I don't think you can give an upgrade with a death module. Only way would be scripting.

Edited by Crusard, 17 March 2009 - 07:07 PM.

Posted Image


#15 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 17 March 2009 - 07:28 PM

The problem isn't removing the upgrade (either on death or button upgrade; it doesn't matter), the problem is making it so PICKING UP the crate ADDS an upgrade. Crates weren't designed to do that, and as of right now only one person has been able to successfully do it... And I can't crack his code.


Who has done this? gimme the code and ill have a go ;)
Ridder Geel

#16 The 10th Rider

The 10th Rider
  • Members
  • 198 posts
  • Location:Somewhere in the middle of nowhere

Posted 17 March 2009 - 10:59 PM

This is sorta on topic, so I wont make another topic for it: Is it possible to make an item (like the ring) that when picked up, you can go into the heroes screen and click on any heroes portrait you already have recruited/revived to give that to them?

#17 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 17 March 2009 - 11:56 PM

WELL if its possible great ..
This is the route i will look at..

1...try to add this condition to a hero who picks it up

Behavior = ModelConditionUpgrade ModuleTag_ForFX
TriggeredBy = Upgrade_RingHero Upgrade_FortressRingHero
RequiresAllTriggers = Yes
AddConditionFlags = ONE_RING
End

2... then an FX or something ...

; Special draw module just for rendering the ring model over the fortress to indicate ownership.
ModelConditionState = ONE_RING
Model = EXOneRing
End

then a weaponset change in the hero file

WeaponSet
Conditions = ONE_RING
Weapon = PRIMARY GondorAragornHeroSword_SUPER
End

I see this in the upgrade file but I want to know how the upgrade is granted to that specific player ...
; This is the upgrade that get applied to the player that holds the ring.
Upgrade Upgrade_RingHero


Also is it possible to create a NEW Conditions = ONE_SWORD ?? how

4.. what is this code about ...found in crate file

; UpgradedBoost = UpgradeType:Upgrade_AmericaSupplyLines Boost:25

Edited by JUS_SAURON, 17 March 2009 - 11:59 PM.


#18 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 18 March 2009 - 12:57 AM

Also is it possible to create a NEW Conditions = ONE_SWORD ?? how


Not sure you can create new conditions, but you can surely use others from the game such as COLLECTING_WOOD, etc. (doesn't necessarily mean you're collecting wood ;))

Posted Image


#19 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 18 March 2009 - 02:57 PM

No, you cant make new conditions, you would need to edit game.dat... and nobody has been very successful with it :p (Ive managed to do some things with it but then somehow your Version # becomes random... so you cant play online... :p
Ridder Geel

#20 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 04 April 2009 - 07:40 PM

Here's something interesting from walls which inherit the upgrade when in proximity of an upgraded fortress:

Behavior = InheritUpgradeCreate ModuleTag_InheritStonework
		Radius			= DWARVEN_FORTRESS_WALL_EFFECTIVE_RADIUS
		Upgrade			= Upgrade_DwarvenFortressDwarvenStonework
		ObjectFilter	= ANY +DwarvenFortressCitadel
	End

If we add a similar code to a hero, then "picking up" an item (getting inside the inheritance radius) would trigger an upgrade :p

Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users