Home   Help Search Login Register  

Author Topic: DeleteVehicle prob's  (Read 1122 times)

0 Members and 1 Guest are viewing this topic.

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
DeleteVehicle prob's
« on: 06 May 2003, 17:45:50 »
 :D Hey m8s

Say, I have this scenery of repeatedly respawned (enemy-) groups (they spawn when x% is killed etc.)
And to save my squad from constantly stumbling across dead bodies & wrecks (it's a town fight, so the thick AI already have enough trouble in moving around ::) ;D ), I'd like to "deleteVehicle _x" some of the dead units & vehicles, only it HAS to be when I'm not watching, obviously.  :P :)


In short:

How can I count dead grpMembers of constantly respawned groups - and delete these  ???
(plus, each dead unit to delete must be outta my sight/some distance).


PeeEs: this is singlePlayer

« Last Edit: 06 May 2003, 18:10:54 by Tomb »

Gameer_77

  • Guest
Re:DeleteVehicle prob's
« Reply #1 on: 06 May 2003, 18:25:14 »
Quote
deleteVehicle object
Operand types:
    object: Object
Compatibility:
    Version 1.34 required.
Type of returned value:
    Nothing
Description:
    Delete any unit or vehicle. Only vehicles inserted in editor or created during mission can be deleted. Player unit cannot be deleted.

Example:
    deleteVehicle tank

If you're using createvehicle or unit, you can't delete the units during game. Though you can move them out of site, I guess.

You can probably use the scabby knowsabout command, but that's a bit rubbish.

[Edit] Oops, sorry ;D Mis-read the comref...

*runs off to change some things :P [/Edit]

Gameer
« Last Edit: 06 May 2003, 18:27:26 by Gameer »

CrashnBurn

  • Guest
Re:DeleteVehicle prob's
« Reply #2 on: 06 May 2003, 20:49:24 »
Quote
If you're using createvehicle or unit, you can't delete the units during game...

Sorry but you're wrong. Check my createunit tut at the editors depot. I do it all day long.

http://www.ofpec.com/editors/browse.php?browsewhat=1&start=25

@Tomb- Have a look at the tut. It'll show you how I delete vehicles also. Sorry I don't have an answer for you about seeing them being deleted. Maybe there's a way to check players view compared to the vehicles with getdir  ??? or since it's in a town, maybe distance command  would suffice ???
« Last Edit: 06 May 2003, 20:53:33 by CrashnBurn »

Gameer_77

  • Guest
Re:DeleteVehicle prob's
« Reply #3 on: 06 May 2003, 23:02:11 »
[Edit] Oops, sorry  Mis-read the comref...
Sorry but you're wrong. Check my createunit tut at the editors depot. I do it all day long.

I know ::)

Gameer
« Last Edit: 06 May 2003, 23:05:01 by Gameer »

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:DeleteVehicle prob's
« Reply #4 on: 06 May 2003, 23:28:58 »

...Tomb- Have a look at the tut. It'll show you how I delete vehicles also.

...Maybe...since it's in a town, maybe distance command  would suffice ???



==============

Yanno crashy, I'm as thick as the AI when it comes to finding the proper tutes around  ::) :-X  ;D

I'll check it out asap  :-*
And yeah, I thought about using distance stuff (didn't think about the dir though: good i-dir)  ;D 8)


dammit, all this stinkin scriptin'  >:( I'll NEVER learn to get it right!!!!!!!  >:( ;D
Been buggin me for 2 years now, them scrolls!

@ gameer: get those cells working m8, maybe something with "getpos veh.-to-delete"  ???
Like, if one could create an array of not-alive (spawned) units/veh's and check when each moron has a position right BEHIND player == "ZAPP!"  ??? :D

Lemme grab that tute first, & we'll see about it






thx so far, m8s  :-*


( *maybe all this, the repeated spawn of my 3 enemy_grp's and the ditto deleteVeh. should be made as a function instead? * )





« Last Edit: 06 May 2003, 23:36:44 by Tomb »

Gameer_77

  • Guest
Re:DeleteVehicle prob's
« Reply #5 on: 06 May 2003, 23:39:44 »
Right, well. ::)

I'm sure you can see if the player is looking at someone, using a complicated maths thing using cosine and crap. ;D

Ermm...I'll have a fiddle. :P

Gameer

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:DeleteVehicle prob's
« Reply #6 on: 06 May 2003, 23:43:18 »
sh*t - your as lost & far out as I am when it comes to this, I'm afraid  :P ::) ;D

Gameer_77

  • Guest
Re:DeleteVehicle prob's
« Reply #7 on: 06 May 2003, 23:47:18 »
Lol, yer ;D

An idea, to see if someone is behind you, is to constantly setpos something invisible, or small, directly behind the player (Of which I know the code to do so). Then check to see if the invisible thing is closer to the body than the player is.

Of course, there is probably some other, easier way to do it but I could whip up a scroll, mebbe, and see if it works.

Though I don't see the point if you've got things like 3rd person and command view ::)

Gameer

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:DeleteVehicle prob's
« Reply #8 on: 06 May 2003, 23:51:48 »
I don't - never do - I'm a die hard sucker for 1'st person realism  8)

Gameer_77

  • Guest
Re:DeleteVehicle prob's
« Reply #9 on: 06 May 2003, 23:57:03 »
I got something working. Give me 5 while I make it changable. :)

Gameer

Gameer_77

  • Guest
Re:DeleteVehicle prob's
« Reply #10 on: 07 May 2003, 00:18:54 »
Right, not fully working cause I gotta go get some sleep. ;D

In the 'ListOfUnits' array, only the first one works so if you can fix this yourself, great. Otherwise, i'll have a bash tomorrow ::) I'm sure it's easy.

Gameer

CrashnBurn

  • Guest
Re:DeleteVehicle prob's
« Reply #11 on: 07 May 2003, 00:40:06 »
Hey Tomby, here's a script that has a more proper syntax than my tutorial and uses distance to check before deleting. Use if you want...

;-----------------------------------------------------------------
;execute script as [position-to-create,groupname] exec "script.sqs"
;-----------------------------------------------------------------
#START
_pos = _this select 0
_grp = _this select 1
_units = units _grp
_leader = leader _grp
;-----------------------------------------------------------------
#LOOP
? !(alive player): exit
?(("Alive _x" count _units) < 3): goto "KILL"
?!(canmove _tank1): goto "KILL"
?!(canfire _tank1): goto "KILL"
~(random 5) + 5
goto "LOOP"
;----------------------------------------------------------------
#KILL
_tank1 setdammage 1
;wait for tanky to stop smokin
~(random 10) + 60
;----------------------------------------------------------------
;check if player is close by
#WAIT
?(player distance _leader > 100): goto "DELETE"
~(random 5)
goto "WAIT"
;----------------------------------------------------------------
#DELETE
"deletevehicle _x" foreach _units
~1
deletevehicle _tank1
~(random 10) + 10
;----------------------------------------------------------------
;create new tank with crew
_tank1 = "BMP" createvehicle getpos _pos
~2
"SoldierECrew" createunit [getpos _pos, _grp,"c1=this",1,"SERGEANT"]
"SoldierECrew" createunit [getpos _pos, _grp,"c2=this",1,"CORPORAL"]
"SoldierECrew" createunit [getpos _pos, _grp,"c3=this",1,"PRIVATE"]
~1
c1 moveincommander _tank1
c2 moveingunner _tank1
c3 moveindriver _tank1
~(random 10) + 5
goto "START"
« Last Edit: 07 May 2003, 17:24:46 by CrashnBurn »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:DeleteVehicle prob's
« Reply #12 on: 07 May 2003, 02:13:30 »
dere is a function in da function part of da ED dat tels u if da man is lookin @ object ;D u can try it  ;) - nd if u add da distance command 2 it itll prooly work kool ;D

D/L it nd use it in a script ;D (or u want me 2 make ur script also ::))

LCD OUT

"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:DeleteVehicle prob's
« Reply #13 on: 07 May 2003, 09:50:54 »
dare is a function (by me!!!) in da function party of da ELCEEDEE dat telephones u if da man is lookin like a @&#8364;$¤% f00ked up object ;D u can try it  ;)

....(or u want me 2 make ur script also ::))

LCD OUT






 ;D sure! I'd LOVE that. You bet  :-* ;D ;D


Meanwhile. I'll go play with beautiful crashy's little scroll there.


HANK'YA, CRASH  8)


==================================

[mod] :   well it almost worked, crashNburn. Except from a few details but I got it sorted  :)

Thanx again - I can do the jiggle from here, m8s  8) :-*

CYA



« Last Edit: 07 May 2003, 17:34:10 by Tomb »