Home   Help Search Login Register  

Author Topic: create unit (name)  (Read 1167 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
create unit (name)
« on: 17 Mar 2005, 20:38:36 »
right i was wondering how i can give a name to a created unit
i know how to create a new unit
i also looked in the com ref under create unit but no look just tells me how to set the skill and rank etc

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:create unit (name)
« Reply #1 on: 17 Mar 2005, 20:41:22 »
Code: [Select]
"Civilian" createunit [getpos player,group player,"MyNameIsCalvin = this"]
I like your approach, lets see your departure.
Download the New Flashlight Script!

Offline 456820

  • Contributing Member
  • **
Re:create unit (name)
« Reply #2 on: 19 Mar 2005, 12:51:01 »
thanks i need to test it first but also is there a way of creating units but not assighning them to a group

Silencer

  • Guest
Re:create unit (name)
« Reply #3 on: 19 Mar 2005, 13:06:21 »
Car = "SkodaGreen" createVehicle getpos CarStore

This will create a "Green Skoda" on a marker named "CarStore" and it will name the Green Skoda "Car"

You can also use the CamCreate command, so it will be:

NAMEYOUWANTTOGIVE = "NAMEOFUNIT" CamCreate getpos NAMEOFMARKER


Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:create unit (name)
« Reply #4 on: 19 Mar 2005, 14:42:37 »
thanks i need to test it first but also is there a way of creating units but not assighning them to a group
No there is not..
With createUnit you need to assign the unit to a group ir it will not get created...

Quote
Car = "SkodaGreen" createVehicle getpos CarStore

This will create a "Green Skoda" on a marker named "CarStore" and it will name the Green Skoda "Car"
This will not create anything on the position of a marker named 'CarStore'...
You can't getPos a marker, you need to use getMarkerPos...
(nit picking...)

Furthermore, createVehicle will create an empty vehicle, can not be used on men...
It will create a man but it will be an semi-empty shell, which reacts only when it gets shot and the reaction is to bleed...

camCreate will create an empty vehicle which can not be used in any way...
And if you camCreate a soldier it will be just an empty 'shell'...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Silencer

  • Guest
Re:create unit (name)
« Reply #5 on: 19 Mar 2005, 15:10:45 »
Car = "SkodaGreen" createVehicle getpos CarStore
This works perfect for me!

To create an empty car.
I didn't test it for units/ car with crew in it
« Last Edit: 19 Mar 2005, 15:11:58 by Silencer »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:create unit (name)
« Reply #6 on: 19 Mar 2005, 15:39:49 »
AFAIK you can't create a crewed vehicle,you can only create an empty vehicle and then create the crew separately.

Using creatUnit to create the crew you should be able to set the skill and rank of each unit created.

"SoldierType" createUnit [position, group, "init", skill, "rank"]

Example:

"SoldierEB" createUnit [getMarkerPos "marker1", groupA, "loon1 = this", 0.8, "private"]



Planck
I know a little about a lot, and a lot about a little.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:create unit (name)
« Reply #7 on: 19 Mar 2005, 15:50:37 »
Silencer, are you sure you have a marker named CarStore and not a GameLogic object? This would explain why you and nobody else can use getpos instead of getmarkerpos on markers.  ;)


Quote
thanks i need to test it first but also is there a way of creating units but not assighning them to a group
As HateR_Kint already pointed out, no, there is no way.

However, you can assing empty groups by inserting a unit on map and having grp1 = group this; deletevehicle this in it's init field. Doing so will maintain a valid groupname (placeholder, array, whatever), without having anyone in it.

A nifty way is to have the group leader ready on map at some remote place and when creating units to that group, just setpos the leader to the spot where you want the group to be.

Not all is lost.

Silencer

  • Guest
Re:create unit (name)
« Reply #8 on: 19 Mar 2005, 18:56:08 »
Ah lol,

I used a FlagPole :) My fault! :P

Offline 456820

  • Contributing Member
  • **
Re:create unit (name)
« Reply #9 on: 20 Mar 2005, 13:04:15 »
since you cant create a soldier without including a group can you create that soldier in to its own group like the line you create it for make a lin for the soldier's init line and have grp4 = group this

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:create unit (name)
« Reply #10 on: 20 Mar 2005, 14:20:59 »
I think, if you do that then the whole group (the group he born into) will be referred as grp4. Maybe. Dunno.  ???

What you can do though is to have name the unit in the createunit command's init part and also put in '[this] join grpnull', then have grp4 = group unitname/this.
Not all is lost.