OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 24Gamer on 04 Jun 2004, 17:03:29

Title: General
Post by: 24Gamer on 04 Jun 2004, 17:03:29
Does anyone know the simplist was to create a general with the name GEN?
Is there anyway to create a unit called GEN and change is type to a general?
Title: Re:General
Post by: 24Gamer on 04 Jun 2004, 17:29:30
my old code was
;_pos = getpos GENie
;Deletevehicle GENie
;GEN = "GeneralE" createvehicle _pos
;Removeallweapons GEN
;GEN setbehaviour "SAFE"
;GEN setcaptive true
;~16
;GEN playmove "Effectstandsitdown"
;~3
;GEN playmove "Effectstandsitdown"
;~3
;GEN playmove "Effectstandsitdown"

but that ment that each client made a General
i also did ?!(server etc) but that ment that the clients didnt recognize he was there (Hes a Target in the Intro)
Title: Re:General
Post by: DBR_ONIX on 04 Jun 2004, 18:09:29
What about putting this in the beggining :
Code: [Select]
?(genmade==1):exit
genmade=1

Then, when the first time it's run, genmade will not be set, so it won't exit
But the second run, it will already have set genmade to 1, so will exit the script..
So he will only be made once

I think that should work (Don't really do any MP scripting.. All SP my stuff)

- Ben
Title: Re:General
Post by: Artak on 04 Jun 2004, 18:12:36
Are you referring to http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=17746 this post?

I gave you an advice to do a search on the forum, with the search function and even showed how the button looks like. Did you do that? I can easily find about 50 posts covering this subject plus all the stuff that's in the editors depot.

If you want to know how to solve a multiplayer problem, you have better chance when posting your question to the multiplayer editing board.

If you want to create the General Guba unit in MP named as GEN here's what you need to do.

1. place a gamelogic in editor and name it as Server
2. place a east unit and write in his init field: gengroup = group this; deletevehicle
this
3. place a marker and name it as genpos
4. in a script or trigger or what ever you're using, use this line:
    ?(local Server): "GeneralE" createunit [getmarkerpos "genpos", gengroup, "GEN = this",1,"COLONEL"]

This will create a GeneralE unit at genpos marker's position and the unit is named as GEN.

So in your script it would look something like this:
Code: [Select]
?(local Server): "GeneralE" createunit [getmarkerpos "genpos", gengroup, "GEN = this; this setbehaviour {safe}; this setcaptive true",1,"COLONEL"]
~16
GEN playmove "Effectstandsitdown"
~3
GEN playmove "Effectstandsitdown"
~3
GEN playmove "Effectstandsitdown"

But if the unit is used already in an intro I can't imagine why you would want to create the unit in the first place. Why not just insert him in editor, and if he's in the way you can always use setpos on him, which is fat less complicated than createunit.
Cheers.
Title: Re:General
Post by: rhysduk on 04 Jun 2004, 19:11:53
Yes, exactly what artak said.

May i ask why you have posted the same question as that other post, when i  and macguba gave you a perfectly good answer, a working answer aswell, to your problem?
Title: Re:General
Post by: 24Gamer on 05 Jun 2004, 16:14:04
sry about posting a similar topic i just wondered if there was an easier way to create a unit because i didn't understand how the unit group worked.
about creating him in the editor, thats all i want to do but he isn't in the list of unit types  :-\
Title: Re:General
Post by: rhysduk on 05 Jun 2004, 17:01:13
Do you have the Kegetys Editor Upgrade? I think he is in there.. not sure though.

Use the method i said in your other topic, it works :)

Rhys
Title: Re:General
Post by: 24Gamer on 05 Jun 2004, 20:05:59
if you use the editor upgrade, doesn't it mean that everybodys gotta have it?
Title: Re:General
Post by: rhysduk on 05 Jun 2004, 22:30:27
Yes but most people have it anyway.. it only a couple of kilobytes :) maybe 20k

Rhys
Title: Re:General
Post by: macguba on 06 Jun 2004, 00:16:17
Everybody has it - it's the one addon that is genuinely not optional.