Official BF Editor Forums: Object.create, But Is There An Object.destroy ? - Official BF Editor Forums

Jump to content

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

Object.create, But Is There An Object.destroy ?

#31 User is offline   Freeze Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 162
  • Joined: 14-August 08
  • Gender:Male

Posted 13 July 2010 - 01:35 AM

View PostUberWazuSoldier, on 12 July 2010 - 11:49 PM, said:

Well, because it spawns it in front of the host player, which on a server it doesn't have. No idea why it would work in 2142, and who does it spawn in front of? You can spawn soldiers with gameLogic.createObject though, which is quite cool. You can always make an objectspawner with python and spawn that objectspawner with object.create - that works every time (except soldiers).


Yeah, I tried it with soldiers to no avail with object.create, but it works fine with gameLogic.createObject which unfortunately is limited to 1 player in BF2.

In 2142 it seems to pick a certain player to spawn it in front of. I'm guessing that it's always the last player that joined the game.
0

#32 User is offline   Cobra_SFX Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 121
  • Joined: 29-August 05
  • Location:NW UK

Posted 18 July 2010 - 02:03 AM

Has anyone tried messing around with something like this in python? ...

if status == bf2.GameStatus.EndGame:
 		numplayers = 1

#Some hack to pick a person as the active player?
# spawn your stuff - can it be spawned to coords?
 		
 		for p in bf2.playerManager.getPlayers():
 	  		numplayers += 1

0

#33 User is offline   Cobra_SFX Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 121
  • Joined: 29-August 05
  • Location:NW UK

Posted 23 July 2010 - 06:39 PM

I spawned a Hotel on my server then tried Object.Delete, it didnt delete it but it did make it NotSolid and i could walk straight thru it, weird.
0

#34 User is offline   UberWazuSoldier Icon

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 1,172
  • Joined: 18-December 08
  • Location:Auckland, New Zealand

Posted 24 July 2010 - 02:08 AM

Well, that's since it doesn't have networkableInfo, so it was deleted, but your client didn't see the changes. It's odd that it saw it when it spawned in, but that may be possible I guess, :mellow:
Roflbox/Operation Dead Dawn Developer. (Ninjamod is taking a back seat for now)

Posted Image
0

#35 User is offline   Cobra_SFX Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 121
  • Joined: 29-August 05
  • Location:NW UK

Posted 24 July 2010 - 02:15 PM

I gave it basic networkable info when spawning it and it was solid when spawned, i could walk straight through the building after using Object.delete but my bullets still found it solid :/
0

#36 User is offline   UberWazuSoldier Icon

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 1,172
  • Joined: 18-December 08
  • Location:Auckland, New Zealand

Posted 24 July 2010 - 09:38 PM

Well, they would've looked solid yeah, but in reality they kept going hehe.

That's interesting though, it makes me suspect that adding networkableInfo just before spawning might not work 100%. Like, maybe when it gets destroyed it stops sending networkableInfo to the client, and since the client wasn't expecting it to send any anyway, it just thinks "Oh, it's still there". That's my theory anyway, not based on any proof :lol:
Roflbox/Operation Dead Dawn Developer. (Ninjamod is taking a back seat for now)

Posted Image
0

#37 User is offline   Cobra_SFX Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 121
  • Joined: 29-August 05
  • Location:NW UK

Posted 25 July 2010 - 05:26 PM

Oh they work fine for a round, no issues whatsoever really, just thought i would try the delete but in the bF2 demo your left with something the projectiles can hit but you can run through so its no use really, your theory is about right from what i tried, its collision is gone (for players) but projectiles still think its there and its still visible (to me anyway).
0

#38 User is offline   Freeze Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 162
  • Joined: 14-August 08
  • Gender:Male

Posted 25 July 2010 - 06:30 PM

You can only spawn them by giving them a networkable info on the same instance, which then disappears in a way, since you can't really move them on the client's screen.

So, maybe you can use object.delete on them if you give them a networkable info on the same instance you delete them.

ie...

to create:

ObjectTemplate.active hotel
ObjectTemplate.setNetworkableInfo BasicInfo
gamelogic.createobject hotel

to delete:

ObjectTemplate.active hotel
ObjectTemplate.setNetworkableInfo BasicInfo
Object.delete hotel_id

This post has been edited by Freeze: 25 July 2010 - 06:31 PM

0

#39 User is offline   Cobra_SFX Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 121
  • Joined: 29-August 05
  • Location:NW UK

Posted 25 July 2010 - 07:42 PM

That is the way i deleted it Freeze, but it just deletes its collision, not the visible object, although i didnt delete by ID, just the Object.delete

No worries i just thought i would post what happens that way, im getting quite good at getting the buildings etc correct from spectator mode :)

I found this but havent tried it yet, i guess its a case of making the object active then using this ...

networkableinfo.deleteinfo

Then delete the object

This post has been edited by Cobra_SFX: 25 July 2010 - 09:04 PM

0

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users